feat: runtime config, Matomo analytics, chat accounts, DM history/search, and Prometheus retention
This commit is contained in:
1 parent
06ab5b4655
commit
121fdbacdc
27 files changed
+1841
-161
No files matched your search
@@ -1,6 +1,6 @@
|
||||
# DONE
|
||||
|
||||
Completed tasks from `.github/instructions/TODO.md`. Historical record for CHANGELOG.md, README.md, architecture docs.
|
||||
> Completed tasks from [TODO](./TODO.md). Historical record for [CHANGELOG](./CHANGELOG.md), [README](./README.md), [architecture docs](./architecture/README.md).
|
||||
|
||||
## Session 2026-08-07 — Unit Tests
|
||||
|
||||
@@ -1087,3 +1087,64 @@ Completed the three Playout enhancement workstreams from `TODO.md`. Remaining po
|
||||
- Verify `init.mp4` + manifest are correctly published on clean completion (existing `publishManifest` path runs after every run)
|
||||
- Add metrics `linearvoid_playout_loops_total` (clean completions) and `linearvoid_playout_run_duration_seconds`
|
||||
- Tests: `TestPlaylistFingerprint`, `TestHLSNextStartNumber`
|
||||
|
||||
## Session 2026-08-13 — Application Configuration, Matomo, Chat Accounts
|
||||
|
||||
### Application configuration (runtime config store)
|
||||
|
||||
- Runtime config store in `backend/chat/src/config/runtime.go` (thread-safe `Get`/`Set`, JSON persist, typed getters/setters with validation)
|
||||
- `ConfigPath()` default `/app/playlist/config.json` (shared with playout via the playlist volume)
|
||||
- Typed getters: `MatomoURL()`, `MatomoSiteID()`, `HLSSegmentDuration()`, `HLSWindowSize()`
|
||||
- `GET/PUT /api/admin/config` now reads/persists `matomoUrl`, `matomoSiteId`, `hlsSegmentDuration`, `hlsWindowSize`
|
||||
- Admin UI config form extended (`frontend/public/admin/system.html` + `frontend/src/admin.ts`)
|
||||
- Playout reads the shared `config.json` (`loadSharedHLSConfig` + `PLAYOUT_CONFIG_PATH`)
|
||||
- Tests: `runtime_test.go`, config handler tests, `TestLoadSharedHLSConfig`
|
||||
|
||||
### Matomo analytics
|
||||
|
||||
- Public `GET /api/matomo` endpoint
|
||||
- Viewer pageview snippet in `frontend/index.html`
|
||||
- Test: `TestHandlePublicMatomo`
|
||||
|
||||
### Admin frontend (media status + playlist gating)
|
||||
|
||||
- Media library: status badges (`ready`/`needs_normalization`/`normalizing`/`failed`) + "Add to playlist" gated to `ready` media
|
||||
- Playlist entries: per-item status badges
|
||||
- `statusBadge`, `fetchMediaStatusMap`, `addMediaToPlaylist` in `admin.ts`
|
||||
|
||||
### Chat user accounts
|
||||
|
||||
- `db.User` model (bcrypt password hash, unique username)
|
||||
- `auth.UserSessionStore` (token → username with expiry)
|
||||
- Endpoints: `POST /api/auth/register`, `POST /api/auth/login`, `GET /api/auth/session`, `POST /api/auth/logout`
|
||||
- Viewer sign-in UI (`frontend/index.html` + `frontend/src/main.ts`)
|
||||
- Tests: `TestUserSessionStore`, register/login/session handler tests
|
||||
|
||||
### Private DM history & search
|
||||
|
||||
- `GET /api/dm/history` (paginated) + `GET /api/dm/search` (case-insensitive)
|
||||
- DM search UI in viewer
|
||||
- Tests: `TestHandleUserDMHistory`, `TestHandleUserDMHistory_Unauthorized`, `TestHandleUserDMSearch`
|
||||
|
||||
### Chat UI (typing indicator + user list)
|
||||
|
||||
- `Hub.BroadcastTyping` (ephemeral typing events, not persisted)
|
||||
- Viewer typing indicator (`showTyping`/`hideTyping`/`sendTyping`) + user-list toggle
|
||||
|
||||
## Session 2026-08-13 — Prometheus TSDB Retention
|
||||
|
||||
- Added `--storage.tsdb.retention.time=30d` (delete metrics older than 30d) + `--storage.tsdb.retention.size=15GB` (disk cap) to the `prometheus` service `command` in `docker-compose.yml` and `docker-compose.prod.yml`
|
||||
- Validated: `docker compose config --quiet` (both files), `promtool check config` (SUCCESS, 10 rules), Prometheus v3.13.2 accepts both retention flags
|
||||
- Documented the retention policy in `docs/MONITORING.md` → Operational Recommendations
|
||||
|
||||
## Session 2026-08-13 — Architecture Documentation Update
|
||||
|
||||
- Updated `docs/architecture/README.md` to reflect the `[Unreleased]` changes:
|
||||
- Automatic media normalization on upload (`media.NormalizeVideo`, statuses, `POST /api/admin/media/{id}/normalize`)
|
||||
- Playout: seamless looping, R2 segment retention, `-validate` mode, shared runtime config, new loop/cleanup metrics
|
||||
- Prometheus: TSDB retention (`30d` + `15GB`), alert rule count fixed 8 → 10
|
||||
- New Cross-cutting Concepts sections: Runtime Configuration Store, Analytics (Matomo)
|
||||
- Viewer user accounts (register/login/logout/session, bcrypt, `linearvoid_user_session`)
|
||||
- Chat: DM history/search, typing indicator, user-list toggle
|
||||
- API reference: `GET/PUT /api/admin/config`, `POST /api/admin/media/{id}/normalize`, new Viewer REST API section
|
||||
- Frontend + Chat Service module tables updated
|
||||
Reference in new issue
Block a user