From d658035b60a102e628809cd4e835ed7304f6671b Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Sun, 26 May 2024 13:41:34 -0600 Subject: [PATCH] Check that the config file is writable --- frigate/util/config.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frigate/util/config.py b/frigate/util/config.py index d8518eac9..df2d0c1f1 100644 --- a/frigate/util/config.py +++ b/frigate/util/config.py @@ -18,6 +18,10 @@ def migrate_frigate_config(config_file: str): """handle migrating the frigate config.""" logger.info("Checking if frigate config needs migration...") + if not os.access(config_file, mode=os.W_OK): + logger.error("Config file is read-only, unable to migrate config file.") + return + yaml = YAML() yaml.indent(mapping=2, sequence=4, offset=2) with open(config_file, "r") as f: