Skip to content

Commit

Permalink
apache setup user
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardTMiles committed Jan 19, 2025
1 parent 0db25bc commit e0873b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
22 changes: 3 additions & 19 deletions .github/assets/shell/powerLevel10k.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ usermod -s "$(which zsh)" "$(whoami)"
# Step 3: Install PowerLevel10k
echo "Installing PowerLevel10k..."
P10K_DIR="$HOME/.zsh/themes/powerlevel10k"

if [ ! -d "$P10K_DIR" ]; then
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "$P10K_DIR"
else
Expand All @@ -31,29 +32,12 @@ grep -q "source $P10K_DIR/powerlevel10k.zsh-theme" "$ZSHRC" || echo "source $P10

curl -o ~/.p10k.zsh https://raw.githubusercontent.com/MilesSystems/aws-deployment/refs/heads/main/.github/assets/shell/.p10k.sh

# Step 5: Clone powerlevel10k-media and install Nerd Fonts
echo "Installing Nerd Font (MesloLGS NF)..."
MEDIA_REPO="$HOME/.zsh/powerlevel10k-media"
if [ ! -d "$MEDIA_REPO" ]; then
git clone --depth=1 https://github.com/romkatv/powerlevel10k-media.git "$MEDIA_REPO"
else
echo "PowerLevel10k media repository is already cloned at $MEDIA_REPO."
fi

FONT_DIR="$HOME/.local/share/fonts"
mkdir -p "$FONT_DIR"
cp "$MEDIA_REPO/"*.ttf "$FONT_DIR"

# Refresh font cache
fc-cache -fv
cp ~/.p10k.zsh /home/apache/.p10k.zsh

# Step 6: Reload Zsh
# Step 5: Reload Zsh
echo "Reloading Zsh to apply changes..."
if [ -z "$ZSH_NAME" ]; then
SHELL=$(which zsh)
export SHELL
exec zsh
fi

# Step 7: Final message
echo "Installation complete! You can run 'p10k configure' to customize PowerLevel10k."
6 changes: 3 additions & 3 deletions .github/workflows/miles-systems-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ jobs:
chmod -R +x /var/aws-deployment/
chown -R apache:apache /var/www/
cat > /root/setup_apache_sites.sh <<'EOF'
cat > /home/apache/setup_apache_sites.sh <<'EOF'
#!/bin/bash
# Enable debugging and error handling
Expand Down Expand Up @@ -400,7 +400,7 @@ jobs:
EOF
chmod +x /root/setup_apache_sites.sh
chmod +x /home/apache/setup_apache_sites.sh
# Function to set up SSH keys for the apache user
setup_ssh_for_apache() {
Expand Down Expand Up @@ -472,7 +472,7 @@ jobs:
KillMode=process
User=apache
ExecStartPre=/bin/ls --color=always -lah /var/aws-deployment/
ExecStartPre=/root/setup_apache_sites.sh
ExecStartPre=/home/apache/setup_apache_sites.sh
ExecStartPre=/usr/bin/systemctl enable httpd
ExecStartPre=/usr/bin/systemctl start httpd
ExecStart=/var/aws-deployment/success.sh 0
Expand Down

0 comments on commit e0873b7

Please sign in to comment.