Give finished Rules a print path, folded launch counts, and a two-day follow-up.

Export is PDF, RULE.md, and Print on US Letter, with every shared term, no member names, and a takeaway that points at Ask an organizer. Finished Rules keep type and place so the team can read folded counts without a database, Umami can sit beside the app with no cookies, and the person who holds the pen gets working PDF and RULE.md links 48 hours later.
This commit is contained in:
adilallo committed 2026-11-10 18:32:33 -07:00
1 parent 0efc907633
commit d9c475a967
74 files changed
+2401 -630

No files matched your search

+46 -1
View File
@@ -248,6 +248,9 @@ persist across image updates unless changed:
| `UPLOAD_ROOT` | `/app/data/uploads` on Cloudron — required for file uploads. |
| `OPS_PRUNE_TOKEN` | Bearer token for `POST /api/ops/prune`. Unset hides the route. Optional; the daily scheduler runs the prune inside the container without it. |
| `WORKSHOP_INQUIRY_PURGE_TOKEN` | Bearer token for `POST /api/workshop-inquiries/purge`. Unset hides that route. |
| `RULE_ADMIN_EMAILS` | Named admins. Comma-separated. Can open private Rules and `/rule-counts`. |
| `NEXT_PUBLIC_UMAMI_SRC` | Umami script URL. Unset: no tracker. Pair with `NEXT_PUBLIC_UMAMI_WEBSITE_ID`. |
| `NEXT_PUBLIC_UMAMI_WEBSITE_ID` | Umami website id for this hostname. |
Full detail: [`ops-backend-deploy.md` §3](ops-backend-deploy.md#3-environment-variables).
@@ -320,6 +323,27 @@ node --env-file=.env --import tsx scripts/prune-sessions.ts
If the scheduler addon is missing after an image update, add the same
command under the app **Cron** tab (`20 7 * * *`, UTC).
The same scheduler addon also runs **`follow-up-mail`** at **15 minutes
past every hour**. It sends one print follow-up to the address that holds
the pen, 48 hours after the Rule was finished, with PDF and RULE.md
links. Guest Rules with no account are skipped until claimed, and only
Rules finished in the last seven days are considered so a first run after
deploy does not mail every historic Rule.
Manual run:
```bash
cloudron exec --app staging.communityrule.info -- \
node /app/follow-up-mail.bundle.cjs
# local
node --env-file=.env --import tsx scripts/send-rule-follow-up.ts
```
Named admins can read finished-Rule counts (folded under five) at
`/rule-counts`, or `GET /api/ops/rule-counts` with the same session or
`Authorization: Bearer $OPS_PRUNE_TOKEN`.
### 9.2 Logs
App logs (stdout) and Cloudron request logs are deleted after **14
@@ -336,7 +360,28 @@ host for longer than 14 days.
Sign-in mail failures log a request id, not the email address.
### 9.3 Backups
### 9.3 Umami (site counts)
Umami is a **second Cloudron app**, not this image. Install the Umami
Cloudron package (or Docker) on a hostname such as
`analytics.communityrule.info`. Create a website for this app’s public
origin. In Umami → website settings, **turn off cookies** (tracker
collects aggregate page views only).
Then on this CommunityRule app:
```bash
cloudron env set --app staging.communityrule.info \
NEXT_PUBLIC_UMAMI_SRC=https://analytics.communityrule.info/script.js
cloudron env set --app staging.communityrule.info \
NEXT_PUBLIC_UMAMI_WEBSITE_ID=<website-id>
```
Unset both to ship no tracker. The snippet sets `data-do-not-track` and
`data-exclude-search` so query strings (share and export tokens) are not
sent to Umami.
### 9.4 Backups
Set the Cloudron backup site to **`30 daily`** (*Backups* → *Schedule &
Retention*). Confirm this on staging and production. Cloudron also keeps