From d1e77f7f45280c04cc8a64ac840fe1923a6c705d Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Thu, 27 Feb 2025 00:03:44 +0800 Subject: fix(backup): no docker secret. --- services/docker/auto-backup/Dockerfile | 2 +- services/docker/auto-backup/daemon.bash | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/services/docker/auto-backup/Dockerfile b/services/docker/auto-backup/Dockerfile index 6736077..f83736e 100644 --- a/services/docker/auto-backup/Dockerfile +++ b/services/docker/auto-backup/Dockerfile @@ -1,6 +1,6 @@ FROM debian RUN apt-get update && apt-get install -y \ - tini ca-certificates coreutils bash tar zstd \ + tini ca-certificates coreutils tar zstd \ && rm -rf /var/lib/apt/lists/* ENV CRUPEST_AUTO_BACKUP_INIT_DELAY= diff --git a/services/docker/auto-backup/daemon.bash b/services/docker/auto-backup/daemon.bash index 0c6beec..681dc65 100755 --- a/services/docker/auto-backup/daemon.bash +++ b/services/docker/auto-backup/daemon.bash @@ -15,26 +15,14 @@ success() { echo -e "\033[32mSuccess: " "$@" "\033[0m" } -# Check I'm root. -if [[ $EUID -ne 0 ]]; then - die "This script must be run as root" -fi - -if [[ ! -f /run/secrets/auto-backup ]]; then - die "/run/secrets/auto-backup not found, please use docker secrets to set it." -fi - if [[ -z "$CRUPEST_AUTO_BACKUP_INTERVAL" ]]; then die "Backup interval not set, please set it!" fi -# shellcheck source=/dev/null -. /run/secrets/auto-backup - note "Checking secrets..." [[ -n "$CRUPEST_AUTO_BACKUP_COS_ENDPOINT" ]] || die "COS endpoint not set!" [[ -n "$CRUPEST_AUTO_BACKUP_COS_BUCKET" ]] || die "COS bucket not set!" -[[ -n "$CRUPEST_AUTO_BACKUP_COS_SECRET_ID" ]] || die "COS secret ID not set!" +[[ -n "$CRUPEST_AUTO_BACKUP_COS_SECRET_ID" ]] || die "COS secret ID not set!" [[ -n "$CRUPEST_AUTO_BACKUP_COS_SECRET_KEY" ]] || die "COS secret key not set!" success "Secrets check passed." -- cgit v1.2.3