deploy: add bootstrap.sh + Caddyfile + systemd unit + demo pool

One-shot deploy for fresh Ubuntu 24.04 root SSH:
  curl -fsSL https://gitea.ahkhan.me/apps/quiz/raw/branch/master/deploy/bootstrap.sh | bash

bootstrap.sh: idempotent stage-by-stage installer for Caddy, Python venv,
quiz system user, repo clone to /opt/quiz, env-var prompts, systemd unit,
Caddyfile, and a healthz check. Reattaches /dev/tty so curl|bash can read
the admin password interactively.

quiz.service: uvicorn under the quiz system user (no shell, no SSH),
ProtectSystem=full, ProtectHome=true, PrivateTmp=true, NoNewPrivileges=true.

Caddyfile.tpl: reverse_proxy 127.0.0.1:8001 with auto Let's Encrypt;
DOMAIN substituted at install time.

examples/pool_example.json: generic demo pool, schema reference only.

README rewritten around the deploy flow + class-day lifecycle.
This commit is contained in:
ameer
2026-05-02 20:13:40 +08:00
parent 0480d1528c
commit 7001a51803
5 changed files with 228 additions and 26 deletions

4
deploy/Caddyfile.tpl Normal file
View File

@@ -0,0 +1,4 @@
__DOMAIN__ {
encode gzip
reverse_proxy 127.0.0.1:8001
}