Files
felhom.eu/documentation/audits/night-burndown-2026-10-06/r777/RESULT.md
T

4.8 KiB
Raw Blame History

R-777 — Jellyfin and Emby treat every internet visitor as the home network — MEASURED and fixed on a held branch

Night 2026-10-06, scratch guest 9202 on demo-hp, 20:39–21:10 local. Baselines: catalog d63ea35, controller v0.301.0 on 9202. Architecture: audits/visitors-2026-10-01/A/DESIGN.md §3–§5 (the tunnel chain; 10-…/01-topology-and-trust.md carry no more).

Method

  • Install through the controller's own endpoint (POST /api/stacks/<app>/deploy, box_walk.py), setup wizard and users through each app's own API as the household (LAN, setup-gate cookie). Emby has no setup-done probe: its gate was opened with the household's button (POST /apps/emby/setup-gate/open, e6).
  • A user r777remoteoff with remote access OFF (policy read back: EnableRemoteAccess = False).
  • The internet visitor, simulated as in visitors-2026-10-01 (9202 has no tunnel): a container at cloudflared's fixed 172.16.253.2 on felhom-tunnel POSTs /Users/AuthenticateByName to traefik with what Cloudflare sends (CF-Connecting-IP and X-Forwarded-For = 198.51.100.66) — tunnel.sh; the forged variant sends X-Forwarded-For: 10.0.0.5, 198.51.100.66 (tunnel-forge.sh).
  • Controls from a different channel: the app's own session list (RemoteEndPoint) and the app's own log line.
  • The fix was measured on two paths each: the running install (the changed compose applied to its stack by hand, docker compose up -d, the controller not involved) and a FRESH volume (a renamed throwaway copy, project r777jf / r777emby, never known to the controller).

Results

App Before After the fix
Jellyfin 10.11.11 tunnel sign-in 200; session address 172.18.0.5 = traefik (j3, j4) tunnel 403, log: forbidden: remote access disabled and user not in local network (IP: 198.51.100.66); forged XFF 403, same address; LAN household 200, session 192.168.0.180 (j6–j8); fresh volume: seeded, Jellyfin loaded KnownProxies ['172.16.0.0/12'], tunnel 403 (j10–j12)
Emby 4.11.0.4 tunnel sign-in 200; session address 172.16.253.2 = cloudflared; log X-Real-Ip=172.16.253.2, no XFF (e7–e9) with LocalNetworkSubnets = 10.0.0.0/8, 192.168.0.0/16: tunnel 403 (User r777remoteoff is not allowed remote access), forged 403, LAN household 200 (e10–e12); fresh volume: seeded, kept through the wizard, tunnel 403, LAN 200 (e13–e15); empty list → recreate → filled, 403 (e16)

The row's „Emby: no setting fixes it" was wrong (it was read in source, not measured): Emby counts every private address as local only while LocalNetworkSubnets is EMPTY. Naming the home ranges without 172.16.0.0/12 (where traefik and cloudflared live) fixes it. So R-777 needs no operator decision for Emby.

The fix (catalog branch night-r777 commit 7876e71, to be merged onto night-held-2026-10-06; NOT on main)

  • templates/jellyfin/docker-compose.yml: a start command writes KnownProxies 172.16.0.0/12 into network.xml (fresh volume, or <KnownProxies /> still empty), then exec /jellyfin/jellyfin.
  • templates/emby/docker-compose.yml: a start command writes LocalNetworkSubnets 10.0.0.0/8, 192.168.0.0/16 into system.xml (fresh, or <LocalNetworkSubnets /> still empty; chowned to the server's UID:GID), then exec /init.
  • A household's own non-empty list is never touched.
  • Cost / what can go wrong: a home network in 172.16–31.x counts as REMOTE in both apps — a user with remote access off then cannot sign in at home (the safe direction; the app's own setting fixes it). Jellyfin's partial seed file is read with defaults (proven: port 8096, remote access on, IPv4 on).
  • Gates: catalog_gates.py --fast green; catalog_gates.py jellyfin|emby green except volume-persistence, which refuses on DooPlex for every app (its canary fails on main too, checked with gokapi) — environmental, not this change.

Teardown (three layers)

  • Machine (9202): both apps removed through the product (remove_hdd_data: false — their drive path was the scratch drive's ROOT, so "delete drive data" would have reached other apps' folders; their volumes were removed by the product); both throwaway copies docker compose down -v; /root/r777 deleted. App list equal to before: True (t2). No test container or volume left (t3). Left in place, by design: the two pulled images (no hand prune), and userdata/jellyfin + userdata/emby folders that predate tonight (2026-09-22).
  • Host (demo-hp): nothing provisioned; /tmp push files removed.
  • Hub: nothing provisioned.

Not done

  • No real Cloudflare path (9202 has no tunnel) — the simulation is the established method.
  • Not merged to the held branch or pushed (the lead does that).