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:
@@ -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"
|
||||||
|
|||||||
@@ -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 ""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user