fix(deploy): stop when backup permission protection fails

This commit is contained in:
cesnimda
2026-11-11 18:17:21 +01:00
parent e1c8e84502
commit 1c8761b188
2 changed files with 68 additions and 2 deletions
+5 -2
View File
@@ -407,8 +407,11 @@ verify_backup_file_shape() {
report_backup() {
local target="$1" size
if ! chmod 600 "$target" 2>/dev/null; then
docker run --rm -v "$BACKUP_DIR":/backup -e BACKUP_FILE="$(basename "$target")" \
alpine:3 sh -c 'chmod 600 "/backup/$BACKUP_FILE"'
if ! docker run --rm -v "$BACKUP_DIR":/backup -e BACKUP_FILE="$(basename "$target")" \
alpine:3 sh -c 'chmod 600 "/backup/$BACKUP_FILE"'; then
echo "Could not restrict backup permissions for ${target}. Aborting deploy."
return 1
fi
fi
size="$(du -h "$target" | cut -f1)"
echo "Backup verified: ${target} (${size})"