feat(media): primary media storage, growth goals, retention and delivery tools
CI / build (push) Has been cancelled

Event photos and videos are now stored only on the NFS/local share named in
Settings -> Media storage. Uploads, photo editing, video processing and the
per-event filing step refuse to run until that share is configured and
writable, so nothing is silently written inside the container. Video
originals, renditions, posters and sidecars share one folder on the share.

Also adds volunteer growth goals with a mentor queue, an admin retention and
storage sweep with a cron entry point, cached gallery thumbnails with
per-folder ZIP downloads, a server-rendered booth-sheet PDF, and in-app
confirm/release for every upcoming assignment.

Service reminders now ignore the one-off event reminder rule, which had been
queueing an extra bogus reminder for each published service.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
2026-11-20 23:21:34 +00:00
parent cb5976edb2
commit f7a0c8618f
68 changed files with 3237 additions and 297 deletions
+4 -3
View File
@@ -68,7 +68,8 @@ Media Team Hub is a **working, container-deployed church media-team scheduling a
| **Repair** | Security, assignment correctness, notification reconciliation, completion job, CI/env/docs | DONE, uncommitted |
| **Event photography (MVP)** | Events + photographer/editor assignments, shared folders, streamed RAW/JPEG uploads, downloads, manager event deletion + file cleanup, E2E | DONE, uncommitted |
| **Announcements** | Admin/coordinator authoring, publish/unpublish, delete, published-only volunteer feed, E2E | DONE, uncommitted |
| **Not started** | F1 rich text (TipTap) + sanitize, G exports/swaps, full J event seats/reminders/publish pipeline, I launch pass | — |
| **Growth & maintenance** | Growth goals + mentor queue UI, retention/storage sweep (+ cron), cached photo thumbnails, per-folder ZIP, server PDF booth sheet, in-app responses for every upcoming assignment | DONE |
| **Not started** | Full J event seats/reminders/publish pipeline, XLSX exports, I launch pass | — |
---
@@ -517,7 +518,7 @@ GET /api/dev/cron/complete [session | CRON_SECRET]
**Session validation:** every `gateOrUser` request re-reads the account row. A JWT whose user was deleted, deactivated or re-seeded (for example after a test reset) now gets a `401 STALE_SESSION` instead of writing rows with a phantom `user_id`; the photo uploader redirects to `/login`.
**Event photography access model:** managers (`schedule.publish`) see every event and assign people; only assigned photographers/editors (plus managers) can open an event, create folders, upload, and download each other's files. Unassigned users get a 404. Files are stored under `UPLOAD_DIR/events/<eventId>/`, never in Postgres; the filename/type is validated by extension (RAW or image), the SHA-256 dedupes re-uploads per folder, and non-previewable files are forced to download. Managers can delete an event; the DB cascade removes folders/photos and the route recursively removes that event's directory, with an audit row.
**Event photography access model:** managers (`schedule.publish`) see every event and assign people; only assigned photographers/editors (plus managers) can open an event, create folders, upload, and download each other's files. Unassigned users get a 404. Files are stored under `<archive root>/events/<eventId>/` on the configured NFS/local share (never in Postgres and never in container-local storage; uploads and editing are blocked until that share is configured and writable); the filename/type is validated by extension (RAW or image), the SHA-256 dedupes re-uploads per folder, and non-previewable files are forced to download. Managers can delete an event; the DB cascade removes folders/photos and the route recursively removes that event's directory, with an audit row.
**Announcements access model:** every signed-in user reads published posts. `content.author` (admin/coordinator) also sees drafts and can create, publish/unpublish or delete. Bodies are plain text and rendered as text, never HTML.
@@ -553,7 +554,7 @@ Still missing screens (APIs exist): volunteer profile + prefs, blackout calendar
## 13. Training, uploads, settings
- Lessons: sanitized rich-text HTML body (headings, lists, links, inline images with alignment/size/move controls), published flag, ordering. Volunteers see published; admins author/publish/delete. Two plain-text starter lessons seeded only when the table is empty and normalized to HTML on read.
- Lessons: sanitized rich-text HTML body (headings, lists, links, inline images with alignment/size/caption/move controls), published flag, ordering. Volunteers see published; admins author/publish/delete. Two plain-text starter lessons seeded only when the table is empty and normalized to HTML on read.
- Attachments: images/PDF/plain text/Markdown/Word, ≤25 MB, random stored name, metadata in Postgres, bytes under `UPLOAD_DIR`.
- Uploads verify **magic bytes** against the declared MIME; SVG is rejected because it can execute as a document.
- Serving requires a session; images and PDFs render inline, everything else is a download, with `nosniff`.