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
|
config.services.postgresql.package
|
||||||
s3cmd
|
s3cmd
|
||||||
coreutils
|
coreutils
|
||||||
mktemp
|
age
|
||||||
];
|
];
|
||||||
|
|
||||||
text = ''
|
text = ''
|
||||||
configFile="$1"
|
configFile="$1"
|
||||||
s3cfg="$2"
|
s3cfg="$2"
|
||||||
|
|
||||||
|
ageRecipient="age17ckyc69njpryytc63ynn545jswyucg28k5xg3043g3j6q38dxqwq0wzhm2"
|
||||||
bucket="$(cat "$configFile" | grep 'bucket=' | sed 's/bucket \?= \?')"
|
bucket="$(cat "$configFile" | grep 'bucket=' | sed 's/bucket \?= \?')"
|
||||||
prefix="$(cat "$configFile" | grep 'prefix=' | sed 's/prefix \?= \?')"
|
prefix="$(cat "$configFile" | grep 'prefix=' | sed 's/prefix \?= \?')"
|
||||||
|
|
||||||
|
@ -36,7 +37,7 @@ let
|
||||||
function upload () {
|
function upload () {
|
||||||
name="$1"
|
name="$1"
|
||||||
|
|
||||||
s3cmd put --config "$s3cfg" - "$s3Dir/$name"
|
age -r "$ageRecipient" | s3cmd put --config "$s3cfg" - "$s3Dir/$name.age"
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Uploading config"
|
echo "Uploading config"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue