diff options
Diffstat (limited to 'public/fs/home/pgsql/data')
-rwxr-xr-x | public/fs/home/pgsql/data/pg_hba-conf.sh | 15 | ||||
-rw-r--r-- | public/fs/home/pgsql/data/pg_hba.conf.in (renamed from public/fs/home/pgsql/data/pg_hba.conf) | 2 | ||||
-rwxr-xr-x | public/fs/home/pgsql/data/postgresql-conf.sh | 15 | ||||
-rw-r--r-- | public/fs/home/pgsql/data/postgresql.conf.in (renamed from public/fs/home/pgsql/data/postgresql.conf) | 2 |
4 files changed, 32 insertions, 2 deletions
diff --git a/public/fs/home/pgsql/data/pg_hba-conf.sh b/public/fs/home/pgsql/data/pg_hba-conf.sh new file mode 100755 index 0000000..a64b161 --- /dev/null +++ b/public/fs/home/pgsql/data/pg_hba-conf.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +set -eu + +sitezone="$1" + +cfg_script="$0" +cfg_srcdir=$(cd -- "${cfg_script%/*}/" ; pwd -P) + +source /root/config/private/config/server.ports +source /root/config/private/config/hostinfo/${sitezone} + +sed -e 's/@vpn_net4@/'${vpn_net4}'/g' \ + -e 's/@vpn_ipv4@/'${vpn_ipv4}'/g' \ + "${cfg_srcdir}/pg_hba.conf.in" diff --git a/public/fs/home/pgsql/data/pg_hba.conf b/public/fs/home/pgsql/data/pg_hba.conf.in index 6abd582..07fef10 100644 --- a/public/fs/home/pgsql/data/pg_hba.conf +++ b/public/fs/home/pgsql/data/pg_hba.conf.in @@ -8,7 +8,7 @@ local all all peer host all all 127.0.0.1/32 scram-sha-256 -host all all 10.8.0.0/24 scram-sha-256 +host all all @vpn_net4@/24 scram-sha-256 host all all ::1/128 scram-sha-256 local replication all peer diff --git a/public/fs/home/pgsql/data/postgresql-conf.sh b/public/fs/home/pgsql/data/postgresql-conf.sh new file mode 100755 index 0000000..2a6a6e1 --- /dev/null +++ b/public/fs/home/pgsql/data/postgresql-conf.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +set -eu + +sitezone="$1" + +cfg_script="$0" +cfg_srcdir=$(cd -- "${cfg_script%/*}/" ; pwd -P) + +source /root/config/private/config/server.ports +source /root/config/private/config/hostinfo/${sitezone} + +sed -e 's/@vpn_net4@/'${vpn_net4}'/g' \ + -e 's/@vpn_ipv4@/'${vpn_ipv4}'/g' \ + "${cfg_srcdir}/postgresql.conf.in" diff --git a/public/fs/home/pgsql/data/postgresql.conf b/public/fs/home/pgsql/data/postgresql.conf.in index 45d0eab..42a1c26 100644 --- a/public/fs/home/pgsql/data/postgresql.conf +++ b/public/fs/home/pgsql/data/postgresql.conf.in @@ -1,4 +1,4 @@ -listen_addresses = 'localhost, 10.8.0.1' +listen_addresses = 'localhost, @vpn_ipv4@' port = 5432 max_connections = 128 superuser_reserved_connections = 16 |