mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-13 06:35:24 +03:00
strip whitespaces when loading secrets
This commit is contained in:
parent
4ee8557061
commit
8309804bd3
@ -23,7 +23,7 @@ if os.path.isdir("/run/secrets"):
|
|||||||
if secret_file.startswith("FRIGATE_"):
|
if secret_file.startswith("FRIGATE_"):
|
||||||
FRIGATE_ENV_VARS[secret_file] = Path(
|
FRIGATE_ENV_VARS[secret_file] = Path(
|
||||||
os.path.join("/run/secrets", secret_file)
|
os.path.join("/run/secrets", secret_file)
|
||||||
).read_text()
|
).read_text().strip()
|
||||||
|
|
||||||
config_file = os.environ.get("CONFIG_FILE", "/config/config.yml")
|
config_file = os.environ.get("CONFIG_FILE", "/config/config.yml")
|
||||||
|
|
||||||
|
|||||||
@ -89,7 +89,7 @@ def get_jwt_secret() -> str:
|
|||||||
# check docker secrets
|
# check docker secrets
|
||||||
elif os.path.isfile(os.path.join("/run/secrets", JWT_SECRET_ENV_VAR)):
|
elif os.path.isfile(os.path.join("/run/secrets", JWT_SECRET_ENV_VAR)):
|
||||||
logger.debug(f"Using jwt secret from {JWT_SECRET_ENV_VAR} docker secret file.")
|
logger.debug(f"Using jwt secret from {JWT_SECRET_ENV_VAR} docker secret file.")
|
||||||
jwt_secret = Path(os.path.join("/run/secrets", JWT_SECRET_ENV_VAR)).read_text()
|
jwt_secret = Path(os.path.join("/run/secrets", JWT_SECRET_ENV_VAR)).read_text().strip()
|
||||||
# check for the addon options file
|
# check for the addon options file
|
||||||
elif os.path.isfile("/data/options.json"):
|
elif os.path.isfile("/data/options.json"):
|
||||||
with open("/data/options.json") as f:
|
with open("/data/options.json") as f:
|
||||||
|
|||||||
@ -64,7 +64,7 @@ if os.path.isdir("/run/secrets") and os.access("/run/secrets", os.R_OK):
|
|||||||
if secret_file.startswith("FRIGATE_"):
|
if secret_file.startswith("FRIGATE_"):
|
||||||
FRIGATE_ENV_VARS[secret_file] = Path(
|
FRIGATE_ENV_VARS[secret_file] = Path(
|
||||||
os.path.join("/run/secrets", secret_file)
|
os.path.join("/run/secrets", secret_file)
|
||||||
).read_text()
|
).read_text().strip()
|
||||||
|
|
||||||
DEFAULT_TRACKED_OBJECTS = ["person"]
|
DEFAULT_TRACKED_OBJECTS = ["person"]
|
||||||
DEFAULT_ALERT_OBJECTS = ["person", "car"]
|
DEFAULT_ALERT_OBJECTS = ["person", "car"]
|
||||||
|
|||||||
@ -42,7 +42,7 @@ class PlusApi:
|
|||||||
and os.access("/run/secrets", os.R_OK)
|
and os.access("/run/secrets", os.R_OK)
|
||||||
and PLUS_ENV_VAR in os.listdir("/run/secrets")
|
and PLUS_ENV_VAR in os.listdir("/run/secrets")
|
||||||
):
|
):
|
||||||
self.key = Path(os.path.join("/run/secrets", PLUS_ENV_VAR)).read_text()
|
self.key = Path(os.path.join("/run/secrets", PLUS_ENV_VAR)).read_text().strip()
|
||||||
# check for the addon options file
|
# check for the addon options file
|
||||||
elif os.path.isfile("/data/options.json"):
|
elif os.path.isfile("/data/options.json"):
|
||||||
with open("/data/options.json") as f:
|
with open("/data/options.json") as f:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user