diff --git a/run-document-server.sh b/run-document-server.sh index 8736e9c75..4f083e08d 100644 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -265,6 +265,16 @@ if [ "${DB_HOST}" = "localhost" ]; then create_postgresql_cluster PG_NEW_CLUSTER=true fi + + # Force trust authentication for localhost connections + # This fixes the "password authentication failed" error + if [ -d "${PGDATA}" ]; then + echo "local all onlyoffice trust" > "${PGDATA}/pg_hba.conf" + echo "local all all peer" >> "${PGDATA}/pg_hba.conf" + echo "host all all 127.0.0.1/32 trust" >> "${PGDATA}/pg_hba.conf" + echo "host all all ::1/128 trust" >> "${PGDATA}/pg_hba.conf" + fi + LOCAL_SERVICES+=("postgresql") fi