encrypt backups

This commit is contained in:
jaina heartles 2024-12-25 15:41:55 -05:00
parent 9606a755d0
commit aa193bf423

View file

@ -20,13 +20,14 @@ let
config.services.postgresql.package
s3cmd
coreutils
mktemp
age
];
text = ''
configFile="$1"
s3cfg="$2"
ageRecipient="age17ckyc69njpryytc63ynn545jswyucg28k5xg3043g3j6q38dxqwq0wzhm2"
bucket="$(cat "$configFile" | grep 'bucket=' | sed 's/bucket \?= \?')"
prefix="$(cat "$configFile" | grep 'prefix=' | sed 's/prefix \?= \?')"
@ -36,7 +37,7 @@ let
function upload () {
name="$1"
s3cmd put --config "$s3cfg" - "$s3Dir/$name"
age -r "$ageRecipient" | s3cmd put --config "$s3cfg" - "$s3Dir/$name.age"
}
echo "Uploading config"