diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-02-27 00:03:44 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-02-27 00:03:44 +0800 |
commit | d1e77f7f45280c04cc8a64ac840fe1923a6c705d (patch) | |
tree | cb02a5a44041112f8eb426326624aa15948f223e | |
parent | 23fd6e8fc96065f3229c42d21c83e9ca1309aa6c (diff) | |
download | crupest-d1e77f7f45280c04cc8a64ac840fe1923a6c705d.tar.gz crupest-d1e77f7f45280c04cc8a64ac840fe1923a6c705d.tar.bz2 crupest-d1e77f7f45280c04cc8a64ac840fe1923a6c705d.zip |
fix(backup): no docker secret.
-rw-r--r-- | services/docker/auto-backup/Dockerfile | 2 | ||||
-rwxr-xr-x | 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." |