All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m3s
- Script 00_configure_auth.sh configura pg_hba.conf para usar md5 - Se ejecuta automáticamente en inicializaciones de BD - Soluciona permanentemente problemas de autenticación con driver pg de Node.js
16 lines
484 B
Bash
Executable File
16 lines
484 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
echo "Configurando autenticación de PostgreSQL..."
|
|
|
|
# Eliminar configuración scram-sha-256 y agregar md5
|
|
# Esto asegura que las conexiones remotas funcionen correctamente
|
|
sed -i '/scram-sha-256/d' "$PGDATA/pg_hba.conf"
|
|
|
|
# Agregar configuración para conexiones md5 si no existe
|
|
if ! grep -q "host all all all md5" "$PGDATA/pg_hba.conf"; then
|
|
echo "host all all all md5" >> "$PGDATA/pg_hba.conf"
|
|
fi
|
|
|
|
echo "✓ Configuración de autenticación aplicada (md5)"
|