Files
seguidorDeLotes/nuxt4/server/database/00_configure_auth.sh
josedario87 a14ce46ab3
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m3s
Agregar configuración automática de autenticación PostgreSQL
- 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
2025-11-21 19:33:46 -06:00

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)"