Fix prepare-log and when go2rtc is not present in config

This commit is contained in:
Felipe Santos 2023-01-17 12:14:12 -03:00
parent 2d4ddd9434
commit 473c8d30c8
2 changed files with 2 additions and 2 deletions

View File

@ -1 +1 @@
/etc/s6-overlay/s6-rc.d/init-logs/run /etc/s6-overlay/s6-rc.d/log-prepare/run

View File

@ -20,7 +20,7 @@ if config_file.endswith((".yaml", ".yml")):
elif config_file.endswith(".json"): elif config_file.endswith(".json"):
config = json.loads(raw_config) config = json.loads(raw_config)
go2rtc_config: dict[str, any] = config["go2rtc"] go2rtc_config: dict[str, any] = config.get("go2rtc", {})
if not go2rtc_config.get("log", {}).get("format"): if not go2rtc_config.get("log", {}).get("format"):
go2rtc_config["log"] = {"format": "text"} go2rtc_config["log"] = {"format": "text"}