aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rwxr-xr-xbuild.sh10
-rwxr-xr-xserver.sh2
3 files changed, 12 insertions, 1 deletions
diff --git a/README.md b/README.md
index 133b748..f92752c 100644
--- a/README.md
+++ b/README.md
@@ -35,6 +35,5 @@ custom directories are not supported yet. you will have to manually edit the bui
- allow user to create directories
-- 404 page
- cgit: styling
- database, php, npm for clicker game
diff --git a/build.sh b/build.sh
index bdb1f40..2cb89be 100755
--- a/build.sh
+++ b/build.sh
@@ -282,6 +282,16 @@ EOF
done
cd ..
+echo "[build] creating 404 page..."
+tee ./tmp/temp-404-page.html > /dev/null << EOF
+ <h1>not found :(</h1>
+ <span>This page does not exist on this server. <a href="/">Return home</a>.</span>
+EOF
+cat ./con/header.html \
+ ./tmp/temp-404-page.html \
+ ./con/footer.html \
+ > ./web/404.html
+
echo "[build] copying static files..."
cp ./con/style.css ./web/style.css
cp ./con/icon.png ./web/icon.png
diff --git a/server.sh b/server.sh
index 2dc7788..d74395a 100755
--- a/server.sh
+++ b/server.sh
@@ -156,6 +156,8 @@ server {
}
root /srv/web;
+ error_page 404 /404.html
+ location = /404.html { internal; }
index index.html;
location / {
try_files \$uri \$uri/ =404;