Move the notes editor and job tracker to stppriv
The SilverBullet editor and the job tracker now run on their own LXC (adamf/stppriv) at priv.<DOMAIN>, behind Cloudflare Access. Here: - silverbullet and jobs services removed; /sb/, /jobs/ and the old /cv/jobs, /cv/leads and userscript URLs 301 to priv.<DOMAIN> - silverbullet-git runs with SYNC_MODE=pull: stppriv is the vault's only writer. The backend's vault mount is read-only. - jobs env vars, dev overrides and docs removed; edge_test.sh checks the new redirects Merge only after stppriv serves /sb/ and /jobs/ and the jobs data has been moved. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+12
-17
@@ -34,8 +34,8 @@ dials out and publishes no port; see "Cloudflare Tunnel" in §3.
|
||||
--------------------------------------------- (same container
|
||||
| | | | | | as icecast2)
|
||||
v v v v v v |
|
||||
/api/ /radio/ /v2/ /sb/ /notes/ /py/ |
|
||||
backend icecast2 gitea sb sb-pub python |
|
||||
/api/ /radio/ /v2/ /notes/ /py/ |
|
||||
backend icecast2 gitea sb-pub python |
|
||||
| ^ |
|
||||
| | |
|
||||
| +-------------------------------------------------------+
|
||||
@@ -89,11 +89,9 @@ Deploys of this stack never touch Gitea.
|
||||
| caddy (the edge) | `caddy` | 80, 443 (fixed IP `172.28.255.251`) | everything below | **80, 443** |
|
||||
| backend (Go) | `${BACKEND_HOST}` | `${BACKEND_PORT}` (8080) | `${BACKEND_ENDPOINT}` = `/api/` | no |
|
||||
| db (Postgres 16) | `${POSTGRES_HOST}` | 5432 | none | no |
|
||||
| silverbullet (editor) | `${SILVERBULLET_HOST}` | `${SILVERBULLET_PORT}` | `/sb/` (admin-gated) | no |
|
||||
| silverbullet-public (notes site) | `${SILVERBULLET_PUBLIC_HOST}` | `${SILVERBULLET_PUBLIC_PORT}` | `/notes/` (**public**, read-only) | no |
|
||||
| silverbullet-git | n/a | n/a | none (timer loop) | no |
|
||||
| python (FastAPI) | `${PYTHON_HOST}` | `${PYTHON_PORT}` | `/py/`, docs at `/py/docs` | no |
|
||||
| jobs (job tracker, published image) | `jobs` | 8080 | `/jobs/` (admin-gated by Caddy `forward_auth`; capture API and userscript public, bearer-token) | no |
|
||||
| activity-tracker (published image, adamf/ccp) | `activity-tracker` | 8080 | `/tracker/`, prefix stripped (pages admin-gated by Caddy `forward_auth`; `/api/v1/` bearer/app-checked) | no |
|
||||
| icecast2 + liquidsoap | `${ICECAST_HOST}` | `${ICECAST_PORT}` | `/radio/` | **harbor port only** |
|
||||
| vue | `vue` | 5173 (dev only) | `/` (dev only) | no |
|
||||
@@ -131,13 +129,14 @@ The config is `caddy/Caddyfile` (global options and snippets), `caddy/routes.cad
|
||||
it, so stripping the prefix serves a blank page with nothing in the log).
|
||||
- **Upstreams resolve when dialled.** Caddy starts with any upstream container
|
||||
missing and answers 502 until it appears; it never refuses to start over one.
|
||||
- **Admin gate.** `/sb/`, `/jobs/`, `/tracker/`, `/dozzle/`, `/garage/`, `/radio/admin/` and `/uploads/private/` are
|
||||
- **Admin gate.** `/tracker/`, `/dozzle/`, `/garage/`, `/radio/admin/` and `/uploads/private/` are
|
||||
protected by `forward_auth` to the backend's `/auth/validate-admin` (the
|
||||
`admin_gate` snippet); a 401/403 redirects to the SPA login. Most of these services have no auth of their own at that path; the
|
||||
job and activity trackers also check the session themselves. Their carve-outs, which a session
|
||||
cookie never reaches, stay public at the edge and are guarded by bearer tokens in the apps:
|
||||
`/jobs/api/capture` and `/jobs/job-capture.user.js`, `/tracker/api/v1/` and `/tracker/tracker.user.js`.
|
||||
Paths are matched cleaned and case-insensitively, so `/SB/` or `/uploads/x/../private/y`
|
||||
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.<DOMAIN>`, behind Cloudflare Access; 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
|
||||
`permission_gate` snippet), which also lets in a
|
||||
@@ -239,7 +238,6 @@ The override layer changes these services and disables `cloudflared`:
|
||||
- **backend** — `DEV_MODE`, GraphQL playground and introspection on, a localhost
|
||||
Spotify redirect URI, and **`SEED_DB=true`**.
|
||||
- **python** — `uvicorn --reload` with `python/app` bind-mounted.
|
||||
- **jobs** — seeded, with the GraphQL playground on.
|
||||
- **cloudflared** — put in the `disabled` profile, so it never starts: a dev
|
||||
stack must never join the production tunnel.
|
||||
|
||||
@@ -421,10 +419,9 @@ of deleting the directory:
|
||||
| `./caddy/data` | Caddy's TLS certificates, **private keys** and ACME account | Gitignored. Never commit. Losing it means a re-issue on the next start (§3). |
|
||||
| `./certbot/conf` | The old certbot certificate and keys | Unused since 2026-11-17; kept as the rollback until it is cleaned up (§7). |
|
||||
| `./backend/token/` | **Spotify OAuth refresh token** (`spotify_token.json`) | Gitignored. Without this mount, Spotify would need re-authorising after every rebuild. |
|
||||
| `./jobs-data` | The job tracker's **capture token hash** and Graph OAuth session | Gitignored. Must be owned by uid 1000, the user the `jobs` image runs as. |
|
||||
| `./logs` | Backend logs (`go.log`); Caddy's JSON request-body log in `logs/caddy/payloads.log` | Caddy rotates the payload log itself (50 MiB, five kept). `logs/nginx/` is nginx's, finished. |
|
||||
| `./icecast2/fallback_music` | Radio fallback MP3s | Copied to the host by hand, not git |
|
||||
| `${OBSIDIAN_DIR}` | The Obsidian vault (a git clone of the notes repo) | Read-write to backend and silverbullet, **read-only** to silverbullet-public |
|
||||
| `${OBSIDIAN_DIR}` | The Obsidian vault (a git clone of the notes repo) | A pull-only clone (`silverbullet-git`); **read-only** to backend and silverbullet-public |
|
||||
|
||||
Gitea's state (`data/`, `config/` and the `gitea_gitea_db` volume, in the
|
||||
`adamf/stpgit` checkout) is on the Gitea LXC, not here; see "Gitea LXC" in §7. The pre-move copy is in
|
||||
@@ -452,13 +449,11 @@ Gitea's own variables are in the `.env` of its checkout on the Gitea LXC (the
|
||||
`adamf/stpgit` repo's `.env.example`);
|
||||
there it receives explicit `GITEA__section__KEY` variables (Gitea's own
|
||||
convention for overriding `app.ini` keys). Here, `python` receives an explicit
|
||||
allow-list (as do `jobs`, `caddy` and the rest), so it never sees the database password or any API key other than
|
||||
allow-list (as do `caddy` and the rest), so it never sees the database password or any API key other than
|
||||
the two it uses (`TFL_APP_KEY`, and `CLAUDE_API_KEY`, plus `CLAUDE_MODEL`,
|
||||
which picks the model). The Python service
|
||||
makes the site's one Claude call (the rowing photo reader); the `jobs` container
|
||||
(the job tracker, built from its own repo) makes its own, and gets a similar
|
||||
allow-list with its own database role. The backend receives `CLAUDE_API_KEY`
|
||||
through `env_file` but does not use it. A new variable for either service has
|
||||
makes the site's one Claude call (the rowing photo reader). The backend receives `CLAUDE_API_KEY`
|
||||
through `env_file` but does not use it. A new variable for it has
|
||||
to be added to its allow-list as well as
|
||||
`.env.example`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user