From 80db028281688322f59fbab4d40c21111593648d Mon Sep 17 00:00:00 2001 From: Zac Gaetano Date: Fri, 17 Apr 2026 09:51:02 -0400 Subject: [PATCH] feat(config): add webrtc global config block Adds webrtc.enable, webrtc.public_ip, webrtc.nat_1_to_1_ips, and webrtc.udp_mux_port to the Core Data struct and registers each via the existing vars system. Default is disabled; no behavior change without explicit opt-in. --- config/config.go | 6 ++++++ config/data.go | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/config/config.go b/config/config.go index 33d9492..cfc4698 100644 --- a/config/config.go +++ b/config/config.go @@ -227,6 +227,12 @@ func (d *Config) init() { d.vars.Register(value.NewBool(&d.SRT.Log.Enable, false), "srt.log.enable", "CORE_SRT_LOG_ENABLE", nil, "Enable SRT server logging", false, false) d.vars.Register(value.NewStringList(&d.SRT.Log.Topics, []string{}, ","), "srt.log.topics", "CORE_SRT_LOG_TOPICS", nil, "List of topics to log", false, false) + // WebRTC (Dragon Fork M2) + d.vars.Register(value.NewBool(&d.WebRTC.Enable, false), "webrtc.enable", "CORE_WEBRTC_ENABLE", nil, "Enable WebRTC egress subsystem", false, false) + d.vars.Register(value.NewString(&d.WebRTC.PublicIP, ""), "webrtc.public_ip", "CORE_WEBRTC_PUBLIC_IP", nil, "ICE NAT1To1 host candidate IP (LAN or public)", false, false) + d.vars.Register(value.NewStringList(&d.WebRTC.NAT1To1IPs, []string{}, " "), "webrtc.nat_1_to_1_ips", "CORE_WEBRTC_NAT_1_TO_1_IPS", nil, "Advanced: multiple NAT1To1 IPs", false, false) + d.vars.Register(value.NewInt(&d.WebRTC.UDPMuxPort, 0), "webrtc.udp_mux_port", "CORE_WEBRTC_UDP_MUX_PORT", nil, "Single UDP port for all ICE traffic (0 = ephemeral)", false, false) + // FFmpeg d.vars.Register(value.NewExec(&d.FFmpeg.Binary, "ffmpeg", d.fs), "ffmpeg.binary", "CORE_FFMPEG_BINARY", nil, "Path to ffmpeg binary", true, false) d.vars.Register(value.NewInt64(&d.FFmpeg.MaxProcesses, 0), "ffmpeg.max_processes", "CORE_FFMPEG_MAXPROCESSES", nil, "Max. allowed simultaneously running ffmpeg instances, 0 for unlimited", false, false) diff --git a/config/data.go b/config/data.go index 3550788..d801932 100644 --- a/config/data.go +++ b/config/data.go @@ -113,6 +113,12 @@ type Data struct { Topics []string `json:"topics"` } `json:"log"` } `json:"srt"` + WebRTC struct { + Enable bool `json:"enable"` + PublicIP string `json:"public_ip"` + NAT1To1IPs []string `json:"nat_1_to_1_ips"` + UDPMuxPort int `json:"udp_mux_port" format:"int"` + } `json:"webrtc"` FFmpeg struct { Binary string `json:"binary"` MaxProcesses int64 `json:"max_processes" format:"int64"`