]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: support new FORCE_SDENC and key-manager script
authorAlain Spineux <alain@baculasystems.com>
Thu, 6 Oct 2022 11:15:27 +0000 (13:15 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:59 +0000 (13:56 +0200)
- use a shell wrapper to call key-manager.py, because the
  Bacula's directive are limited to 128 chars

regress/scripts/functions

index 4a961d42d50523a1b5cc85dac3a5619d2a8f7bef..777d1fd659b5445527425aceebbf56b3b63efc2b 100755 (executable)
@@ -213,6 +213,24 @@ EOF
       $bperl -e 'add_attribute("$conf/bacula-dir.conf", "SD Calls Client", "yes", "Client")'
       variant_name="${variant_name} SDcall"
    fi
+   if [ x$FORCE_SDENC = xyes ]; then
+      SDENC_COMMAND="\"$bin/key-manager-cmd.sh\""
+      cat > $bin/key-manager-cmd.sh <<EOF
+# --key-dir "$working/keydir"
+# --log "$working/key-manager.log"
+VERBOSE=-v
+#VERBOSE=
+OPTION=-m
+exec $bin/key-manager.py getkey \$VERBOSE \$OPTION --cipher AES_128_XTS
+EOF
+      chmod a+x $bin/key-manager-cmd.sh
+      $bperl -e "add_attribute('$conf/bacula-sd.conf', 'EncryptionCommand', '$SDENC_COMMAND', 'Storage')"
+      $bperl -e "add_attribute('$conf/bacula-sd.conf', 'BlockEncryption', 'enable', 'Device')"
+      variant_name="${variant_name} SDEnc"
+
+#      $bperl -e "add_attribute('$conf/bacula-dir.conf', 'SpoolData', 'no', 'Job')"
+
+   fi
    if [ $devicetype -gt 1 ]; then
        echo "ERROR: Found multiple FORCE_XXX switches"
        set | awk '/^FORCE_/ { print $0 }'