chore: allow vagrant postgresql remote access
This commit is contained in:
parent
50877a033b
commit
1a9fa6b559
2 changed files with 18 additions and 0 deletions
13
installer/vagrant/post-install.sh
Executable file
13
installer/vagrant/post-install.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# append_if_missing <line> <file>
|
||||
append_if_missing() {
|
||||
grep -xqF "$1" "$2" || echo "$1" >> "$2"
|
||||
}
|
||||
|
||||
# Setup postgresql remote access
|
||||
append_if_missing "listen_addresses = '*'" /etc/postgresql/*/main/postgresql.conf
|
||||
append_if_missing "host all all 0.0.0.0/0 md5" /etc/postgresql/*/main/pg_hba.conf
|
||||
append_if_missing "host all all ::/0 md5" /etc/postgresql/*/main/pg_hba.conf
|
||||
|
||||
systemctl restart postgresql.service
|
Loading…
Add table
Add a link
Reference in a new issue