Skip to content

Commit ece0a42

Browse files
author
Sameer Naik
committed
Merge branch 'fix-trustlocalnet'
2 parents e06fe47 + 0063f8b commit ece0a42

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

runtime/functions

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,15 +247,14 @@ initialize_database() {
247247
set_postgresql_param "log_directory" "${PG_LOGDIR}"
248248
set_postgresql_param "log_filename" "postgresql-${PG_VERSION}-main.log"
249249

250-
# allow remote connections to postgresql database
251-
set_hba_param "host all all 0.0.0.0/0 md5"
252-
}
253-
254-
trust_localnet() {
250+
# trust connections from local network
255251
if [[ ${PG_TRUST_LOCALNET} == true ]]; then
256252
echo "Trusting connections from the local network..."
257253
set_hba_param "host all all samenet trust"
258254
fi
255+
256+
# allow remote connections to postgresql database
257+
set_hba_param "host all all 0.0.0.0/0 md5"
259258
}
260259

261260
set_resolvconf_perms() {
@@ -374,7 +373,6 @@ configure_postgresql() {
374373
initialize_database
375374
configure_recovery
376375
configure_ssl
377-
trust_localnet
378376

379377
# start postgres server internally for the creation of users and databases
380378
rm -rf ${PG_DATADIR}/postmaster.pid

0 commit comments

Comments
 (0)