debug: add S3 network diagnostics to start.sh

This commit is contained in:
Erik
2026-03-09 19:59:48 -03:00
parent fccfe85604
commit 4f27f501b9
5 changed files with 25 additions and 245 deletions

View File

@@ -50,5 +50,30 @@ else
echo "⚠️ DATABASE_URL não encontrada. O site pode falhar."
fi
# --- DIAGNÓSTICO DE REDE (S3) ---
if [ ! -z "$S3_ENDPOINT" ]; then
echo "📡 Testando conexão S3 em $S3_ENDPOINT na porta ${S3_PORT:-9000}..."
node -e "
const net = require('net');
const s3Host = '$S3_ENDPOINT';
const s3Port = parseInt('${S3_PORT:-9000}');
const client = net.createConnection({ host: s3Host, port: s3Port, timeout: 5000 }, () => {
console.log('✅ REDE S3 OK: A porta ' + s3Port + ' está aberta!');
process.exit(0);
});
client.on('error', (err) => {
console.log('❌ REDE S3 ERRO: ' + err.message);
process.exit(1);
});
client.on('timeout', () => {
console.log('❌ REDE S3 TIMEOUT: O host ' + s3Host + ' não respondeu.');
process.exit(1);
});
" || echo "⚠️ Aviso: Não foi possível confirmar o S3, mas continuaremos..."
fi
echo "🚀 Iniciando Octto Engenharia..."
exec node server.js