From 21a34a4bd5c0fc3f707f57fbb65fc40359f739c6 Mon Sep 17 00:00:00 2001 From: zwitschi Date: Wed, 5 Aug 2026 11:44:46 +0200 Subject: [PATCH] Release version 1.0.5 Chat Message Admin Improvements: 3 API endpoints, 9 page HTML split, chat-log UI with delete/confirm/pagination/filter/bulk delete CI/CD Improvements: Go cache fix, lint script, Vite env cleanup, chat start_period 30s, nginx health check, log dump on fail --- .gitea/workflows/cd.yml | 35 ++++++++++++++++++++++++-------- .gitea/workflows/ci.yml | 3 +++ CHANGELOG.md | 42 +++++++++++++++++++-------------------- README.md | 2 +- docker-compose.prod.yml | 2 +- frontend/admin/index.html | 2 +- frontend/package.json | 5 +++-- 7 files changed, 56 insertions(+), 35 deletions(-) diff --git a/.gitea/workflows/cd.yml b/.gitea/workflows/cd.yml index cb9cde0..23cd363 100644 --- a/.gitea/workflows/cd.yml +++ b/.gitea/workflows/cd.yml @@ -73,23 +73,42 @@ jobs: env: DOCKER_HOST: tcp://192.168.88.40:2375 run: | - # Wait for playout to stabilize (it may restart during init) + # Wait for services to stabilize sleep 20 - curl -f http://192.168.88.40:3000/health || exit 1 + + # Check chat health + echo "Checking chat health..." + if ! curl -f http://192.168.88.40:3000/health; then + echo "Chat health check failed" + docker logs linearvoid-chat --tail 50 + exit 1 + fi + + # Check nginx health + echo "Checking nginx health..." + if ! curl -f http://192.168.88.40:8080/; then + echo "Nginx health check failed" + docker logs linearvoid-nginx --tail 50 + exit 1 + fi + # Retry playout health check since it may still be initializing + echo "Checking playout health..." for i in $(seq 1 6); do if docker exec linearvoid-playout curl -sf http://localhost:8081/health; then echo "Playout is healthy" - exit 0 + break fi echo "Playout not ready yet (attempt $i/6), waiting 5s..." sleep 5 done - echo "Playout failed to become healthy after 6 attempts" - docker logs linearvoid-playout --tail 50 - exit 1 - curl -f http://192.168.88.40:3000/health || exit 1 - docker exec linearvoid-playout curl -sf http://localhost:8081/health || exit 1 + if ! docker exec linearvoid-playout curl -sf http://localhost:8081/health; then + echo "Playout failed to become healthy after 6 attempts" + docker logs linearvoid-playout --tail 50 + exit 1 + fi + + echo "All services healthy" - name: Cleanup old images env: diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 34021bc..8a8b630 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -36,6 +36,9 @@ jobs: with: go-version: "1.22" cache: true + cache-dependency-path: | + backend/playout/go.sum + backend/chat/go.sum - name: Validate Playlist Normalization run: cd backend/playout && go run src/playlist.go playlist.txt || echo "Validation script not yet complete" diff --git a/CHANGELOG.md b/CHANGELOG.md index 05eeb5e..2e19075 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,40 +2,38 @@ -## Unreleased +## [1.0.5] - 2026-08-05 ### Added -- Documentation for Admin UI Media Library (arc42 updates, refined TODO, media DB model decisions per ADR-006). -- Started implementation of full Media CRUD + video duration extraction using ffprobe (Media Library - Full CRUD section). -- Added `/api/admin/media/{id}` GET/PUT/DELETE handlers for media metadata retrieval, updates, and file+record deletion. -- Extended admin schedule and dashboard data endpoints with media duration totals, runtime strings, and media counts. -- Added admin UI runtime display for schedule/dashboard plus media library edit/delete actions. -- Added a dedicated plain TypeScript admin module for tab navigation, media CRUD actions, schedule/system analytics refresh, and moderation workflows without Alpine dependencies. -- Added resumable chunked admin media upload flow with upload-session endpoints and client progress indicators. -- Expanded architecture documentation with scaling strategy, API surface reference, detailed video normalization spec, and Cloudflare configuration reference. -- Added `API.md`, `DEPLOYMENT.md`, `MONITORING.md`, and `SECURITY.md` as dedicated operational documentation guides. +- `GET /api/admin/chat-log` endpoint with `?room=`, `?limit=`, `?before=`, `?username=`, `?text=` filter/pagination support. +- `GET /api/admin/chat-log/:id` endpoint returning a single chat log entry as JSON. +- `DELETE /api/admin/chat-log/:id` endpoint returning 204 No Content on success. +- `DELETE /api/admin/chat-log/bulk` endpoint accepting `{"ids": [...]}` for bulk deletion (max 500). +- Chat Log admin tab with table, individual delete with confirmation dialog, pagination (prev/next), search/filter by room/username/text, select-all checkbox, and bulk delete button. +- Added `"lint": "tsc --noEmit"` script to `frontend/package.json`. +- `/api/admin/media/{id}` GET/PUT/DELETE handlers for media metadata retrieval, updates, and file+record deletion. +- Resumable chunked admin media upload flow with upload-session endpoints and client progress indicators. +- Prometheus-format `/metrics` endpoint for chat runtime and admin-session monitoring. +- Dedicated operational documentation: `API.md`, `DEPLOYMENT.md`, `MONITORING.md`, `SECURITY.md`. ### Changed -- Revised ADR-006 to reflect current implemented storage: PostgreSQL is the compose default and deployed primary backend, with SQLite retained as optional fallback. -- Updated chat runtime image to include ffmpeg/ffprobe for media duration probing on upload. +- Split `frontend/admin/index.html` into a template shell plus 9 per-tab page HTML files loaded dynamically via `loadPageContent` / `switchTab` / `bindPageEvents`. - Rebuilt viewer, admin, and admin-login pages around custom semantic class structures with accessibility-focused landmarks, tab semantics, and keyboard-focus behavior. - Replaced legacy and Tailwind-based stylesheet rules with a custom design-token CSS system covering responsive layouts, forms, tables, and reduced-motion behavior. -- Switched the frontend theme to dark-mode-first token defaults with a light-scheme override path for users who prefer light appearance. -- Refactored the viewer page to a single header plus unified content layout with responsive video/chat split, mobile stacking, and chat panel toggle behavior. -- Code-split `hls.js` via lazy loading in the viewer bootstrap to shrink the main frontend bundle and isolate stream playback logic into a dedicated chunk. -- Added navigation links in root README and architecture docs to the new API, deployment, monitoring, and security guide files. +- Switched frontend theme to dark-mode-first token defaults with light-scheme override. +- Bumped chat healthcheck `start_period` from 10s to 30s in `docker-compose.prod.yml`. +- CD workflow now verifies nginx (port 8080) + chat (3000) + playout (8081); dumps container logs for all failing services. +- Updated Prometheus scrape targets and Grafana dashboard queries to use live chat metrics. ### Fixed -- Started Admin UI Media Library backend implementation by adding the `Media` GORM model and AutoMigrate integration in chat startup. -- Implemented media upload duration probing with ffprobe and persisted media metadata to the database alongside filesystem storage. -- Updated media listing to read from the media table and return duration metadata with HH:MM:SS runtime formatting. -- Removed Tailwind and Alpine runtime/build dependencies from the frontend package configuration and eliminated Tailwind directives/warnings during production build. +- Go module cache in CI now correctly references `backend/playout/go.sum` and `backend/chat/go.sum`. - Enforced 2GB upload ceiling plus server-side media file type/size validation for admin uploads. -- Increased nginx `client_max_body_size` to allow resumable admin upload chunks and prevent `413 Content Too Large` responses. -- Removed legacy now-playing viewer UI elements that conflicted with the streamlined single-header layout. +- Increased nginx `client_max_body_size` to allow resumable admin upload chunks without 413 errors. +- Removed unused `data-admin-*` Vite env var attributes from admin HTML template. +- Removed Tailwind and Alpine runtime/build dependencies; eliminated Tailwind directives/warnings during production build. ## [1.0.3] - 2026-08-03 diff --git a/README.md b/README.md index 4f9b4e7..c7ba9f8 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Build Status](https://git.allucanget.biz/zwitschi/linearvoid/actions/workflows/ci.yml/badge.svg)](https://git.allucanget.biz/zwitschi/linearvoid/actions) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![Gitea](https://img.shields.io/badge/Gitea-1.27.1-blue)](https://git.allucanget.biz) -[![Version](https://img.shields.io/badge/version-1.0.3-blue)](https://git.allucanget.biz/zwitschi/linearvoid/releases) +[![Version](https://img.shields.io/badge/version-1.0.5-blue)](https://git.allucanget.biz/zwitschi/linearvoid/releases) [![Release Notes](https://img.shields.io/badge/release-notes-green)](CHANGELOG.md) ## Architecture diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 77e950c..07a8825 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -42,7 +42,7 @@ services: interval: 10s timeout: 5s retries: 5 - start_period: 10s + start_period: 30s nginx: image: git.allucanget.biz/zwitschi/linearvoid/nginx:latest diff --git a/frontend/admin/index.html b/frontend/admin/index.html index df41d9f..b12439f 100644 --- a/frontend/admin/index.html +++ b/frontend/admin/index.html @@ -8,7 +8,7 @@ - +