Enable CORS for go2rtc by default

This commit is contained in:
Nicolas Mowen 2023-02-28 06:09:47 -07:00 committed by GitHub
parent 318240c14c
commit 6780791c72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"}