mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 17:55:21 +03:00
Add frigate env var subsitutions
This commit is contained in:
parent
ea88aa095f
commit
868c947f74
@ -4,6 +4,8 @@ import json
|
|||||||
import os
|
import os
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
|
||||||
|
FRIGATE_ENV_VARS = {k: v for k, v in os.environ.items() if k.startswith("FRIGATE_")}
|
||||||
config_file = os.environ.get("CONFIG_FILE", "/config/config.yml")
|
config_file = os.environ.get("CONFIG_FILE", "/config/config.yml")
|
||||||
|
|
||||||
# Check if we can use .yaml instead of .yml
|
# Check if we can use .yaml instead of .yml
|
||||||
@ -27,4 +29,7 @@ if not go2rtc_config.get("log", {}).get("format"):
|
|||||||
if not go2rtc_config.get("webrtc", {}).get("candidates", []):
|
if not go2rtc_config.get("webrtc", {}).get("candidates", []):
|
||||||
go2rtc_config["webrtc"] = {"candidates": ["stun:8555"]}
|
go2rtc_config["webrtc"] = {"candidates": ["stun:8555"]}
|
||||||
|
|
||||||
|
for name in go2rtc_config.get("streams", {}):
|
||||||
|
go2rtc_config["streams"][name] = go2rtc_config["streams"][name].format(**FRIGATE_ENV_VARS)
|
||||||
|
|
||||||
print(json.dumps(go2rtc_config))
|
print(json.dumps(go2rtc_config))
|
||||||
Loading…
Reference in New Issue
Block a user