Phase 10, part 9: the server package

compose.server.yaml runs Supermarket behind Caddy (HTTPS from Let's
Encrypt, Caddy's own CA or the team's), with Postgres on an internal
network and a nightly pg_dump kept two weeks. install-server.sh asks for
the domain, certificate and mail server, makes the secret key and database
password, starts it all and prints the setup link. Settings → Backups lists
the dumps on a server, and how the operator restores one. Checked end to
end in Docker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 09:37:34 -07:00
co-authored by Claude Opus 5.5
parent c8964cec12
commit da16736fb4
15 changed files with 532 additions and 17 deletions
+36 -5
View File
@@ -43,12 +43,17 @@ fixed. Since then:
- Listmonk mailing lists, with their opt-outs synced to suppression.
- Phase 9: the groundwork for the server and multi-tenant editions.
The local edition runs as before, its database at schema 31. The server
and multi-tenant editions check their settings, but won't start until
Phase 10 brings sign-in.
The local edition runs as before, its database at schema 36 once Phase 10
is merged. The server edition runs; multi-tenant checks its settings but
won't start until Phase 13.
**Next: Phase 10, users, sign-in and roles (the server edition).** No
decisions are open for it; Phase 12 still needs who adds Supermarket's
**Phase 10 (users, sign-in and roles; the server edition) is built** on
branch `phase10` (2026-11-25), not yet merged: schema 36, a new
`compose.server.yaml` and `install-server.sh`. On the local edition,
the visible changes are posting accounts, Connections, Activity, and a
CSRF token in every form.
**Next: Phase 11, agents.** Phase 12 still needs who adds Supermarket's
client to Authelia.
**Coming back to it (for the agent working on it):**
@@ -2369,6 +2374,32 @@ starts** (multi-tenant still doesn't).
- *By Jane*: on drafts in Posts (who wrote it), published posts (who
posted it, and as which account) and outreach emails (who drafted it).
**Part 9 built 2026-11-25** on `phase10`. **Phase 10 is built.**
- `compose.server.yaml`: Supermarket (as uid 10001, read-only, no
capabilities, published only to Caddy), Postgres 18 on an internal
network with no way out, a `backup` service (`server/backup.sh`:
`pg_dump` custom format at 03:00, 14 days kept, the first at once) and
Caddy (`server/Caddyfile`, HSTS, ports 80 and 443, configurable).
`SUPERMARKET_TLS` picks the certificate: Let's Encrypt (empty), Caddy's
own CA (`tls internal`) or the team's (`tls /certs/…`, in `server/certs/`).
- `install-server.sh` asks for the domain, the certificate, the mail server
and the sender, makes the database password and secret key, writes
`server.env` (0600, git-ignored), builds and starts everything, and
prints the setup link. Run again after `git pull` to update.
- On the server edition, the local-only parts don't run: the MCP socket and
the CRM state file for Hermes (agents come with Phase 11).
- Settings → Backups on Postgres lists the dumps (`SUPERMARKET_PG_BACKUPS`,
the backup volume mounted read-only), warns when the last is over 36
hours old, and gives the operator's `pg_restore` commands; nothing is
restored from the browser.
- README has *The server edition*; TEST.md section 14 has its checks.
- Checked end to end in Docker (2026-11-25), on ports 18080/18443 with
`tls internal`: all four services up, the setup link printed, the owner
created over HTTPS with `__Host-` cookies, an SEO member invited (the
email fails without a mail server, and says so in the log), cross-site
and token-less posts refused, Activity showing the steps, HSTS and
`X-Frame-Options` set, the first dump on the Backups page.
1. **Users and sessions.**
- Tables:
- `users`: email, name, kind (person or agent), status (invited,