Support special characters in passwords, redacted logs & debug config (#4057)

* Consts for regex

* Add regex for camera username and password

* Redact user:pass from ffmpeg logs

* Redact ffmpeg commands

* Move common function to util

* Add tests

* Formatting

* Remove unused imports

* Fix test

* Add port to test

* Support special characters in passwords

* Add tests for special character handling

* Remove docs about not supporting special characters
This commit is contained in:
Nicolas Mowen
2022-11-02 06:00:54 -06:00
committed by GitHub
parent 11624d4759
commit 1bc9efd529
7 changed files with 83 additions and 20 deletions

View File

@@ -30,6 +30,7 @@ from frigate.const import CLIPS_DIR
from frigate.models import Event, Recordings
from frigate.object_processing import TrackedObject, TrackedObjectProcessor
from frigate.stats import stats_snapshot
from frigate.util import clean_camera_user_pass
from frigate.version import VERSION
logger = logging.getLogger(__name__)
@@ -581,7 +582,7 @@ def config():
camera_dict = config["cameras"][camera_name]
camera_dict["ffmpeg_cmds"] = copy.deepcopy(camera.ffmpeg_cmds)
for cmd in camera_dict["ffmpeg_cmds"]:
cmd["cmd"] = " ".join(cmd["cmd"])
cmd["cmd"] = clean_camera_user_pass(" ".join(cmd["cmd"]))
config["plus"] = {"enabled": current_app.plus_api.is_active()}