Commit Graph
11 Commits
Author SHA1 Message Date
ubuntuandClaude Sonnet 5 0fa98c7283 Read the client IP from X-Real-IP behind the nginx reverse proxy
Since TLS termination moved to nginx, aiohttp's request.remote is
nginx's own address on the docker network (172.21.0.1), a private IP
that resolve_ip_country() correctly refuses to geolocate. Nginx
already forwards the real client address via X-Real-IP
(iptv.mrk.ovh.conf); read that first so device IP/country tracking
works again.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-30 23:29:10 +00:00
ubuntuandClaude Sonnet 5 6881839e31 Fix crashing /init_db and remove dead proxy_image handler
/init_db dropped the channels/playlists collections then crashed on
an undefined `res` variable, so the "Reset DB" button in the UI
always surfaced a 500 even though the wipe had already happened.
proxy_image used aiohttp.ClientSession without importing aiohttp and
was never routed or called from the frontend, so it's just removed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-30 23:29:04 +00:00
ubuntuandClaude Sonnet 5 55cefe47f4 Fix path traversal in file-serving and file-writing endpoints
playlist_download, download_epg, upload_snapshot, and get_logo all
built filesystem paths by concatenating a caller-supplied string
(filename/id_channel/id_device) with no validation, so a '../'
payload could read or write files outside the intended directory.
upload_snapshot was the most exploitable: fully attacker-controlled
bytes written to an attacker-chosen path with no prior lookup gating
it. Add a safe_join() helper that resolves the path and rejects
anything that escapes the base directory, and use it at all four
call sites.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-30 23:19:54 +00:00
ubuntuandClaude Sonnet 5 21d40c932e Stop leaking the Gemini API key through /gemini_key
The settings endpoint returned the raw key to any caller, and the
frontend used that response to pre-fill the input field, which also
meant saving with an untouched field would silently resubmit the
plaintext key. /gemini_key now reports only whether a key is set and
a masked preview; the UI shows that as a placeholder and only updates
the stored key when the field is actually filled in.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-30 23:16:39 +00:00
ubuntuandClaude Sonnet 5 b16a0a811c Fix server freeze from unresponsive logo/image hosts
requests.get() calls had no timeout and ran directly on the aiohttp
event loop, so a single dead logo host would hang for minutes and
block every other request. Add timeouts and move logo downloads in
get_logo to a thread executor so a slow/dead host no longer stalls
the whole server.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-30 18:05:19 +00:00
ubuntu df36139bd5 Delegate TLS termination to the nginx reverse proxy
The app now listens on plain HTTP (127.0.0.1:5023 only) instead of
binding 443 and terminating TLS itself. Nginx handles TLS for
iptv.mrk.ovh and proxies to the app internally.
2026-08-30 11:47:25 +00:00
ubuntuandClaude Sonnet 5 3eb0d5e8cd Add device-side log file, remote terminal, and streaming error reporting
IPTV.py now writes logs to a rotating file and forwards critical VLC
playback errors (start timeout, MediaPlayerEncounteredError) to the
server instead of losing everything to unredirected print() calls.
The web UI's device menu gets a working Terminal (to run diagnostic
commands like tail on the log) and a Recent errors view backed by a
capped last_errors list on each device document, keeping DB volume
bounded to the last 5 entries per device.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-16 22:09:51 +00:00
ubuntu 10fd5106f8 Show device country next to its IP address, resolved via ip-api.com 2026-08-16 10:39:17 +00:00
ubuntu 7a5dba7dbf Run Xtream imports in background to avoid long-held HTTP connections dropping silently 2026-08-16 01:28:31 +00:00
ubuntu e34a71b910 Fix Xtream API requests blocked by provider due to default python-requests User-Agent 2026-08-16 00:52:30 +00:00
ubuntu a4b23c5f5d Commit initial du projet serverIPTV 2026-08-03 13:14:43 +00:00