From 5d90c0bc59f274b1df6d9d5fb7dc39298fecfc6b Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Fri, 18 Nov 2022 18:17:56 +0100 Subject: bin/os-conf: update --- bin/os-conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/os-conf b/bin/os-conf index 8ee143d..d6a31a1 100755 --- a/bin/os-conf +++ b/bin/os-conf @@ -49,11 +49,14 @@ handle_secret() { tar -cz -f $archive -T - 2>/dev/null; chown 1000:1000 $archive; )" + # TODO: can we avoid re-encrypting every single time? + h=$(md5sum "$archive" | cut -d' ' -f1) # encrypt the tarfile and amend some information that makes # reconstructing easier ( sops --config /dev/null --encrypt "$archive" 2>/dev/null | - jq -r '.sops.data_extension |= "tar.gz"' + jq -r '.sops.data_extension |= "tar.gz"' | + jq --arg h "$h" -r '.sops.data_hash |= $h' ) >"${archive}.enc" printf "%s\n" "${archive}.enc" ;; -- cgit 1.4.1