Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

hash_password: raise an error if no config file is specified #12789

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/12789.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The hash_password script now returns an exception when it is called without specifying a config file.
DMRobertson marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions synapse/_scripts/hash_password.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def main() -> None:
bcrypt_rounds = config.get("bcrypt_rounds", bcrypt_rounds)
password_config = config.get("password_config", None) or {}
password_pepper = password_config.get("pepper", password_pepper)
else:
raise Exception("Please specify a path to a config file (-c).")
password = args.password

if not password:
Expand Down