prometheus: add helper script for pw hash

pull/4/head
teutat3s 2022-07-11 16:28:55 +02:00
parent 4564d1afe4
commit b80e34070b
Signed by: teutat3s
GPG Key ID: 4FA1D3FA524F22C1
1 changed files with 9 additions and 0 deletions

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())