From 42eaa13402def795118420f3157f83244877c49e Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 3 Mar 2023 16:43:50 -0700 Subject: [PATCH] Enable CORS for go2rtc by default (#5610) * Enable CORS for go2rtc by default * Fix typo --- docker/rootfs/usr/local/go2rtc/create_config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker/rootfs/usr/local/go2rtc/create_config.py b/docker/rootfs/usr/local/go2rtc/create_config.py index d034e044b..d201eb381 100644 --- a/docker/rootfs/usr/local/go2rtc/create_config.py +++ b/docker/rootfs/usr/local/go2rtc/create_config.py @@ -30,6 +30,12 @@ elif config_file.endswith(".json"): go2rtc_config: dict[str, any] = config.get("go2rtc", {}) +# Need to enable CORS for go2rtc so the frigate integration / card work automatically +if go2rtc_config.get("api") is None: + go2rtc_config["api"] = {"origin": "*"} +elif go2rtc_config["api"].get("origin") is None: + go2rtc_config["api"]["origin"] = "*" + # we want to ensure that logs are easy to read if go2rtc_config.get("log") is None: go2rtc_config["log"] = {"format": "text"}