aboutsummaryrefslogtreecommitdiff
path: root/regenerate-secrets.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regenerate-secrets.sh')
-rwxr-xr-xregenerate-secrets.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/regenerate-secrets.sh b/regenerate-secrets.sh
index 2aafb7ee..6b31a24c 100755
--- a/regenerate-secrets.sh
+++ b/regenerate-secrets.sh
@@ -9,6 +9,9 @@ encto () {
}
store () {
+ # Overwriting an existing encrypted file will change its content, even if
+ # its decrypted content does not change, so leave it alone.
+ [ -e "$3" ] && return 0
pass show "$2" > /dev/null || return 1
pass show "$2" | head -1 | encto "$1" "$3"
}
@@ -40,3 +43,8 @@ encto lud tw/system/files/mythic-dns.scm.enc << EOF
"$(pass show www/mythic-beasts/dns-lud | sed -rn '/^username: /s///p')" ; username
"$(pass show www/mythic-beasts/dns-lud | head -1)" ; password
EOF
+
+encto vin tw/system/files/grafana/metrics-credentials.enc << EOF
+GF_METRICS_BASIC_AUTH_USERNAME=$(pass show computers/vin/grafana/metrics | sed -rn '/^username: /s///p')
+GF_METRICS_BASIC_AUTH_PASSWORD=$(pass show computers/vin/grafana/metrics | head -1)
+EOF