diff options
-rw-r--r-- | changelog.d/12789.misc | 1 | ||||
-rwxr-xr-x | synapse/_scripts/hash_password.py | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/changelog.d/12789.misc b/changelog.d/12789.misc new file mode 100644 index 0000000000..3398d00110 --- /dev/null +++ b/changelog.d/12789.misc @@ -0,0 +1 @@ +The `hash_password` script now fails when it is called without specifying a config file. diff --git a/synapse/_scripts/hash_password.py b/synapse/_scripts/hash_password.py index 3aa29de5bd..3bed367be2 100755 --- a/synapse/_scripts/hash_password.py +++ b/synapse/_scripts/hash_password.py @@ -46,14 +46,14 @@ def main() -> None: "Path to server config file. " "Used to read in bcrypt_rounds and password_pepper." ), + required=True, ) args = parser.parse_args() - if "config" in args and args.config: - config = yaml.safe_load(args.config) - bcrypt_rounds = config.get("bcrypt_rounds", bcrypt_rounds) - password_config = config.get("password_config", None) or {} - password_pepper = password_config.get("pepper", password_pepper) + config = yaml.safe_load(args.config) + bcrypt_rounds = config.get("bcrypt_rounds", bcrypt_rounds) + password_config = config.get("password_config", None) or {} + password_pepper = password_config.get("pepper", password_pepper) password = args.password if not password: |