furtka/ops/nginx/setup-vm.sh
Daniel Maksymilian Syrnicki 2fbafd5c77
Some checks failed
CI / test (push) Waiting to run
Build ISO / build-iso (push) Successful in 18m1s
CI / lint (push) Successful in 24s
CI / markdown-links (push) Successful in 18s
CI / validate-json (push) Successful in 21s
Deploy site / deploy (push) Has been cancelled
feat(website): logo poll at /logo/ with cookie-free vote counter
Two marks (M and R) side by side, EN + DE, with the site-header and real
16 px favicon context for each. Votes go to ops/poll/pollsvc.py, a stdlib
Python service behind nginx at /api/poll/ (SQLite, systemd DynamicUser,
rate-limited). Devices are counted once via a salted hash of IP + user
agent; the privacy pages document it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MScAinbyMdeNc7H2BZdnnG
2026-08-26 12:57:23 +02:00

28 lines
838 B
Bash
Executable file

#!/usr/bin/env bash
# One-time setup on forge-runner-01 for furtka.org.
# Idempotent — safe to re-run.
#
# Usage (on the VM, with sudo):
# sudo ops/nginx/setup-vm.sh
set -euo pipefail
OWNER="${SUDO_USER:-daniel}"
WEBROOT="/var/www/furtka.org"
SRCROOT="/srv/furtka-site"
SITE_CONF="/etc/nginx/sites-available/furtka.org"
SITE_LINK="/etc/nginx/sites-enabled/furtka.org"
install -d -o "$OWNER" -g "$OWNER" -m 0755 "$WEBROOT"
install -d -o "$OWNER" -g "$OWNER" -m 0755 "$SRCROOT"
cp "$(dirname "$0")/furtka.org.conf" "$SITE_CONF"
cp "$(dirname "$0")/poll-ratelimit.conf" /etc/nginx/conf.d/poll-ratelimit.conf
ln -sfn "$SITE_CONF" "$SITE_LINK"
# Drop the Ubuntu default site so it doesn't shadow us on :80.
rm -f /etc/nginx/sites-enabled/default
nginx -t
systemctl reload nginx
echo "OK: furtka.org ready at $WEBROOT (owner $OWNER)"