prometheus: add helper script for pw hash

This commit is contained in:
teutat3s 2022-07-11 16:28:55 +02:00
parent 4564d1afe4
commit b80e34070b
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1

View file

@ -0,0 +1,9 @@
# nix-shell -p python310Packages.bcrypt --run 'python gen-pass.py'
# https://prometheus.io/docs/guides/basic-auth/
import getpass
import bcrypt
password = getpass.getpass("password: ")
hashed_password = bcrypt.hashpw(password.encode("utf-8"), bcrypt.gensalt())
print(hashed_password.decode())