diff --git a/docs/AGENT-1.0-PLAN.md b/docs/AGENT-1.0-PLAN.md index 830d9a7..49c8c35 100644 --- a/docs/AGENT-1.0-PLAN.md +++ b/docs/AGENT-1.0-PLAN.md @@ -382,16 +382,24 @@ All in the Hub (Jobs page, with the full report) and by email: ``` Set up in FastPanel: events.hope.co.za (Hope Family Church, Cross Events) -1. Add the site events.hope.co.za. -2. Proxy: - /api → http://127.0.0.1:20011 (backend; Events 2.2.0+, older - releases also need /uploads, /health, /docs) - everything else → http://127.0.0.1:20010 (frontend) - Pass the Host header and X-Forwarded-For / X-Forwarded-Proto: https. - Allow uploads up to 25 MB. +1. Add the site events.hope.co.za as a proxy to http://127.0.0.1:20010 (the frontend). Pass the + Host header and X-Forwarded-For / X-Forwarded-Proto: https, and allow uploads up to 25 MB. +2. Send /api to the backend: add this to the site's nginx configuration. Keep the ^~: without + it FastPanel's static-file rule sends every /api path with a file extension to the frontend. + + location ^~ /api/ { + proxy_pass http://127.0.0.1:20011; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto https; + } + location = /api { proxy_pass http://127.0.0.1:20011; } + 3. Turn on Let's Encrypt for the site. -4. DNS: events.hope.co.za → (checked: ✅ points there / ⚠ not yet) -5. Then click "Proxy done" in the Hub: +4. DNS: events.hope.co.za → (checked: points there / not yet) +5. Click "Proxy done" in the Hub. It checks the site, its /api and a file under /api, then + makes it live: Central check: both ports are open in frps and only on 127.0.0.1. ``` diff --git a/docs/HANDOVER.md b/docs/HANDOVER.md index 7918073..6f0236b 100644 --- a/docs/HANDOVER.md +++ b/docs/HANDOVER.md @@ -46,6 +46,7 @@ and What's New, and [VERSIONS.md](./VERSIONS.md). | `events@3.4.0`, `accounts@1.4.0`, `contracts@1.12.0`, `agent@1.3.0`, Hub `v2.8.0` | Background jobs switched on/off and rescheduled from each site's admin (saved in `job_overrides`, wins over the .env, applies at once; Accounts gets an Admin → Background jobs page). Accounts' emails styled as Events' (`src/lib/emails.ts`). The Hub reads and changes an install's .env (`env-read` / `env-set` jobs → `crosscode env`; secrets never leave the server; the file is put back if the site doesn't start; the frontend's file triggers a rebuild) | | `events@3.5.0`, `contracts@1.13.0`, `agent@1.3.1`, Hub `v2.9.0` | **Fix:** "Load demo data" deleted the Accounts link (`set-demo.js` truncated `ProductLink`), so events-demo couldn't sign anyone in (`ACCOUNTS_UNAVAILABLE`). Demo data keeps the link; a site in Accounts mode without a link reconnects at its next heartbeat. Heartbeat `stats.signIn`; Hub alerts: not linked (critical), wrong Accounts, sign-in failing, an Accounts nothing links to. **Agent 1.3.0 reported itself as 1.2.0**: use 1.3.1 | | `accounts@1.6.0` | A "New sign-in" email (and WhatsApp) after every sign-in; Sign-in settings → `signin_notices` turns it off | +| Hub `v2.10.0` | Every Hub email laid out as Events' and Accounts' (`src/utils/emailLayout.js`: header with the logo, button, notes, job steps, code blocks; plain text kept). The FastPanel email gives `location ^~ /api/` as config to paste; Proxy done checks a file under `/api` reaches the backend. Billing emails unchanged | | `events@3.6.1` | **Fix:** logo/favicon uploads failed on events-demo ("uploaded, but the site can't show it yet"). FastPanel's static-file rule sent every `/api/…` path with a file extension (`.png`, `.pdf`, …) to the frontend. The site now passes `/api/*` and `/uploads/*` on to the backend (`BACKEND_INTERNAL_URL`); the installers' nginx uses `location ^~`. Change each FastPanel site too (below) | | `events@3.6.0`, `accounts@1.5.0`, `contracts@1.14.0` | The nightly people check (`accounts-people-check`, 04:30): `people.check` 500 subs at a time; fixes out-of-date copies, handles deleted accounts as `user.deleted`, stops (changing nothing) when most people are unknown. Skipped with an Accounts before 1.5.0 | @@ -73,9 +74,11 @@ location ^~ /api/ { location = /api { proxy_pass http://127.0.0.1:; } ``` -The Hub's FastPanel email (AGENT-1.0-PLAN §11) still says just "/api → backend": it should say -`location ^~ /api/`. Check after a change: -`curl -sI https:///api/health.png` must say `X-Powered-By: Express` (a 404 is fine). +Since **Hub 2.10.0** the FastPanel email (AGENT-1.0-PLAN §11) gives this block to paste, and +**Proxy done** refuses a site whose `/api/proxy-check.png` reaches the frontend. Sites set up +before that need the change by hand, and so does the Hub's own site (`events-hub`, +`/api/…/statement.pdf`; its deployment.md §8). Check after a change: +`curl -sI https:///api/health.png` must not say `X-Powered-By: Next.js` (a 404 is fine). ## Next up @@ -89,7 +92,7 @@ straight to the latest releases rather than each one in turn. frontend value with rebuild; a value that stops the site, so it's put back), the job switches, a demo load (the Accounts link stays) and the people check. Also the Events e2e suite on Postgres. 2. **Roll out**, in the order in [ROLLOUT-1.0.md](./ROLLOUT-1.0.md), with the latest releases: - **Hub 2.9.0** (make and back up the job-signing key first; 2.4.0 onwards have migrations) → the + **Hub 2.10.0** (make and back up the job-signing key first; 2.4.0 onwards have migrations) → the central server's agent (check `proxy_bind_addr = 127.0.0.1`) → each church server's agent (**1.3.1**, never 1.3.0) → **adopt** the demo site, then each church (Link existing → Move onto the monorepo) → per church **Accounts 1.5.0 before Events 3.6.0**, then the move to Accounts diff --git a/docs/VERSIONS.md b/docs/VERSIONS.md index 33148b8..629b039 100644 --- a/docs/VERSIONS.md +++ b/docs/VERSIONS.md @@ -14,7 +14,7 @@ separately below; the two often differ. | Accounts | `crosscode-platform` (`apps/accounts`) | **1.6.0** | `accounts@1.6.0` | 2026-11-20 | | Server agent | `crosscode-platform` (`apps/agent`) | **1.3.1** | `agent@1.3.1` | 2026-11-20 | | Contracts | `crosscode-platform` (`packages/contracts`) | **1.14.0** | `contracts@1.14.0` | 2026-11-20 | -| Cross Code Hub | `events-hub` | **2.9.0** | `v2.9.0` | 2026-11-20 | +| Cross Code Hub | `events-hub` | **2.10.0** | `v2.10.0` | 2026-11-20 | | crosscode.co.za | `crosscode-site` | **1.6.0** | `v1.6.0` | 2026-11-19 | | `crosscode` script | `crosscode-platform` (`scripts/`) | `main` | none | 2026-11-20 (last change: nginx `location ^~ /api/`) | @@ -37,6 +37,10 @@ need their own tags until something outside this repo depends on them. ## What each latest release was for +- **Hub 2.10.0:** every Hub email (job reports, alerts, emails to church admins, notices) laid out + as Events' and Accounts' are. The FastPanel email gives `location ^~ /api/` to paste, and Proxy + done refuses a site whose `/api` files reach the frontend. No migration. + - **Events 3.6.1 (fix):** logo and favicon uploads failed on events-demo: FastPanel's static-file rule sent every `/api/…` path with a file extension to the frontend. The site now passes those on to the backend. Also change the FastPanel site (HANDOVER.md, "FastPanel sites"). No migration.