From b80e34070bc6da3702ceecc61c4704bce977bff3 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 11 Jul 2022 16:28:55 +0200 Subject: [PATCH] prometheus: add helper script for pw hash --- monitoring/prometheus/gen-pass.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 monitoring/prometheus/gen-pass.py diff --git a/monitoring/prometheus/gen-pass.py b/monitoring/prometheus/gen-pass.py new file mode 100644 index 0000000..6a1d04f --- /dev/null +++ b/monitoring/prometheus/gen-pass.py @@ -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())