From 6780791c72fa31e3453b900eb560569a9f9b737e Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 28 Feb 2023 06:09:47 -0700 Subject: [PATCH] Enable CORS for go2rtc by default --- 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..5abcc1558 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["log"]["origin"] = "*" + # we want to ensure that logs are easy to read if go2rtc_config.get("log") is None: go2rtc_config["log"] = {"format": "text"}