aboutsummaryrefslogtreecommitdiff
path: root/run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'run.sh')
-rwxr-xr-xrun.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/run.sh b/run.sh
index de92498..2e7ba85 100755
--- a/run.sh
+++ b/run.sh
@@ -5,6 +5,7 @@ echo "# WEBSERVER RUNNER #"
echo "# »» hitler.rip «« #"
echo "####################"
echo
+echo "[run] This script sets up my web servers the way I like it."
echo "[run] Note:"
echo "[run] this script assumes you already have an openssh server set up properly."
echo
@@ -169,7 +170,9 @@ server {
}
EOF
sudo mkdir -p /srv/web/
-sudo chown -R $(whoami) /srv/web/
+sudo mkdir -p /srv/build/
+sudo chown -R $(whoami):$(whoami) /srv/web/
+sudo chown -R $(whoami):$(whoami) /srv/build/
sudo systemctl restart nginx
sudo systemctl enable nginx
@@ -177,10 +180,12 @@ echo "[run] setting up git server..."
sudo adduser --shell $(which git-shell) git
sudo mkdir /home/git/.ssh/
sudo cp ~/.ssh/authorized_keys /home/git/.ssh/
-sudo chown -R git /home/git/.ssh/
+sudo chown -R git:git /home/git/.ssh/
sudo chmod 700 /home/git/.ssh/
sudo chmod 600 /home/git/.ssh/authorized_keys
sudo mkdir -p /srv/git/
-sudo chown -R git /srv/git/
+sudo chown -R git:git /srv/git/
sudo mkdir -p /srv/pgit/
-sudo chown -R git /srv/pgit/
+sudo chown -R git:git /srv/pgit/
+git config --global --add safe.directory '*' # to allow the server to clone its own repos
+echo "[run] git server created. you may now clone the website build script to /srv/build/ and push your website."