From e7496367e9c585268a464b1d8923ab122e92ded4 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sun, 18 Oct 2026 14:46:32 -0500 Subject: [PATCH] resolve placeholders with dev's env module --- frigate/api/app.py | 4 ++-- frigate/test/http_api/test_http_config_set.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frigate/api/app.py b/frigate/api/app.py index 41952f4d3c..f18abecf5c 100644 --- a/frigate/api/app.py +++ b/frigate/api/app.py @@ -45,7 +45,6 @@ from frigate.config.camera.updater import ( CameraConfigUpdateEnum, CameraConfigUpdateTopic, ) -from frigate.config.env import substitute_frigate_vars from frigate.const import REDACTED_CREDENTIAL_SENTINEL from frigate.ffmpeg_presets import FFMPEG_HWACCEL_VAAPI, _gpu_selector from frigate.genai import PROVIDERS, load_providers @@ -73,6 +72,7 @@ from frigate.util.config import ( find_config_file, redact_credential, ) +from frigate.util.env import substitute_frigate_vars from frigate.util.live_streams import ( generated_transcode_streams, sync_transcode_streams, @@ -846,7 +846,7 @@ def _resolve_frigate_vars(value: str) -> str: """Resolve {FRIGATE_*} placeholders the way /config shows them.""" try: return substitute_frigate_vars(value) - except (KeyError, ValueError): + except ValueError: return value diff --git a/frigate/test/http_api/test_http_config_set.py b/frigate/test/http_api/test_http_config_set.py index e3145e6591..549b74e500 100644 --- a/frigate/test/http_api/test_http_config_set.py +++ b/frigate/test/http_api/test_http_config_set.py @@ -584,8 +584,10 @@ class TestConfigSetWildcardPropagation(BaseTestHttp): {"path": path, "roles": [role]} for path, role in paths ] + # config parsing rebuilds FRIGATE_ENV_VARS from its sources + @patch.dict("frigate.util.env._CONTAINER_ENV", {"FRIGATE_RTSP_PASSWORD": "s3cret"}) @patch.dict( - "frigate.config.env.FRIGATE_ENV_VARS", {"FRIGATE_RTSP_PASSWORD": "s3cret"} + "frigate.util.env.FRIGATE_ENV_VARS", {"FRIGATE_RTSP_PASSWORD": "s3cret"} ) @patch("frigate.api.app.find_config_file") def test_masked_path_keeps_env_placeholder(self, mock_find_config):