Ship pvlb.dev with the flango container/deploy pipeline #17

Closed
opened 2026-11-15 19:41:41 +00:00 by dsh · 1 comment
Member

web/flango now carries the reference pipeline (4ef7abe, CI run #1168 green): container image, /healthz, pinned-tag deploy/ with rollback, and ci.yml + publish.yml + deploy.yml. The first real production consumer should be this repo, because this is what serves pvlb.dev (the ops/srv Caddyfile still calls the apex a holding page "until web-frontend ships").

Agent work

  • port deploy/{compose.yaml,deploy.sh,receive.sh,.env.example} and .forgejo/workflows/deploy.yml from web/flango@master, swapping the image to git.pvlb.dev/web/web-frontend and the service dir to /srv/dockersvc/web-frontend
  • make publish.yml's missing-secret gate shell-side (env + [ -z ]), not secrets.* in if:; confirm the first tag run actually creates the package (none exists today)
  • update this repo's AGENTS.md/README for the deploy path and :latest-is-never-deployed rule

Operator work

  • repository secrets: REGISTRY_USER/REGISTRY_TOKEN (write:package) and DEPLOY_SSH_KEY/DEPLOY_KNOWN_HOSTS/DEPLOY_HOST/DEPLOY_USER/DEPLOY_PORT
  • on srv: create /srv/dockersvc/web-frontend/, .env (0600), docker login git.pvlb.dev as dockersvc with a read:package token, install receive.sh as /usr/local/bin/flango-deploy and the restrict,command=... authorized_keys line
  • backups: add the service to /usr/local/sbin/pvlb-backup.sh (stop, tar .env + the volume _data, start) and verify restic ls latest | grep web-frontend before go-live
  • Caddy: replace the apex static block with reverse_proxy 127.0.0.1:8000, keep bind 104.152.49.193 and the /.well-known/matrix/* handler; deploy the edge and verify /.well-known/matrix/client still reaches 8008
  • add 8000/tcp loopback to ops/srv devops/portmap.md

Go-live

  • tag v<pyproject version>, let publish.yml push the image, dispatch deploy.yml with the version
  • verify https://pvlb.dev/healthz 200, the site, login/admin over HTTPS (Secure/HttpOnly cookies, TRUST_PROXY=1), and Matrix discovery
  • exercise one rollback (a deliberately bad tag or deploy.sh <previous>)

Acceptance: pvlb.dev serves from the pinned image; a failed deploy rolls back; the SQLite volume is in the nightly backup; Matrix discovery is unchanged. Detail: web/flango deploy/README.md and AGENTS.d/deployment.md (private). Migrations are forward-only, so a code rollback across a schema change needs a volume restore.

`web/flango` now carries the reference pipeline (`4ef7abe`, CI run #1168 green): container image, `/healthz`, pinned-tag `deploy/` with rollback, and `ci.yml` + `publish.yml` + `deploy.yml`. The first real production consumer should be this repo, because this is what serves `pvlb.dev` (the `ops/srv` Caddyfile still calls the apex a holding page "until web-frontend ships"). **Agent work** - [ ] port `deploy/{compose.yaml,deploy.sh,receive.sh,.env.example}` and `.forgejo/workflows/deploy.yml` from `web/flango@master`, swapping the image to `git.pvlb.dev/web/web-frontend` and the service dir to `/srv/dockersvc/web-frontend` - [ ] make `publish.yml`'s missing-secret gate shell-side (`env` + `[ -z ]`), not `secrets.*` in `if:`; confirm the first tag run actually creates the package (none exists today) - [ ] update this repo's `AGENTS.md`/README for the deploy path and `:latest`-is-never-deployed rule **Operator work** - [ ] repository secrets: `REGISTRY_USER`/`REGISTRY_TOKEN` (write:package) and `DEPLOY_SSH_KEY`/`DEPLOY_KNOWN_HOSTS`/`DEPLOY_HOST`/`DEPLOY_USER`/`DEPLOY_PORT` - [ ] on srv: create `/srv/dockersvc/web-frontend/`, `.env` (0600), `docker login git.pvlb.dev` as `dockersvc` with a read:package token, install `receive.sh` as `/usr/local/bin/flango-deploy` and the `restrict,command=...` `authorized_keys` line - [ ] backups: add the service to `/usr/local/sbin/pvlb-backup.sh` (stop, tar `.env` + the volume `_data`, start) and verify `restic ls latest | grep web-frontend` before go-live - [ ] Caddy: replace the apex static block with `reverse_proxy 127.0.0.1:8000`, keep `bind 104.152.49.193` and the `/.well-known/matrix/*` handler; deploy the edge and verify `/.well-known/matrix/client` still reaches 8008 - [ ] add `8000/tcp` loopback to `ops/srv` `devops/portmap.md` **Go-live** - [ ] tag `v<pyproject version>`, let `publish.yml` push the image, dispatch `deploy.yml` with the version - [ ] verify `https://pvlb.dev/healthz` 200, the site, login/admin over HTTPS (Secure/HttpOnly cookies, `TRUST_PROXY=1`), and Matrix discovery - [ ] exercise one rollback (a deliberately bad tag or `deploy.sh <previous>`) **Acceptance:** pvlb.dev serves from the pinned image; a failed deploy rolls back; the SQLite volume is in the nightly backup; Matrix discovery is unchanged. Detail: `web/flango` `deploy/README.md` and `AGENTS.d/deployment.md` (private). Migrations are forward-only, so a code rollback across a schema change needs a volume restore.
Author
Member

Closing as duplicate: this is #8 (provisioning + go-live) plus #16 (release page). I moved the reference pipeline details and the two extra setup items (backup entry, port map) into #8. The worked implementation lives in web/flango@4ef7abe (deploy/ + .forgejo/workflows/).

Closing as duplicate: this is #8 (provisioning + go-live) plus #16 (release page). I moved the reference pipeline details and the two extra setup items (backup entry, port map) into #8. The worked implementation lives in `web/flango@4ef7abe` (`deploy/` + `.forgejo/workflows/`).
dsh closed this issue 2026-11-15 19:42:34 +00:00
Sign in to join this conversation.
No description provided.