Commit Graph
122 Commits
Author SHA1 Message Date
MichaelandClaude Fable 5 9595afcc99 fix(streaming): stop streams dying mid-playback
- reaper no longer kills exited sessions immediately: a finished VOD
  transcode was reaped (segments deleted) while still being watched
- reuse completed VOD/recording sessions instead of re-transcoding
- live input: add -rw_timeout 30s and -reconnect_at_eof so a stalled
  upstream triggers reconnect instead of wedging ffmpeg forever
- reaper watchdog restarts live sessions whose playlist stopped updating
- waitForPlaylist fails fast on clean ffmpeg exit without output
- direct .ts proxy: close http.Client on stream end/error (socket leak)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 14:34:31 +02:00
MichaelandClaude Fable 5 92634dba13 perf: faster stream startup
- Stop sending no-store on vendored player libraries: hls.min.js and
  mpegts.min.js (~750 KB) were re-downloaded on every player open
- hls.js: start with 1 live segment instead of 3, lower buffer-first
  threshold 1.5s -> 0.8s, poll buffer every 100ms
- mpegts.js: initial stash 512KB -> 128KB, start at 0.5s buffered
- Live FFmpeg: -hls_init_time 1 closes the first segment after ~1s

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 11:23:32 +02:00
MichaelandClaude Fable 5 b749960d26 fix: stream auth middleware blocked non-streaming requests
streamAuthMiddleware wrapped the whole streaming router inside the
Cascade, so any unmatched path without a session (e.g. GET / through the
reverse proxy) returned 401 before reaching the static file handler.
Now only /api/live, /api/vod and /api/recordings/stream are guarded;
other paths fall through to the router's 404 and the Cascade continues.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 10:58:11 +02:00
MichaelandClaude Fable 5 60d3f42901 feat: security hardening, streaming overhaul, design polish, tests
Security:
- Replace unsalted SHA-256 password hashing with bcrypt (lazy rehash on login)
- Add authenticated /api/xtream-api gateway: Xtream credentials are injected
  server-side and never sent to the frontend; /api/playlists no longer
  returns passwords
- Redact credentials from all logs (login body, proxy/FFmpeg/scheduler URLs)
- Add auth to recordings, EPG, season-passes and streaming routes
  (HttpOnly session cookie for hls.js; loopback bypass for local FFmpeg)
- Lock player postMessage to same-origin in both directions
- Vendor and pin hls.js 1.6.7 / mpegts.js 1.7.3 (drop CDN @latest)
- Fix rate limiter (client IP was never resolved), add login rate limit,
  restrict CORS, add CSP Report-Only, block private-IP SSRF targets,
  fix path traversal in recording log retrieval, chmod 777 -> 770
- Remove dead HiveService (seeded admin/admin into IndexedDB with SHA-256)
- Fix authMiddleware not populating 'user' context (getPlaylist ignored the
  logged-in user; admin purge always returned 403)

Streaming:
- New FfmpegSessionManager: process registry, idle reaper (4 min live /
  15 min VOD), orphan cleanup at startup, clean SIGTERM shutdown,
  fast-fail with stderr instead of 30 s timeout
- Quality selection (source/high/medium/low) for live and VOD; source mode
  streams with -c:v copy (zero transcoding); selector wired into the player
- Concurrent recordings (MAX_CONCURRENT_RECORDINGS, default 2); conflicts
  retry on the next tick instead of silently failing
- Lower live latency (HLS window 20 -> 10 segments, liveSync 10 -> 3)
- Fix recording log lookup (.mp4 vs .mkv mismatch)

Design:
- Replace hardcoded colors with AppColors tokens (12 files)
- web/theme.css syncs HTML players with the Flutter palette
- DPAD/keyboard navigation (arrow-key focus, player shortcuts)
- Tooltips on player icon buttons, Semantics on content cards
- Remove 7 dead widgets broken since the Stitch merge

Quality:
- bin/test/: 21 unit tests (bcrypt, redaction, traversal, SSRF, recording
  conflicts) plus a quality-selector widget test
- GitHub Actions CI (analyze + test + build web)
- Archive stale status docs into docs/archive/

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 10:07:18 +02:00
Michael c61984d041 feat: implement RecordingScheduler to manage scheduled recordings and automated season passes 2026-04-02 19:12:21 +02:00
Michael 099d7da53f feat: implement streaming handler with FFmpeg-based HLS transcoding and GPU acceleration support 2026-04-02 07:43:23 +02:00
Michael 1b4321d84a feat: implement SimpleRecorder service for FFmpeg-based stream recording and scheduling 2026-04-02 07:22:24 +02:00
Michael ce695b7e43 feat: implement streaming handler with FFmpeg HLS transcoding and live TV proxying 2026-04-01 22:01:16 +02:00
Michael e641d04a3a feat: implement streaming handler with FFmpeg-based live and VOD HLS transcoding support 2026-04-01 21:35:25 +02:00
Michael f08fccc0d1 feat: implement HLS streaming handler with FFmpeg transcoding and add IPTV player screen UI 2026-04-01 21:28:47 +02:00
Michael e4301077b0 feat: implement HLS live streaming and VOD transcoding handler with FFmpeg and NVIDIA GPU support 2026-04-01 21:14:33 +02:00
Michael 6a4a642611 feat: implement IPTV player screen with iframe-based stream support and recordings tab widget 2026-04-01 20:19:40 +02:00
Michael 36a7658cf9 feat: add mobile-optimized video player and streaming API handler 2026-03-29 11:47:09 +02:00
Michael fa6ae90d8d feat: add mobile-optimized IPTV player with HLS and MpegTS support 2026-03-29 10:19:36 +02:00
GitHub Copilot 2c4572191d feat(recording): implement simplified recording system with API endpoints and UI integration 2026-03-26 11:00:40 +01:00
Michael a9a1127d6b fix(server): add direct .ts proxy route for recordings and fix Cascade fall-through 2026-03-11 07:31:42 +01:00
Michael 2ef1db8a68 perf(proxy): enable Keep-Alive and playlist caching to fix 5s zap delay; tuned mobile player for micro-cuts 2026-03-10 22:01:52 +01:00
Michael 8c65e48bbe feat: Implement Xtream IPTV API service, including data fetching, caching, and proxy integration. 2026-03-10 16:48:28 +01:00
Michael f5b3457390 refactor: Consolidate Flutter web and Dart server compilation into a single Docker build stage for streamlined dependency management. 2026-03-10 16:25:46 +01:00
Michael 9f3c29f6dd feat: implement Xtream API service for managing live channels, VOD, and series with caching and dynamic backend URL handling. 2026-03-10 14:57:44 +01:00
Michael 33d0e0a80d fix(streaming): optimize quality, audio sync, and content update refresh
- Increased FFmpeg video quality to 8Mbps and audio to 192kbps.
- Added audio resync filters and better presets.
- Optimized HLS buffer settings for mobile players to reduce interruptions.
- Reduced API cache duration to 15m and added refresh support for faster content updates.
2026-03-10 10:26:24 +01:00
Michael c57273be2c feat: Implement GPU-accelerated live HLS streaming with FFmpeg, including iOS optimizations and IPTV redirect resolution. 2026-03-09 14:10:13 +01:00
Michael d0a2a1ee6a feat: Implement Xtream proxy handler with SSRF protection and M3U8 URL rewriting, resolving 502 proxy errors. 2026-03-09 14:00:28 +01:00
Michael c9a212ec4f feat: implement live HLS streaming with FFmpeg transcoding, GPU acceleration, and HLS segment serving. 2026-03-09 13:52:46 +01:00
Michael 0b5aa3f9e4 feat: Implement initial streaming handler for live and VOD content using FFmpeg HLS transcoding with GPU acceleration support. 2026-03-09 13:46:56 +01:00
Michael bd7645922d feat: add Xtream API proxy with SSRF protection and streaming handler with FFmpeg integration. 2026-03-09 13:41:56 +01:00
Michael b1f887af69 feat: Implement EPG API with caching and Xtream get_epg to get_short_epg fallback for program data. 2026-03-09 11:36:40 +01:00
Michael 3232a3a226 feat: introduce EPG API with caching and TV & Recordings UI with EPG Guide, Recordings, and Season Passes tabs. 2026-03-09 10:47:30 +01:00
Michael fa88746db6 feat: introduce IPTV data models and initial Live TV UI, including EPG overlay. 2026-03-09 10:12:55 +01:00
Michael 1e1687e160 fix(epg): complete rewrite of recordings_tab (XtreamService direct), fix epg_api action (get_epg), add keepAlive 2026-03-09 08:54:45 +01:00
Michael 47fff742e0 fix(epg): use playlist.dns directly (PlaylistConfig has no serverUrl field) 2026-03-09 08:26:16 +01:00
Michael 50a6998c09 feat: add EPG TV guide, season passes (auto-recording) and unified recordings/EPG tab with 3 sub-tabs 2026-03-09 08:21:48 +01:00
Michael 4762b4edf8 feat(recordings): switch output format from mp4 to mkv for better IPTV stream compatibility 2026-03-08 23:56:43 +01:00
Michael bbf462ae05 fix(recordings): DELETE now kills FFmpeg process before removing from DB to properly stop active recordings 2026-03-08 23:54:37 +01:00
Michael 4c2e3ce600 feat: add stop recording button and POST /api/recordings/stop/<id> endpoint to kill FFmpeg process 2026-03-08 23:53:32 +01:00
Michael 424019d01a fix(scheduler): wrap _startRecording in single try/catch to prevent server crash, fix localhost port 8080→8089 2026-03-08 23:38:57 +01:00
Michael c04acc2fab debug(scheduler): add verbose logging every 10s and force UTC datetime comparisons 2026-03-08 23:11:22 +01:00
Michael 60bb10fe4d fix(recordings): correct stream_url to use real live stream, resolve to absolute URL for FFmpeg, use copy mode, speed up scheduler to 10s 2026-03-08 22:43:42 +01:00
Michael 7e0837374e refactor(recordings): eliminate Router/mount, expose direct handler methods to avoid shelf_router path collision 2026-03-08 22:10:59 +01:00
Michael d91be43f27 fix(backend): move GET /recordings/logs/<id> to main router to avoid shelf_router collision with DELETE /<id> 2026-03-08 21:42:53 +01:00
Michael f217622e4a fix(recording): create log file before ffmpeg starts to capture boot exceptions and force absolute path 2026-03-08 20:50:38 +01:00
Michael 548e4cd664 fix(recording): rename log api route to avoid shelf_router Not Found param collisions 2026-03-08 20:43:50 +01:00
Michael 966311f560 feat(recording): add ffmpeg logs writing and viewing in UI 2026-03-08 19:26:54 +01:00
Michael 344cf51ef9 fix(backend): make proxy handler robust to timeouts and add transparent pixel fallback for picons 2026-03-08 17:28:29 +01:00
Michael e46a1c15b3 fix: add missing recording model import in database 2026-03-08 09:05:18 +01:00
Michael 2180572b92 feat: implement live tv recording system 2026-03-08 08:40:55 +01:00
Michael 758cbe4c43 feat: implement Xtream proxy handler with M3U8 URL rewriting, SSRF protection, and content type handling. 2026-01-07 11:31:40 +01:00
Michael 755367018a feat: Implement core server application with API routing, streaming, and static content serving. 2026-01-07 11:29:00 +01:00
Michael 1dd77bd87a feat: implement core server with API routing, middleware, and static file serving 2026-01-07 11:24:26 +01:00
Michael a149bf266c chore: add detailed login logging and update startup message 2026-01-07 10:39:06 +01:00