defined /etc/postgresql/certs as the mountpoint to install SSL key and certificate

This commit is contained in:
Sameer Naik
2015-11-26 20:41:47 +05:30
parent 7eeda81f1e
commit 5f6024062f
3 changed files with 13 additions and 1 deletions
+1
View File
@@ -5,6 +5,7 @@
- `PSQL_TRUST_LOCALNET` config parameter renamed to `PG_TRUST_LOCALNET`
- `PSQL_MODE` config parameter renamed to `REPLICATION_MODE`
- `PSQL_SSLMODE` config parameter renamed to `REPLICATION_SSLMODE`
- defined `/etc/postgresql/certs` as the mountpoint to install SSL key and certificate
**9.4-2**
- added replication options
+2 -1
View File
@@ -5,7 +5,8 @@ ENV PG_VERSION=9.4 \
PG_USER=postgres \
PG_HOME=/var/lib/postgresql \
PG_RUNDIR=/run/postgresql \
PG_LOGDIR=/var/log/postgresql
PG_LOGDIR=/var/log/postgresql \
PG_CERTDIR=/etc/postgresql/certs
ENV PG_BINDIR=/usr/lib/postgresql/${PG_VERSION}/bin \
PG_DATADIR=${PG_HOME}/${PG_VERSION}/main
+10
View File
@@ -59,6 +59,15 @@ create_datadir() {
chown -R ${PG_USER}:${PG_USER} ${PG_HOME}
}
create_certdir() {
echo "Initializing certdir..."
mkdir -p ${PG_CERTDIR}
[[ -f ${PG_CERTDIR}/server.crt ]] && chmod 0644 ${PG_CERTDIR}/server.crt
[[ -f ${PG_CERTDIR}/server.key ]] && chmod 0640 ${PG_CERTDIR}/server.key
chmod 0755 ${PG_CERTDIR}
chown -R root:${PG_USER} ${PG_CERTDIR}
}
create_logdir() {
echo "Initializing logdir..."
mkdir -p ${PG_LOGDIR}
@@ -327,6 +336,7 @@ if [[ -z ${1} ]]; then
locale_gen
create_datadir
create_certdir
create_logdir
create_rundir