diff options
author | Parker <contact@pkrm.dev> | 2024-07-20 00:22:01 -0500 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-07-20 00:22:01 -0500 |
commit | bbf348c1dcbb25b8f0ecc048ed9831fd21380593 (patch) | |
tree | eb51f8e150943a76e51ba8ca2bd8e1fc73f5386c /code/validate_config.py | |
parent | bb77e85dedebf2a6e3656d4416b29f2d8cf9e2e5 (diff) |
Add ability to have simple passwords
Diffstat (limited to 'code/validate_config.py')
-rw-r--r-- | code/validate_config.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/code/validate_config.py b/code/validate_config.py index a79ff06..e53cd1d 100644 --- a/code/validate_config.py +++ b/code/validate_config.py @@ -96,6 +96,14 @@ def validate_config(file_contents): except ValueError: LOG.error("Invalid value passed to ACCOUNT_TIME. Pass a valid integer value (e.g. 24)") errors += 1 + # Validate SIMPLE_PASSWORDS + if not config["JELLYFIN_ACCOUNTS"]["SIMPLE_PASSWORDS"]: + LOG.error("Empty SIMPLE_PASSWORDS passed. Pass a true/false value.") + errors += 1 + else: + if (config["JELLYFIN_ACCOUNTS"]["SIMPLE_PASSWORDS"].lower() not in YES_VALUES + NO_VALUES): + LOG.error("Invalid value passed to SIMPLE_PASSWORDS. Pass a true/false value.") + errors += 1 # Make sure connection to Jellyfin API can be established jellyfin_headers = { @@ -161,5 +169,6 @@ def create_config(): config["JELLYFIN_ACCOUNTS"] = { "JELLYFIN_URL": "", "JELLYFIN_API_KEY": "", - "ACCOUNT_TIME": "" + "ACCOUNT_TIME": "", + "SIMPLE_PASSWORDS": "", } |