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 <noreply@anthropic.com>
This commit is contained in:
@@ -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()))
|
Path(".env").write_text("".join(f"{k}={v}\n" for k, v in env.items()))
|
||||||
os.chmod(".env", 0o600)
|
os.chmod(".env", 0o600)
|
||||||
|
|
||||||
def write_mediamtx(streamers):
|
def write_mediamtx(streamers, public_host=""):
|
||||||
users = "".join(f""" - user: {u}
|
users = "".join(f""" - user: {u}
|
||||||
pass: {p}
|
pass: {p}
|
||||||
permissions:
|
permissions:
|
||||||
@@ -294,7 +294,7 @@ webrtcAddress: :8889
|
|||||||
webrtcLocalUDPAddress: :8189
|
webrtcLocalUDPAddress: :8189
|
||||||
webrtcLocalTCPAddress: :8189
|
webrtcLocalTCPAddress: :8189
|
||||||
webrtcIPsFromInterfaces: no
|
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
|
rtmp: yes
|
||||||
rtmpAddress: :1935
|
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)
|
if not yes(" continue anyway?", False): print("aborted; add streamers first ([s] in the menu)"); sys.exit(1)
|
||||||
print("\n== writing configs")
|
print("\n== writing configs")
|
||||||
write_env(watch_host, discord_token, discord_guild, git_host, bot_host, live_host, domain, live_webhook)
|
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"])
|
run(["sudo", "install", "-d", "-o", os.environ.get("SUDO_USER") or os.environ.get("USER") or "debian", "/srv/live"])
|
||||||
print("== app data folders")
|
print("== app data folders")
|
||||||
run(["sudo", "install", "-d", "-o", "1000", "-g", "1000", "/srv/appdata/jellyfin/config", "/srv/appdata/jellyfin/cache",
|
run(["sudo", "install", "-d", "-o", "1000", "-g", "1000", "/srv/appdata/jellyfin/config", "/srv/appdata/jellyfin/cache",
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ webrtcAddress: :8889
|
|||||||
webrtcLocalUDPAddress: :8189
|
webrtcLocalUDPAddress: :8189
|
||||||
webrtcLocalTCPAddress: :8189
|
webrtcLocalTCPAddress: :8189
|
||||||
webrtcIPsFromInterfaces: no
|
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
|
rtmp: yes
|
||||||
rtmpAddress: :1935
|
rtmpAddress: :1935
|
||||||
|
|||||||
Reference in New Issue
Block a user