mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 09:45:22 +03:00
Use Python to write file, fix JSON->YAML
This commit is contained in:
parent
6a47c02e02
commit
5b69d05e15
@ -46,4 +46,4 @@ if [[ -n "${SUPERVISOR_TOKEN:-}" ]]; then
|
||||
get_ip_and_port
|
||||
fi
|
||||
|
||||
python3 /usr/local/go2rtc/create_config.py > /dev/shm/go2rtc.yaml
|
||||
python3 /usr/local/go2rtc/create_config.py
|
||||
|
||||
@ -25,15 +25,16 @@ go2rtc_config: dict[str, any] = config["go2rtc"]
|
||||
if not go2rtc_config.get("log", {}).get("format"):
|
||||
go2rtc_config["log"] = {"format": "text"}
|
||||
|
||||
default_candidates = []
|
||||
# Use FRIGATE_GO2RTC_WEBRTC_CANDIDATE_INTERNAL as candidate if set
|
||||
if os.environ.get("FRIGATE_GO2RTC_WEBRTC_CANDIDATE_INTERNAL"):
|
||||
default_candidates.append(
|
||||
os.environ['FRIGATE_GO2RTC_WEBRTC_CANDIDATE_INTERNAL']
|
||||
)55
|
||||
default_candidates.append("stun:85")
|
||||
|
||||
if not go2rtc_config.get("webrtc", {}).get("candidates", []):
|
||||
default_candidates = []
|
||||
# Use FRIGATE_GO2RTC_WEBRTC_CANDIDATE_INTERNAL as candidate if set
|
||||
if os.environ.get("FRIGATE_GO2RTC_WEBRTC_CANDIDATE_INTERNAL"):
|
||||
default_candidates.append(
|
||||
os.environ.get("FRIGATE_GO2RTC_WEBRTC_CANDIDATE_INTERNAL")
|
||||
)
|
||||
default_candidates.append("stun:8555")
|
||||
go2rtc_config["webrtc"] = {"candidates": default_candidates}
|
||||
|
||||
print(json.dumps(go2rtc_config))
|
||||
# Write YAML config to /dev/shm/go2rtc.yaml
|
||||
with open("/dev/shm/go2rtc.yaml", "w") as f:
|
||||
yaml.dump(config, f)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user