diff --git a/server/deploy-site.sh b/server/deploy-site.sh new file mode 100644 index 0000000..aff4f61 --- /dev/null +++ b/server/deploy-site.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# Publishes the nkbmusic.com website staged in ~dev/nk-site to the Hestia web root. +# Run as dev: sudo sh ~/APPS/nanga_kathai/server/deploy-site.sh +set -e +SRC=/home/dev/nk-site +DEST=/home/user/web/nkbmusic.com/public_html + +[ -f "$SRC/index.html" ] && [ -f "$SRC/config.js" ] || { echo "Nothing staged in $SRC"; exit 1; } +mkdir -p /home/dev/nk-site-backups +tar -czf "/home/dev/nk-site-backups/public_html-$(date +%Y%m%d-%H%M%S).tgz" -C "$DEST" . +rm -rf "${DEST:?}"/* +cp -a "$SRC"/. "$DEST"/ +chown -R user:user "$DEST" +find "$DEST" -type d -exec chmod 755 {} + +find "$DEST" -type f -exec chmod 644 {} + +echo "Published to $DEST" diff --git a/site/.htaccess b/site/.htaccess new file mode 100644 index 0000000..1d1bc38 --- /dev/null +++ b/site/.htaccess @@ -0,0 +1,13 @@ +# nkbmusic.com on Hestia (Apache behind nginx). Serves /privacy, /terms and /delete-account +# from the matching .html files. +Options -MultiViews +RewriteEngine On +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME}.html -f +RewriteRule ^([a-z-]+)/?$ $1.html [L] + + + + Header set Cache-Control "public, max-age=86400" + +