mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
hash_password: raise an error if no config file is specified (#12789)
This commit is contained in:
parent
b935c9529c
commit
f16ec055cc
1
changelog.d/12789.misc
Normal file
1
changelog.d/12789.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
The `hash_password` script now fails when it is called without specifying a config file.
|
@ -46,14 +46,14 @@ def main() -> None:
|
|||||||
"Path to server config file. "
|
"Path to server config file. "
|
||||||
"Used to read in bcrypt_rounds and password_pepper."
|
"Used to read in bcrypt_rounds and password_pepper."
|
||||||
),
|
),
|
||||||
|
required=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
if "config" in args and args.config:
|
config = yaml.safe_load(args.config)
|
||||||
config = yaml.safe_load(args.config)
|
bcrypt_rounds = config.get("bcrypt_rounds", bcrypt_rounds)
|
||||||
bcrypt_rounds = config.get("bcrypt_rounds", bcrypt_rounds)
|
password_config = config.get("password_config", None) or {}
|
||||||
password_config = config.get("password_config", None) or {}
|
password_pepper = password_config.get("pepper", password_pepper)
|
||||||
password_pepper = password_config.get("pepper", password_pepper)
|
|
||||||
password = args.password
|
password = args.password
|
||||||
|
|
||||||
if not password:
|
if not password:
|
||||||
|
Loading…
Reference in New Issue
Block a user