Let Cloudron turn on named admins, the ops token, and Umami after the image is built.

Tracker env is read at request time and the CSP already allows the analytics host, so staging can set a rule admin, an ops bearer token, and the cookieless Umami site without rebuilding.
This commit is contained in:
adilallo committed 2026-11-23 11:51:55 -07:00
1 parent 36112f95d3
commit f7d88a7d5c
9 files changed
+132 -49

No files matched your search

+18 -3
View File
@@ -91,9 +91,15 @@ per-app in the manifest and provisioned at install time.
(`start.sh` chowns `/app/data` for the `node` user). When unset, upload
routes return `server_misconfigured`. See [CONTRIBUTING.md](../../CONTRIBUTING.md)
API table.
- `RULE_ADMIN_EMAILS` — comma-separated named admins. Required on staging
so `/rule-counts` exists and an admin read of a private Rule is logged.
- `OPS_PRUNE_TOKEN` — bearer token for `POST /api/ops/prune` and
`GET /api/ops/rule-counts`. Unset hides prune; together with an empty
admin list, `/api/ops/rule-counts` answers 404.
- `NEXT_PUBLIC_UMAMI_SRC` / `NEXT_PUBLIC_UMAMI_WEBSITE_ID` — optional
Umami tracker. Unset until the companion Umami app is installed.
Cookie-free mode is set on Umami, not here. See
Cookie-free mode is set on Umami, not here. The app reads these at
request time, so `cloudron env set` does not need a rebuild. See
[ops-runbook.md](ops-runbook.md) §9.3.
## 4. Platform settings
@@ -465,11 +471,15 @@ production env vars, and verify the vertical slice before apex cutover
SMTP_FROM="CommunityRule <hello@communityrule.info>" \
ENABLE_PRIVACY_POLICY=true \
NEXT_PUBLIC_ENABLE_BACKEND_SYNC=true \
UPLOAD_ROOT=/app/data/uploads
UPLOAD_ROOT=/app/data/uploads \
RULE_ADMIN_EMAILS="<named-admin-emails>" \
OPS_PRUNE_TOKEN="$(openssl rand -hex 32)"
```
Rotating `SESSION_SECRET` logs everyone out. `SMTP_FROM` must be an address
SES accepts on `communityrule.info` (platform mail addon is SES-relayed with
custom-from allowed — §3).
custom-from allowed — §3). Named admins can open private Rules and
`/rule-counts`; keep `OPS_PRUNE_TOKEN` in 1Password. Umami is a separate
app — [ops-runbook.md](ops-runbook.md) §9.3.
5. **Confirm the app is running** in the Cloudron dashboard (Logs tab). Look
for a clean `prisma migrate deploy` and Next.js listening on port 3000.
6. **Seed facet data (one-time per environment)** — templates + `MethodFacet`
@@ -501,6 +511,11 @@ steps below are still required.
resume works after re-login.
- [ ] **Upload (optional):** with `UPLOAD_ROOT` set, attach a community photo
in create flow and confirm it renders after publish.
- [ ] **Rule counts:** `GET /api/ops/rule-counts` is 401 logged out, 200
with `Authorization: Bearer $OPS_PRUNE_TOKEN` or a named-admin
session. `/rule-counts` is reachable after signing in as a named admin.
- [ ] **Umami:** homepage HTML includes the tracker (`data-website-id`).
The Umami site has cookies turned off.
**If something fails:**