Commit Graph

61 Commits

Author SHA1 Message Date
e646e36869 fix(proxy): stream binary media with cancellation and bounded HLS buffers
Adapted from MikaelKW/nodecast-tv-plus commit 011b634417b2ecd2a2844df9808b42de831ba194. Use awaited pipeline, abort upstream on disconnect, avoid retries after headers, preserve real range support, and rewrite bounded manifests using relative proxy paths. Cover interrupted streams, first-byte delivery, ranges, redirects, split signatures, and invalid inputs.

Co-authored-by: Mikael <mikaelkwessel@gmail.com>
2026-10-12 16:06:52 -07:00
12080ba0a6 fix(db): serialize complete JSON mutations and preserve concurrent edits
Adapted from MikaelKW/nodecast-tv-plus commit 55cb8de23a37eb5683459bffed9b64c6c5dd73ae. Queue reads, validations, and writes together; return write errors to callers; preserve existing IDs and metadata; route source/user edits through the atomic operations. Cover concurrent writes, stale edits, queue recovery, and administrator races.

Co-authored-by: Mikael <mikaelkwessel@gmail.com>
2026-10-12 16:01:58 -07:00
9fff0474e1 fix(remux): preserve encrypted HLS and test protocol restrictions
Allow nested crypto for encrypted HTTP HLS while rejecting top-level protocol wrappers and local-file access. Replace the HLS-only http_persistent option with HTTP multiple_requests across probe/remux/transcode paths, fixing the raw HTTP regression introduced by #124. Add real FFmpeg regression tests and PR CI.
2026-10-12 15:41:13 -07:00
138efd6007 fix(remux): validate stream URL scheme and restrict ffmpeg protocols (CWE-78)
The /api/remux endpoint passed the user-supplied 'url' query parameter
straight to 'ffmpeg -i <url>'. spawn() with an argv array prevented shell
injection, but ffmpeg itself accepts a wide set of protocol handlers
(file://, concat:, subfile:, data:, pipe:, crypto:, async:, cache:, ...)
that read from the local filesystem or compose existing protocols.
Because the resulting ffmpeg stdout is piped directly back to the
response, an attacker who could call /api/remux could read arbitrary
local files (e.g. ?url=file:///etc/passwd, concat:file://...).

Apply two layers of defence at the entry point only:

1. validateStreamUrl(): reject anything that is not a syntactically valid
   http:// or https:// URL, and reject any string containing control
   characters before parsing (so CR/LF/NUL cannot be silently stripped).

2. Pass -protocol_whitelist http,https,tls,tcp,hls to ffmpeg so that even
   if a future code path forwarded a different URL, ffmpeg would refuse
   to open file/concat/subfile/pipe/data/crypto/async/cache inputs.

Legitimate http/https stream URLs (including ports, userinfo, queries,
and HLS playlists) continue to work; only non-network schemes and
malformed inputs are rejected with HTTP 400.
2026-10-12 15:37:03 -07:00
98d2651e7b Merge pull request #124 from asandhu3/ffmpeg-fixes
Fix ffmpeg redirects. Fix max resolution setting.
2026-10-12 15:16:31 -07:00
01349d48e7 fix(subtitle): validate url scheme and index to prevent local file reads 2026-07-22 22:15:09 +01:00
f5e2c77d25 Fix ffmpeg redirects. Fix max resolution setting. 2026-04-24 15:19:19 -06:00
ac6c82e3fc fix: resume from homepage not correctly handling source_id 2026-01-22 18:23:48 -08:00
237d11cf00 feat: implement hardware and software upscaling 2026-01-19 01:34:45 -08:00
100a26fe4e chore: update screenshots in readme and sso icon 2026-01-18 19:49:22 -08:00
f9fefa3947 fix: filter homepage recent sections by hidden status 2026-01-18 17:06:26 -08:00
bf111e1fca feat: add home page with resume functionality and recently added VOD 2026-01-18 03:08:08 -08:00
dc029f75e5 feat: implement per-user favorites with SQLite storage 2026-01-17 23:47:09 -08:00
d54428472c feat: add user management modal with SSO/Local badges and fix OIDC session serialization 2026-01-17 23:36:34 -08:00
5752f529cb feat: implement OIDC SSO with JIT provisioning 2026-01-17 22:52:06 -08:00
c1f8077438 feat: add smart audio copy and audio mix presets for configurable 5.1 downmixing 2026-01-17 13:31:13 -08:00
2c34359b2c feat: Implement hardware-accelerated HLS transcoding with granular controls, smart stereo downmixing, and robust support for MKV and 10-bit HEVC playback. 2026-01-17 03:07:16 -08:00
efcf14a545 feat: implement GPU encoder pipelines 2026-01-17 01:39:26 -08:00
f0c1393ce0 feat: add hardware detection service for GPU-accelerated transcoding (NVIDIA/AMD/Intel/VAAPI) 2026-01-17 01:00:37 -08:00
2a03cad213 feat: add -seekable 0 to fix 405 errors and configurable User-Agent presets for stream requests 2026-01-17 00:45:55 -08:00
196b9520b7 feat: add large M3U playlist warning (50K+ channels) 2026-01-16 17:00:57 -08:00
c951a5998e fix: normalize epg_channel_id for M3U sources (#44) 2026-01-12 14:01:37 -08:00
838b540922 chore: remove deprecated M3U proxy route and API method 2026-01-12 00:23:27 -08:00
aeee45869b Fixed EPG description not displaying due to property name mismatch 2026-01-10 14:10:07 -08:00
8d36a2c07e feat: add subtitle extraction and display for MKV/container streams 2026-01-10 12:35:39 -08:00
346a0519e9 feat: added smart auto-transcoding with probe-based routing and MKV/remux support 2026-01-10 00:35:42 -08:00
67d9cb26d2 Fix proxy streaming for small files like HLS encryption keys 2026-01-07 16:38:17 -08:00
ffd995c1c5 Fix Pluto TV key loading by expanding CDN domain detection 2026-01-07 14:32:40 -08:00
7184a1ba56 Added DEFAULT_MAX_AGE_HOURS constant to proxy route 2026-01-07 13:51:05 -08:00
3e834d4f41 Fix: Restore proper HLS stream proxy with encryption key handling 2026-01-07 11:17:01 -05:00
5bb0629de2 Changed transcode ffmpeg flags 2026-01-06 20:16:20 -08:00
f525a6ee67 Added streaming service style watch page for movies and series playback 2026-01-06 20:01:43 -08:00
6557b9061f Implemented cascade deletion for removed sources 2026-01-04 17:17:27 -08:00
a00082b0ef Implemented virutal scrolling for epg, optimized database batching, moved sync timer to server 2026-01-04 00:46:51 -08:00
ca87a5f143 Misc fixes for syncService, remux and proxy 2026-01-04 00:18:58 -08:00
dd95c6f6ed Removed +igndts and +nobuffer from FFmpeg fflags 2026-01-03 23:25:47 -08:00
374a87b2fd Implemented cascading update save logic 2026-01-03 21:46:07 -08:00
8805ddbc13 Refactored code to use sqlite for channel, epg and vod data 2026-01-03 21:07:18 -08:00
b7bc03a960 fix vod seeking bar 2026-01-03 06:55:55 -05:00
024b847d05 Increased stream analyze duration to 0.5 seconds 2026-01-01 16:16:39 -08:00
096420596b Merge branch 'main' into dev 2026-01-01 13:07:34 -08:00
e1a197f2be implement authentication and authorization 2026-01-01 15:36:38 -05:00
9fb8df7255 Improve FFmpeg startup speed and stream resilience 2026-01-01 11:52:47 -08:00
218757c6c3 Replaced deprecated ffmpeg -vsync with -fps_mode 2026-01-01 00:47:55 -08:00
54cedd197b Added more aggressive timestamp handling for ad stitched streams 2026-01-01 00:45:41 -08:00
2531f1786f Improved ffmpeg error resilience for ad stitched streams 2026-01-01 00:33:10 -08:00
d1bfd1b9e7 Added server-side saving for settings 2025-12-31 15:35:37 -08:00
a90ac32a3b Added FFmpeg system 2025-12-31 09:52:26 -08:00
4683582dd0 Added retry mechanism to proxy for transient upstream 5xx erors 2025-12-31 00:36:54 -08:00
c037ef6862 Added experimental force remux setting to remux raw ts streams to mp4 container 2025-12-30 15:27:19 -08:00