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

@ -26,4 +26,7 @@ PBS_FINGERPRINT=""
HEALTHCHECKSUUID="aa7b0de3-2c17-4fce-b051-388a5415e656"
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:
pbs-client:
image: aterfax/pbs-client
image: tmueller/pbs-client
container_name: pbs-client
hostname: pbs-client
restart: unless-stopped

View File

@ -26,25 +26,29 @@ master_public_keyfile="/root/.config/proxmox-backup/master-public.pem"
expect="/usr/bin/expect"
# 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."
if [ -n "$UNENCRYPTED" ]; then
echo "Encryption not activated not gonna create any Keys."
else
echo "Client encryption keyfile does not exist. Creating new client encryption keyfile."
$expect /etc/s6-overlay/s6-rc.d/key_setup/client_key
fi
# 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."
$expect /etc/s6-overlay/s6-rc.d/key_setup/client_key
fi
# Check if both Master keyfiles exist and do stuff.
if [ -f "$master_private_keyfile" ] && [ -f "$master_public_keyfile" ]; then
echo "Both master private and public keys exist. Skipping client Master keyfiles creation."
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."
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
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_oublic_keyfile \n"
echo "To allow for automatic key recreation."
# Check if both Master keyfiles exist and do stuff.
if [ -f "$master_private_keyfile" ] && [ -f "$master_public_keyfile" ]; then
echo "Both master private and public keys exist. Skipping client Master keyfiles creation."
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."
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
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_oublic_keyfile \n"
echo "To allow for automatic key recreation."
fi
fi

View File

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