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):