mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-15 00:11:15 +03:00
scrub genai API keys and onvif credentials from config endpoint
This commit is contained in:
parent
5a5d23b503
commit
85df969e82
@ -142,9 +142,20 @@ def config(request: Request):
|
|||||||
# remove the proxy secret
|
# remove the proxy secret
|
||||||
config["proxy"].pop("auth_secret", None)
|
config["proxy"].pop("auth_secret", None)
|
||||||
|
|
||||||
|
# remove genai api keys
|
||||||
|
for genai_name, genai_cfg in config.get("genai", {}).items():
|
||||||
|
if isinstance(genai_cfg, dict):
|
||||||
|
genai_cfg.pop("api_key", None)
|
||||||
|
|
||||||
for camera_name, camera in request.app.frigate_config.cameras.items():
|
for camera_name, camera in request.app.frigate_config.cameras.items():
|
||||||
camera_dict = config["cameras"][camera_name]
|
camera_dict = config["cameras"][camera_name]
|
||||||
|
|
||||||
|
# remove onvif credentials
|
||||||
|
onvif_dict = camera_dict.get("onvif", {})
|
||||||
|
if onvif_dict:
|
||||||
|
onvif_dict.pop("user", None)
|
||||||
|
onvif_dict.pop("password", None)
|
||||||
|
|
||||||
# clean paths
|
# clean paths
|
||||||
for input in camera_dict.get("ffmpeg", {}).get("inputs", []):
|
for input in camera_dict.get("ffmpeg", {}).get("inputs", []):
|
||||||
input["path"] = clean_camera_user_pass(input["path"])
|
input["path"] = clean_camera_user_pass(input["path"])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user