added possiblity to turn off encryption

This commit is contained in:
Tobias Müller 2025-01-15 12:18:28 +01:00
parent 5eefb6f671
commit 83406b84af
4 changed files with 33 additions and 22 deletions

View File

@ -27,3 +27,6 @@ HEALTHCHECKSUUID="aa7b0de3-2c17-4fce-b051-388a5415e656"
HEALTHCHECKSHOSTNAME="https://healthchecks.mydomain.com" HEALTHCHECKSHOSTNAME="https://healthchecks.mydomain.com"
TZ=Etc/UTC TZ=Etc/UTC
# Disable Encryption
ENCRYPTION=1

View File

@ -1,7 +1,6 @@
version: '3.3'
services: services:
pbs-client: pbs-client:
image: aterfax/pbs-client image: tmueller/pbs-client
container_name: pbs-client container_name: pbs-client
hostname: pbs-client hostname: pbs-client
restart: unless-stopped restart: unless-stopped

View File

@ -26,25 +26,29 @@ master_public_keyfile="/root/.config/proxmox-backup/master-public.pem"
expect="/usr/bin/expect" expect="/usr/bin/expect"
# Check if client encryption keyfile exists and do stuff. if [ -n "$UNENCRYPTED" ]; then
if [ -f "$client_encryption_keyfile" ]; then echo "Encryption not activated not gonna create any Keys."
echo "Client encryption keyfile exists. Skipping client encryption keyfile creation."
else else
# Check if client encryption keyfile exists and do stuff.
if [ -f "$client_encryption_keyfile" ]; then
echo "Client encryption keyfile exists. Skipping client encryption keyfile creation."
else
echo "Client encryption keyfile does not exist. Creating new client encryption keyfile." echo "Client encryption keyfile does not exist. Creating new client encryption keyfile."
$expect /etc/s6-overlay/s6-rc.d/key_setup/client_key $expect /etc/s6-overlay/s6-rc.d/key_setup/client_key
fi fi
# Check if both Master keyfiles exist and do stuff. # Check if both Master keyfiles exist and do stuff.
if [ -f "$master_private_keyfile" ] && [ -f "$master_public_keyfile" ]; then if [ -f "$master_private_keyfile" ] && [ -f "$master_public_keyfile" ]; then
echo "Both master private and public keys exist. Skipping client Master keyfiles creation." echo "Both master private and public keys exist. Skipping client Master keyfiles creation."
elif [ ! -f "$master_private_keyfile" ] && [ ! -f "$master_public_keyfile" ]; then elif [ ! -f "$master_private_keyfile" ] && [ ! -f "$master_public_keyfile" ]; then
echo "Both master private and public keys do not exist. Creating master keyfiles new pair." echo "Both master private and public keys do not exist. Creating master keyfiles new pair."
cd /root/.config/proxmox-backup/ && $expect /etc/s6-overlay/s6-rc.d/key_setup/client_master_key cd /root/.config/proxmox-backup/ && $expect /etc/s6-overlay/s6-rc.d/key_setup/client_master_key
elif [ ! -f "$master_private_keyfile" ] || [ ! -f "$master_public_keyfile" ]; then elif [ ! -f "$master_private_keyfile" ] || [ ! -f "$master_public_keyfile" ]; then
echo "One of the master keyfiles is missing. Error! User intervention required. Ensure correct files present, or remove both: \n" echo "One of the master keyfiles is missing. Error! User intervention required. Ensure correct files present, or remove both: \n"
echo "$master_private_keyfile \n" echo "$master_private_keyfile \n"
echo "$master_oublic_keyfile \n" echo "$master_oublic_keyfile \n"
echo "To allow for automatic key recreation." echo "To allow for automatic key recreation."
fi
fi fi

View File

@ -30,6 +30,11 @@ if [ -z "$PBS_PASSWORD" ]; then
exit 1 exit 1
fi fi
if [ -n "$UNENCRYPTED" ]; then
UNENCRYPTED="${UNENCRYPTED}"
export UNENCRYPTED
fi
HEALTHCHECKSURL="${HEALTHCHECKSHOSTNAME}/ping/${HEALTHCHECKSUUID}" HEALTHCHECKSURL="${HEALTHCHECKSHOSTNAME}/ping/${HEALTHCHECKSUUID}"
export HEALTHCHECKSURL="${HEALTHCHECKSURL}" export HEALTHCHECKSURL="${HEALTHCHECKSURL}"