bugs fixed
This commit is contained in:
@@ -267,12 +267,24 @@ if [ "${DB_HOST}" = "localhost" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Force trust authentication for localhost connections
|
# Force trust authentication for localhost connections
|
||||||
# This fixes the "password authentication failed" error
|
# Check standard Ubuntu location first, then data directory
|
||||||
if [ -d "${PGDATA}" ]; then
|
PG_CONF_FILE="/etc/postgresql/${PG_VERSION:-16}/main/pg_hba.conf"
|
||||||
echo "local all onlyoffice trust" > "${PGDATA}/pg_hba.conf"
|
if [ ! -f "$PG_CONF_FILE" ]; then
|
||||||
echo "local all all peer" >> "${PGDATA}/pg_hba.conf"
|
PG_CONF_FILE="${PGDATA}/pg_hba.conf"
|
||||||
echo "host all all 127.0.0.1/32 trust" >> "${PGDATA}/pg_hba.conf"
|
fi
|
||||||
echo "host all all ::1/128 trust" >> "${PGDATA}/pg_hba.conf"
|
|
||||||
|
if [ -f "$PG_CONF_FILE" ]; then
|
||||||
|
echo "Found pg_hba.conf at: $PG_CONF_FILE"
|
||||||
|
# Backup original
|
||||||
|
cp "$PG_CONF_FILE" "${PG_CONF_FILE}.bak"
|
||||||
|
# Overwrite with trust settings
|
||||||
|
echo "local all onlyoffice trust" > "$PG_CONF_FILE"
|
||||||
|
echo "local all all peer" >> "$PG_CONF_FILE"
|
||||||
|
echo "host all all 127.0.0.1/32 trust" >> "$PG_CONF_FILE"
|
||||||
|
echo "host all all ::1/128 trust" >> "$PG_CONF_FILE"
|
||||||
|
chown postgres:postgres "$PG_CONF_FILE"
|
||||||
|
else
|
||||||
|
echo "WARNING: pg_hba.conf not found!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LOCAL_SERVICES+=("postgresql")
|
LOCAL_SERVICES+=("postgresql")
|
||||||
|
|||||||
Reference in New Issue
Block a user