summaryrefslogtreecommitdiffstats
path: root/bin/copy-secrets
diff options
context:
space:
mode:
Diffstat (limited to 'bin/copy-secrets')
-rwxr-xr-xbin/copy-secrets11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/copy-secrets b/bin/copy-secrets
index 24685ede0..f40493599 100755
--- a/bin/copy-secrets
+++ b/bin/copy-secrets
@@ -32,6 +32,11 @@ case $(nixos-query services.ejabberd-cd.enable 2>/dev/null) in true)
ejabberd_uid=$(nixos-query users.extraUsers.ejabberd.uid)
esac
+case $(nixos-query tv.consul.enable 2>/dev/null) in true)
+ consul_secret=$(nixos-query tv.consul.encrypt-file)
+ consul_uid=$(nixos-query users.extraUsers.consul.uid)
+esac
+
(set -x
rsync \
--rsync-path="mkdir -p \"$2\" && rsync" \
@@ -46,6 +51,8 @@ retiolum_secret=${retiolum_secret-}
retiolum_uid=${retiolum_uid-}
ejabberd_secret=${ejabberd_secret-}
ejabberd_uid=${ejabberd_uid-}
+consul_secret=${consul_secret-}
+consul_uid=${consul_uid-}
if test -n "\$retiolum_secret"; then
chown -v "\$retiolum_uid:0" "\$retiolum_secret"
@@ -55,4 +62,8 @@ if test -n "\$ejabberd_secret"; then
chown -v "\$ejabberd_uid:0" "\$ejabberd_secret"
fi
+if test -n "\$consul_secret"; then
+ chown -v "\$consul_uid:0" "\$consul_secret"
+fi
+
EOF