1
0

Fix backup secrets generation script to actually append new secrets to htaccess files

This commit is contained in:
clerie 2023-05-19 22:28:38 +02:00
parent 4f01b4a8a1
commit b03421ec96

View File

@ -23,5 +23,10 @@ mv hosts/${host}/secrets/new hosts/${host}/secrets/clerie-backup-target-cyan.age
echo "$target_magenta" | nix run github:ryantm/agenix -- -e hosts/${host}/secrets/new echo "$target_magenta" | nix run github:ryantm/agenix -- -e hosts/${host}/secrets/new
mv hosts/${host}/secrets/new hosts/${host}/secrets/clerie-backup-target-magenta.age mv hosts/${host}/secrets/new hosts/${host}/secrets/clerie-backup-target-magenta.age
echo "$target_cyan_htpasswd" | nix run github:ryantm/agenix -- -e hosts/clerie-backup/secrets/restic-server-cyan-htpasswd.age prev_htpasswd_cyan=$(nix run github:ryantm/agenix -- -d hosts/clerie-backup/secrets/restic-server-cyan-htpasswd.age)
echo "$target_magenta_htpasswd" | nix run github:ryantm/agenix -- -e hosts/backup-4/secrets/restic-server-magenta-htpasswd.age cat <(echo "$prev_htpasswd_cyan") <(echo "$target_cyan_htpasswd") | nix run github:ryantm/agenix -- -e hosts/clerie-backup/secrets/new
mv hosts/clerie-backup/secrets/new hosts/clerie-backup/secrets/restic-server-cyan-htpasswd.age
prev_htpasswd_magenta=$(nix run github:ryantm/agenix -- -d hosts/backup-4/secrets/restic-server-magenta-htpasswd.age)
cat <(echo "$prev_htpasswd_magenta") <(echo "$target_magenta_htpasswd") | nix run github:ryantm/agenix -- -e hosts/backup-4/secrets/new
mv hosts/backup-4/secrets/new hosts/backup-4/secrets/restic-server-magenta-htpasswd.age