mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-06 10:57:22 +03:00
reject restricted go2rtc stream sources when added via api
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user