PSQL_TRUST_LOCALNET config parameter renamed to PG_TRUST_LOCALNET

This commit is contained in:
Sameer Naik
2015-11-26 20:30:55 +05:30
parent c8e9dec549
commit de5295ffa7
3 changed files with 9 additions and 6 deletions
+1
View File
@@ -2,6 +2,7 @@
**latest**
- complete rewrite
- `PSQL_TRUST_LOCALNET` config parameter renamed to `PG_TRUST_LOCALNET`
**9.4-2**
- added replication options
+4 -4
View File
@@ -150,13 +150,13 @@ will create a user *dbuser* with the password *dbpass*. It will also create a da
The `DB_LOCALE` environment variable can be used to configure the locale used for database creation. Its default value is set to C.
The `PSQL_TRUST_LOCALNET` environment variable can be used to configure postgres to trust connections on the same network. This is handy for other containers to connect without authentication. To enable this behavior, set `PSQL_TRUST_LOCALNET` to `true`.
The `PG_TRUST_LOCALNET` environment variable can be used to configure postgres to trust connections on the same network. This is handy for other containers to connect without authentication. To enable this behavior, set `PG_TRUST_LOCALNET` to `true`.
For example,
```bash
docker run --name postgresql -d \
-e 'PSQL_TRUST_LOCALNET=true' \
-e 'PG_TRUST_LOCALNET=true' \
sameersbn/postgresql:9.4-8
```
@@ -176,7 +176,7 @@ Create a master instance
```bash
docker run --name='psql-master' -it --rm \
-e 'PSQL_MODE=master' -e 'PSQL_TRUST_LOCALNET=true' \
-e 'PSQL_MODE=master' -e 'PG_TRUST_LOCALNET=true' \
-e 'REPLICATION_USER=replicator' -e 'REPLICATION_PASS=replicatorpass' \
-e 'DB_NAME=dbname' -e 'DB_USER=dbuser' -e 'DB_PASS=dbpass' \
sameersbn/postgresql:9.4-8
@@ -187,7 +187,7 @@ Create a streaming replication instance
```bash
docker run --name='psql-slave' -it --rm \
--link psql-master:psql-master \
-e 'PSQL_MODE=slave' -e 'PSQL_TRUST_LOCALNET=true' \
-e 'PSQL_MODE=slave' -e 'PG_TRUST_LOCALNET=true' \
-e 'REPLICATION_HOST=psql-master' -e 'REPLICATION_PORT=5432' \
-e 'REPLICATION_USER=replicator' -e 'REPLICATION_PASS=replicatorpass' \
sameersbn/postgresql:9.4-8
+4 -2
View File
@@ -3,7 +3,9 @@ set -e
PSQL_MODE=${PSQL_MODE:-}
PSQL_SSLMODE=${PSQL_SSLMODE:-}
PSQL_TRUST_LOCALNET=${PSQL_TRUST_LOCALNET:-false}
PG_TRUST_LOCALNET=${PG_TRUST_LOCALNET:-$PSQL_TRUST_LOCALNET} # backward compatibility
PG_TRUST_LOCALNET=${PG_TRUST_LOCALNET:-false}
REPLICATION_USER=${REPLICATION_USER:-}
REPLICATION_PASS=${REPLICATION_PASS:-}
@@ -229,7 +231,7 @@ initialize_database() {
}
trust_localnet() {
if [[ ${PSQL_TRUST_LOCALNET} == true ]]; then
if [[ ${PG_TRUST_LOCALNET} == true ]]; then
echo "Trusting connections from the local network..."
set_hba_param "host all all samenet trust"
fi