diff --git a/docs/EVENTS-2.2-PLAN.md b/docs/EVENTS-2.2-PLAN.md index d54efcb..ccea050 100644 --- a/docs/EVENTS-2.2-PLAN.md +++ b/docs/EVENTS-2.2-PLAN.md @@ -181,6 +181,32 @@ Secrets stay in each product's own `.env`, never in `church.env`. | `adopt --undo` | Yes (decision 26): goes back to the old folder and the 2.1.x it ran, within the days the old folder is kept | | `add ` | **Later** (phase 3), when there's a second product to add | +**Built 2026-11-12** (branch `feat/crosscode-script`), as above, with these details settled while +writing it: + +- **Run as root.** `church.env` is root-only (mode 600), so every command needs root; each app's + commands (git, npm, Prisma, PM2) run as its app user through `sudo -u`. +- `church.env` is read as data, never sourced: only `CHURCH`, `PRODUCTS`, `ADDRESS` and + `_*` keys are taken. +- `--allow-local-changes` replaces `ALLOW_LOCAL_CHANGES=1` (the variable still works). `--check` + never passes with changes. +- "Latest" only counts plain `events@x.y.z` tags, so test tags such as `events@2.2.0-test` are + only ever deployed with `--version`. +- `--every-church` stops at the first church that fails (its products roll back as usual), and + names the churches it didn't reach. +- `install`: the app user defaults to `cc-`, PM2 names to `-events-backend` / + `-frontend`, the database to `_events`, and ports to the first free ones from 5000 + (API) and 3000 (web), counting every church's `church.env` and anything listening. +- `adopt` writes `church.env` only once the switch has worked, and refuses to start if nginx + refers to the old folder by path (it gets renamed). It also records `EVENTS_OLD_DIR`, + `EVENTS_OLD_REF` and `EVENTS_ADOPTED_AT` for `--undo` and `status`. +- `adopt --undo` refuses if the new checkout has migrations the old release doesn't have, and + moves `/var/www/sites/` aside to `.undone--