infra-vintage/monitoring/prometheus/gen-pass.py

10 lines
295 B
Python

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