Files
minio-storage/verify-minio.sh
Frank John Begornia adc979ca69
Some checks failed
Deploy MinIO Production / deploy (push) Successful in 31s
Backup MinIO Buckets / backup (push) Failing after 4s
Add MinIO verification script for production status checks
2026-01-06 09:52:48 +08:00

59 lines
1.9 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Quick MinIO verification script
echo "=========================================="
echo "MinIO Production Status Check"
echo "=========================================="
echo ""
# Get server details from secrets/env
read -p "Enter your server user@host (e.g., ubuntu@123.45.67.89): " SERVER
echo ""
echo "Checking MinIO container..."
ssh $SERVER << 'REMOTE'
echo "1⃣ Container Status:"
docker ps | grep crew-minio-prod
echo ""
echo "2⃣ Container Health:"
docker inspect crew-minio-prod --format='{{.State.Health.Status}}'
echo ""
echo "3⃣ Networks:"
docker inspect crew-minio-prod --format='{{range $k, $v := .NetworkSettings.Networks}}{{$k}} {{end}}'
echo ""
echo "4⃣ Environment Variables:"
docker exec crew-minio-prod env | grep MINIO_ | grep -v PASSWORD | grep -v SECRET
echo ""
echo "5⃣ Internal Health Check:"
docker exec crew-minio-prod curl -sf http://localhost:9000/minio/health/live && echo "✅ Healthy" || echo "❌ Unhealthy"
echo ""
echo "6⃣ Check if buckets exist:"
docker exec crew-minio-prod sh -c "
if ! command -v mc &> /dev/null; then
echo '⚠️ MinIO client not installed yet. Run setup-buckets.sh'
else
mc alias set local http://localhost:9000 \$MINIO_ROOT_USER \$MINIO_ROOT_PASSWORD 2>/dev/null
mc ls local/ 2>/dev/null || echo '⚠️ No buckets found. Run setup-buckets.sh'
fi
"
echo ""
echo "7⃣ Traefik Routes (if configured):"
docker inspect crew-minio-prod --format='{{range $k, $v := .Config.Labels}}{{if eq $k "traefik.http.routers.minio-api.rule"}}API: {{$v}}{{end}}{{if eq $k "traefik.http.routers.minio-console.rule"}}Console: {{$v}}{{end}}{{end}}'
echo ""
echo "=========================================="
echo "Next Steps:"
echo "=========================================="
echo "1. Run setup-buckets.sh to create application buckets"
echo "2. Test console access (via SSH tunnel or domain)"
echo "3. Configure apps to use MinIO"
echo "4. Migrate images from old server"
REMOTE