diff options
-rw-r--r-- | README.md | 4 | ||||
-rwxr-xr-x | pub.sh | 8 | ||||
-rwxr-xr-x | run.sh | 13 |
3 files changed, 19 insertions, 6 deletions
@@ -18,10 +18,10 @@ This project includes a build script that builds the website. ./build.sh ``` -It also includes a wrapper around the build script that automatically configures my Debian/Nginx server, builds the website and publishes it. +It also contains a wrapper around the build script that automatically publishes the website when the server is configured using `run.sh` (which yours probably isn't) ```sh -./run.sh +./pub.sh ``` Please note that you should place static content (such as images you link to) in `./dir/`. anything in `./dir/` will get copied without any modification to the `./web/` directory, which will be the root of your web page. @@ -0,0 +1,8 @@ +#!/bin/sh +source ./build.sh +echo "=== publishing website! ===" +rm -rf /srv/web/ +sudo mkdir -p /srv/web/ +sudo chown -R $(whoami):$(whoami) /srv/web/ +cp ./web/* /srv/web/ +sudo systemctl restart nginx @@ -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." |