Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Security (pg_hba.conf):


No Format
sed -i '/host all all all md5/s/^/#/g' /opt/postgresql/data/pg_hba.conf
cat << 'EOF' >>/opt/postgresql/data/pg_hba.conf
host    all         all         172.17.0.0/16          md5 
EOF
cat /opt/postgresql/data/pg_hba.conf
HOSTIP="$(ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')"
cat << EOF >>/opt/postgresql/data/pg_hba.conf
host    all         all         $HOSTIP/32          md5 
EOF
cat /opt/postgresql/data/pg_hba.conf
No Format
host all all all md5 #default
host    all         all         172.17.0.0/16          md5 #Docker Subnet
host    all         all         $HOSTIP/32          md5 #Local IPv4

...