encrypt backups
This commit is contained in:
parent
9606a755d0
commit
aa193bf423
1 changed files with 3 additions and 2 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue