diff --git a/backup.sh b/backup.sh index 974c7d1..6e7f8ea 100755 --- a/backup.sh +++ b/backup.sh @@ -11,6 +11,7 @@ backup_path="${BACKUP_DEST:?BACKUP_DEST not set}" # shellcheck disable=SC2153 ssh_key_file="${SSH_KEY_FILE}" s3_key_file="${AWS_SECRET_ACCESS_KEY_FILE}" +https_password_file="${HTTPS_PASSWORD_FILE}" restic_repo= restic_extra_options= @@ -39,8 +40,14 @@ if [ -n "$s3_key_file" ] && [ -f "$s3_key_file" ] && [ -n "$AWS_ACCESS_KEY_ID" ] restic_repo="s3:$restic_host:/$server_name" 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" +fi + if [ -z "$restic_repo" ]; then - echo "you must configure either SFTP or S3 storage, see README" + echo "you must configure either SFTP, S3, or HTTPS storage, see README" exit 1 fi