Accounts: deploy hooks, env template, export, docs

scripts/products/accounts.sh (backup with pg_dump, build with the shared
packages, PM2, export, keep, failed-migration recovery); accounts in
SUPPORTED_PRODUCTS so deploy updates it where a church has it. Env
template in both places, PM2 example, export script, /api/health
version from package.json. README, CHANGELOG, WHATS-NEW; the plan's
changes while building and what's still to do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 14:18:40 +02:00
co-authored by Claude Opus 5.5
parent a3e3921b4f
commit 7f34e184e1
17 changed files with 374 additions and 12 deletions
+27 -3
View File
@@ -1,7 +1,10 @@
# Accounts 1.0.0 — one sign-in for every product of a church
Phase **3** of [ROADMAP-v3.md](./ROADMAP-v3.md) (§3, §8, §9; decisions 2, 14, 15, 17). Written
2026-11-18. **Decisions confirmed 2026-11-18** (all as proposed); building.
2026-11-18. **Decisions confirmed 2026-11-18** (all as proposed). **Partly built 2026-11-18** on
`feat/accounts-1.0` (not merged): the app, contracts 1.5.0, `packages/auth-client`, `packages/ui` and
the deploy hooks. Not yet: Hub 2.3.0, `crosscode install`/`add` for Accounts, the Playwright run and
the VM test. See [Changes while building](#changes-while-building).
**What Accounts is:** a small OpenID Connect provider per church, at `accounts.<church's address>`.
People sign in there once and are signed in to all of the church's products. Members never see it
@@ -43,8 +46,9 @@ notice versions) is supported from the start.
11. [What changes in each repo](#11-what-changes-in-each-repo)
12. [Testing](#12-testing)
13. [Releasing and rolling it out](#13-releasing-and-rolling-it-out)
14. [Decisions](#decisions)
15. [Still open](#still-open)
14. [Changes while building](#changes-while-building)
15. [Decisions](#decisions)
16. [Still open](#still-open)
---
@@ -297,6 +301,26 @@ phone-first.
4. **Churches get Accounts with the Website** (phase 4) or with Events 3.0, whichever comes first
for them (decision 6). Until then nothing uses it, so it isn't installed for its own sake.
## Changes while building
1. **"Download my data" is one JSON file**, not a ZIP: every product's part as
`crosscode.identity/1` export sections, plus the products that didn't answer in 24 hours.
2. **The Accounts session is oidc-provider's own**, and the account page signs in like a product
(`accounts-self`, `/api/self/signin`), so there's one session to end everywhere.
3. **`church.changed`** is a hint at its own path (`/api/church/v1/changed`, contracts 1.5.0,
like `event.changed`), not a new `crosscode.identity/1` call type (that would need `/2`).
contracts 1.5.0 also exports `churchObjectSchema` (the profile without its cross-field checks).
4. **A product that's disconnected after a deletion was approved** doesn't hold it up.
5. **Tests run the whole app on a real port** with an in-memory database and messenger and a test
product on openid-client (`backend/tests/`, 37 tests): every sign-in path in §5, PKCE and
redirect refusals, 2FA set-up and recovery codes, back-channel logout, signed calls, deferred
deletion, export, Connect, admin rules. oidc-provider refuses private addresses for back-channel
logout; `LINKS_ALLOW_PRIVATE` (testing only) lets it reach 127.0.0.1.
6. **Accounts' part of a church export** is `accounts.json` (the church profile and people, no
secrets) next to the other products' files.
7. **`/api/health` reads the version from package.json** (PM2 doesn't set npm's variables), so
`crosscode deploy` can check it.
## Decisions
Confirmed by Joshua on 2026-11-18 (1, 4, 5 and 6 asked directly; the rest as proposed):
+1 -1
View File
@@ -29,7 +29,7 @@ for each phase and the rollout checklist ([ROLLOUT-1.0.md](./ROLLOUT-1.0.md)).
| 1c | Cross Events 2.3.x: authenticator app 2FA (TOTP + recovery codes) | **Released** 2026-11-17 (`events@2.3.0`). **`events@2.3.1`** 2026-11-18: Next.js 16.4.6 (security advisories for 16.2.0–16.4.4), so roll out 2.3.1, not 2.3.0. crosscode-site `v1.3.0` lists it (merged and tagged, **not deployed**) |
| 1d | Agent 1.0.x + Hub 2.1.x (+ contracts 1.3.0) | **Released** 2026-11-17 (`agent@1.0.0`, `contracts@1.3.0`, Hub `v2.1.0`). **VM tested** end to end (AGENT-1.0-PLAN §13: joins, installs behind frp, scheduled / batch / missed updates, uninstall with export and purge, forged and replayed jobs). 2026-11-18: **`agent@1.0.1`** (the agent answers status on the central server itself) and Hub **`v2.1.1`** (adopt passes the church's address; Link takes the short name as a name). **Not rolled out**: use agent 1.0.1 and Hub 2.1.1 |
| 2 | Cross Events 2.4.0: protocol v2, Linked products, event feed, `packages/seo` (+ contracts 1.4.0, Hub 2.2.0) | **Built** 2026-11-18 ([EVENTS-2.4-PLAN.md](./EVENTS-2.4-PLAN.md), decisions taken as proposed, "Changes while building" there): `feat/events-2.4` here, `feat/link-public-key` in events-hub, `feat/linked-products` in crosscode-site. Unit tests pass. **Not tagged:** the e2e spec and the VM test haven't run (no Postgres on the dev machine) |
| 3 | Accounts 1.0.0 (+ contracts 1.5.0, Hub 2.3.0) | **Planned** 2026-11-18: [ACCOUNTS-1.0-PLAN.md](./ACCOUNTS-1.0-PLAN.md), eight decisions to confirm before building |
| 3 | Accounts 1.0.0 (+ contracts 1.5.0, Hub 2.3.0) | **Partly built** 2026-11-18 on `feat/accounts-1.0` ([ACCOUNTS-1.0-PLAN.md](./ACCOUNTS-1.0-PLAN.md), decisions confirmed): the app (backend, pages, 37 tests), contracts 1.5.0, `packages/auth-client`, `packages/ui`, deploy hooks. **Still to do:** Hub 2.3.0 (Accounts licence with the first product, New install with Accounts), `crosscode install`/`add` for Accounts, a Playwright run of the pages, the VM test, crosscode-site |
| 4–7 | Website 1.0.0 → Events 3.0.0 → App 1.0.0 → App 1.x | Not started |
## Next up