fix: add Redis password authentication support in health check

The health check script was not using the REDIS_HOST_PASSWORD environment
variable when checking Redis connectivity, causing failures when Redis is
password-protected. Now properly detects and uses the password from .env
when available.

Also includes minor cleanup in backup.sh (formatting and redundant log removal).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
BeauTroll
2025-12-17 20:10:20 +01:00
parent dd27bdebb5
commit b693ed1364
2 changed files with 14 additions and 7 deletions

View File

@@ -233,7 +233,6 @@ log "INFO" "Génération du checksum SHA256..."
if cd "$BACKUP_DIR" && sha256sum "$BACKUP_NAME.tar.gz" >"$BACKUP_NAME.tar.gz.sha256"; then if cd "$BACKUP_DIR" && sha256sum "$BACKUP_NAME.tar.gz" >"$BACKUP_NAME.tar.gz.sha256"; then
cd "$PROJECT_ROOT" cd "$PROJECT_ROOT"
CHECKSUM=$(cut -d' ' -f1 "$BACKUP_DIR/$BACKUP_NAME.tar.gz.sha256") CHECKSUM=$(cut -d' ' -f1 "$BACKUP_DIR/$BACKUP_NAME.tar.gz.sha256")
log "INFO" "Checksum: $CHECKSUM"
else else
cd "$PROJECT_ROOT" cd "$PROJECT_ROOT"
log "WARN" "Impossible de générer le checksum" log "WARN" "Impossible de générer le checksum"

View File

@@ -152,11 +152,19 @@ echo ""
# 6. Vérifier Redis # 6. Vérifier Redis
echo "▶ Cache Redis:" echo "▶ Cache Redis:"
if [ -n "${REDIS_HOST_PASSWORD:-}" ]; then
if docker-compose exec -T redis redis-cli -a "$REDIS_HOST_PASSWORD" ping 2>/dev/null | grep -q "PONG"; then
check_ok "Redis répond (avec authentification)"
else
check_fail "Redis ne répond pas ou mot de passe incorrect"
fi
else
if docker-compose exec -T redis redis-cli ping 2>/dev/null | grep -q "PONG"; then if docker-compose exec -T redis redis-cli ping 2>/dev/null | grep -q "PONG"; then
check_ok "Redis répond" check_ok "Redis répond (sans authentification)"
else else
check_fail "Redis ne répond pas" check_fail "Redis ne répond pas"
fi fi
fi
echo "" echo ""