reject restricted go2rtc stream sources when added via api

This commit is contained in:
Josh Hawkins
2026-05-15 09:30:36 -05:00
parent 3c71816fd0
commit e1334188e3
4 changed files with 47 additions and 6 deletions
@@ -17,6 +17,7 @@ from frigate.const import (
)
from frigate.ffmpeg_presets import parse_preset_hardware_acceleration_encode
from frigate.util.config import find_config_file
from frigate.util.services import is_restricted_source
sys.path.remove("/opt/frigate")
@@ -135,11 +136,6 @@ if LIBAVFORMAT_VERSION_MAJOR < 59:
go2rtc_config["ffmpeg"]["rtsp"] = rtsp_args
def is_restricted_source(stream_source: str) -> bool:
"""Check if a stream source is restricted (echo, expr, or exec)."""
return stream_source.strip().startswith(("echo:", "expr:", "exec:"))
for name in list(go2rtc_config.get("streams", {})):
stream = go2rtc_config["streams"][name]