Skip to content

Commit

Permalink
Merge branch 'fix-trustlocalnet'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sameer Naik committed Aug 7, 2016
2 parents e06fe47 + 0063f8b commit ece0a42
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions runtime/functions
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,14 @@ initialize_database() {
set_postgresql_param "log_directory" "${PG_LOGDIR}"
set_postgresql_param "log_filename" "postgresql-${PG_VERSION}-main.log"

# allow remote connections to postgresql database
set_hba_param "host all all 0.0.0.0/0 md5"
}

trust_localnet() {
# trust connections from local network
if [[ ${PG_TRUST_LOCALNET} == true ]]; then
echo "Trusting connections from the local network..."
set_hba_param "host all all samenet trust"
fi

# allow remote connections to postgresql database
set_hba_param "host all all 0.0.0.0/0 md5"
}

set_resolvconf_perms() {
Expand Down Expand Up @@ -374,7 +373,6 @@ configure_postgresql() {
initialize_database
configure_recovery
configure_ssl
trust_localnet

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

0 comments on commit ece0a42

Please sign in to comment.