Skip to content

Commit d0413e3

Browse files
authored
fix: allow env var templating for go2rtc rtsp creds (blakeblackshear#6449)
1 parent 8481ab3 commit d0413e3

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Diff for: docker/rootfs/usr/local/go2rtc/create_config.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,19 @@
6767
# as source for frigate and the integration supports HLS playback
6868
if go2rtc_config.get("rtsp") is None:
6969
go2rtc_config["rtsp"] = {"default_query": "mp4"}
70-
elif go2rtc_config["rtsp"].get("default_query") is None:
71-
go2rtc_config["rtsp"]["default_query"] = "mp4"
70+
else:
71+
if go2rtc_config["rtsp"].get("default_query") is None:
72+
go2rtc_config["rtsp"]["default_query"] = "mp4"
73+
74+
if go2rtc_config["rtsp"].get("username") is not None:
75+
go2rtc_config["rtsp"]["username"] = go2rtc_config["rtsp"]["username"].format(
76+
**FRIGATE_ENV_VARS
77+
)
78+
79+
if go2rtc_config["rtsp"].get("password") is not None:
80+
go2rtc_config["rtsp"]["password"] = go2rtc_config["rtsp"]["password"].format(
81+
**FRIGATE_ENV_VARS
82+
)
7283

7384
# need to replace ffmpeg command when using ffmpeg4
7485
if int(os.environ["LIBAVFORMAT_VERSION_MAJOR"]) < 59:

0 commit comments

Comments
 (0)