From 83a3d82ea5f295eab78b380c393405de47b93f25 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Tue, 19 Sep 2023 15:45:37 +0100 Subject: [PATCH] More HTTPS fixes --- .env.sample | 1 + backup.sh | 7 ++++--- compose.https.yml | 5 ++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.env.sample b/.env.sample index b9047f7..d8d915e 100644 --- a/.env.sample +++ b/.env.sample @@ -26,3 +26,4 @@ REMOVE_BACKUP_VOLUME_AFTER_UPLOAD=1 # HTTPS storage #SECRET_HTTPS_PASSWORD_VERSION=v1 #COMPOSE_FILE="$COMPOSE_FILE:compose.https.yml" +#RESTIC_USER= diff --git a/backup.sh b/backup.sh index 6e7f8ea..0afb0d7 100755 --- a/backup.sh +++ b/backup.sh @@ -41,9 +41,10 @@ if [ -n "$s3_key_file" ] && [ -f "$s3_key_file" ] && [ -n "$AWS_ACCESS_KEY_ID" ] fi if [ -n "$https_password_file" ] && [ -f "$https_password_file" ]; then - RESTIC_PASSWORD="$(cat "${https_password_file}")" - export RESTIC_PASSWORD - restic_repo="rest:$restic_host" + HTTPS_PASSWORD="$(cat "${https_password_file}")" + export HTTPS_PASSWORD + restic_user="${RESTIC_USER:?RESTIC_USER not set}" + restic_repo="rest:https://$restic_user:$HTTPS_PASSWORD@$restic_host" fi if [ -z "$restic_repo" ]; then diff --git a/compose.https.yml b/compose.https.yml index 2c7bb84..f8cfe20 100644 --- a/compose.https.yml +++ b/compose.https.yml @@ -3,9 +3,8 @@ version: "3.8" services: app: environment: - - SSH_KEY_FILE=/run/secrets/https_password - - SSH_HOST_KEY - - SSH_HOST_KEY_DISABLE + - HTTPS_PASSWORD_FILE=/run/secrets/https_password + - RESTIC_USER secrets: - source: https_password mode: 0400