From 357bb61b65edc3825a1a5e5905a8fb4ed706835b Mon Sep 17 00:00:00 2001 From: Brandyn / Techy Date: Sat, 31 Oct 2026 00:48:27 -0500 Subject: [PATCH] MediaMTX: write webrtcAdditionalHosts into the generated config (env-based value left it empty and MediaMTX refused to start) Co-Authored-By: Claude Fable 5.1 --- configure.py | 6 +++--- mediamtx.example.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.py b/configure.py index 97a4ed2..f821cca 100755 --- a/configure.py +++ b/configure.py @@ -267,7 +267,7 @@ def write_env(watch_host, discord_token=None, discord_guild=None, git_host="", b Path(".env").write_text("".join(f"{k}={v}\n" for k, v in env.items())) os.chmod(".env", 0o600) -def write_mediamtx(streamers): +def write_mediamtx(streamers, public_host=""): users = "".join(f""" - user: {u} pass: {p} permissions: @@ -294,7 +294,7 @@ webrtcAddress: :8889 webrtcLocalUDPAddress: :8189 webrtcLocalTCPAddress: :8189 webrtcIPsFromInterfaces: no -# webrtcAdditionalHosts is set via env MTX_WEBRTCADDITIONALHOSTS (= the public hostname) in docker-compose.yml +webrtcAdditionalHosts: [{public_host or "127.0.0.1"}] # public hostname browsers can reach for ICE (written by configure.py) rtmp: yes rtmpAddress: :1935 @@ -406,7 +406,7 @@ def apply(domain, admin_pw, streamers, editors, auth_host="", watch_host="", dis if not yes(" continue anyway?", False): print("aborted; add streamers first ([s] in the menu)"); sys.exit(1) print("\n== writing configs") write_env(watch_host, discord_token, discord_guild, git_host, bot_host, live_host, domain, live_webhook) - write_caddy(domain, auth_host, watch_host, git_host, bot_host, live_host); write_mediamtx(streamers); write_copyparty(admin_pw, editors); write_dump_users(admin_pw, streamers); write_streamers_json(streamers) + write_caddy(domain, auth_host, watch_host, git_host, bot_host, live_host); write_mediamtx(streamers, domain); write_copyparty(admin_pw, editors); write_dump_users(admin_pw, streamers); write_streamers_json(streamers) run(["sudo", "install", "-d", "-o", os.environ.get("SUDO_USER") or os.environ.get("USER") or "debian", "/srv/live"]) print("== app data folders") run(["sudo", "install", "-d", "-o", "1000", "-g", "1000", "/srv/appdata/jellyfin/config", "/srv/appdata/jellyfin/cache", diff --git a/mediamtx.example.yml b/mediamtx.example.yml index 6b8f900..44a29ee 100644 --- a/mediamtx.example.yml +++ b/mediamtx.example.yml @@ -17,7 +17,7 @@ webrtcAddress: :8889 webrtcLocalUDPAddress: :8189 webrtcLocalTCPAddress: :8189 webrtcIPsFromInterfaces: no -# webrtcAdditionalHosts is set via env MTX_WEBRTCADDITIONALHOSTS (= the public hostname) in docker-compose.yml +webrtcAdditionalHosts: [media.example.com] # public hostname browsers can reach for ICE (configure.py fills this) rtmp: yes rtmpAddress: :1935