diff --git a/.env.example b/.env.example index ac238f8..1e03505 100644 --- a/.env.example +++ b/.env.example @@ -35,10 +35,9 @@ # --- Postgres ---------------------------------------------------------------- # One instance, two databases: POSTGRES_DB for the Go backend and # POSTGRES_TRACKER_DB for the activity tracker (with its own role). The job -# tracker's database moved to stppriv's own Postgres. Gitea's database -# is in the Gitea LXC's own Postgres. Only POSTGRES_DB is auto-created on first init; the others must -# be created by hand on a fresh volume (the job-tracker and ccp READMEs have -# the commands). +# tracker and Gitea have their own Postgres on stppriv and stpgit. Only +# POSTGRES_DB is auto-created on first init; the tracker database must be +# created by hand on a fresh volume (the ccp README has the commands). # POSTGRES_HOST doubles as the db container's name. POSTGRES_USER= POSTGRES_PASSWORD= diff --git a/.gitignore b/.gitignore index 7520f2c..e667356 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ certbot/www # Caddy's certificates, keys and ACME account (docker-compose.yml) caddy/data/ backend/token/ -jobs-data/ usaco-data/ .env .env.bak diff --git a/CLAUDE.md b/CLAUDE.md index 325a59f..16fe64b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -61,7 +61,7 @@ Dockerized multi-service personal website self-hosted on `stpvm` (an x86-64 Ubun **Python API** (`python/`): FastAPI app served by uvicorn on port 8000. Caddy proxies `/py/` to it and strips the prefix, so routes in `python/app/main.py` are written relative to `/`. Swagger UI at `/py/docs`. Dev mode mounts `python/app` and runs uvicorn with `--reload`. **The site's Claude call lives here**, behind an internal route: `/internal/rowing/read` (behind `POST /api/rowing`). The Go backend calls it directly over the Docker network through `services.CallPython`, and Caddy 404s `/py/internal/`. The model is one setting, `CLAUDE_MODEL` (default `claude-sonnet-5-5`), set in `.env`; `python/app/claude.py` shapes the request per model. Adding another route is a short recipe in `python/README.md` ("Internal routes"). -**Job tracker and notes editor** (on stppriv): the job tracker (`adamf/job-tracker`) and the SilverBullet editor run on their own LXC, from the `adamf/stppriv` repo, at `priv.` behind Cloudflare Access. Caddy here 301s `/sb/`, `/jobs/` and the old `/cv/jobs`, `/cv/leads` and userscript URLs there. stppriv is the notes vault's only writer; `silverbullet-git` here runs with `SYNC_MODE=pull` and feeds `/notes/`. +**Job tracker and notes editor** (on stppriv): the job tracker (`adamf/job-tracker`) and the SilverBullet editor run on their own LXC, from the `adamf/stppriv` repo, at `priv.`. stppriv's Caddy gates them with this site's admin session (the cookie is set for the parent domain), asking `/api/auth/validate-admin` over the LAN; requests from `STPPRIV_LAN_IP` to that path skip the api rate limit. Caddy here 301s `/sb/`, `/jobs/` and the old `/cv/jobs`, `/cv/leads` and userscript URLs there. stppriv is the notes vault's only writer; `silverbullet-git` here runs with `SYNC_MODE=pull` and feeds `/notes/`. **Gitea** (own repo, `adamf/stpgit`): git, Actions and the image registry (`/adamf/...`) run in their own Proxmox LXC since 2026-11-24, from the `adamf/stpgit` repo (this repo's `gitea/` directory until then) with their own Postgres (`gitea-db`) and `.env`, deployed by hand there and never by CI. Everything on stpvm reaches it as `GITEA_HOST` (`git.`, :3000 HTTP and :2222 SSH), pinned to the LXC's LAN IP (`GITEA_UPSTREAM`) by `extra_hosts` in containers and `/etc/hosts` on the host; public DNS for that name is Cloudflare, which carries only HTTPS. There is no Gitea container or forwarder in this stack since 2026-11-24. The act_runner stays on stpvm. Runbook: that repo's README, summarised in "Gitea LXC" in `DEPLOYMENT.md` ยง7. diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 4816512..b381153 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -135,7 +135,8 @@ The config is `caddy/Caddyfile` (global options and snippets), `caddy/routes.cad activity tracker also checks the session itself. Its carve-outs, which a session cookie never reaches, stay public at the edge and are guarded by bearer tokens in the app: `/tracker/api/v1/` and `/tracker/tracker.user.js`. `/sb/` and `/jobs/` 301 to stppriv - (`priv.`, behind Cloudflare Access; see the `adamf/stppriv` README). + (`priv.`). Its Caddy gates them with this same admin session, asking + `/api/auth/validate-admin` over the LAN; see the `adamf/stppriv` README. Paths are matched cleaned and case-insensitively, so `/TRACKER/` or `/uploads/x/../private/y` land on the gate too. With the backend down every gated path answers 502: it fails closed. - **Permission gate.** `/receipt/` asks `/auth/validate/receipt` instead (the