[Vagrant] Allow remote postgres connections

This makes it easiliy possible to use a local client to take a look
into the database
This commit is contained in:
Earlopain 2021-09-25 10:38:09 +02:00
parent e595e1de99
commit 69869a2d62
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897
2 changed files with 11 additions and 0 deletions

View File

@ -21,6 +21,10 @@ By the time you get back the install will surely have completed.<sup>1</sup>
<sub><sup>1</sup> If the install did not finish by the time an activity is complete please select another activity to avoid crippling boredom.</sub>
#### Development Database
The postgres server accepts outside connections which you can use to connect with a local client. Use `192.168.64.78:5432` to connect to a database named `danbooru2` with the user `danbooru`. Leave the password blank, anything will work.
#### VirtualBox Troubleshooting
In case the VM doesn't start with the error `VT-x not available` and the error description `WHvCapabilityCodeHypervisorPresent is FALSE!` the the following solution should resolve the issue:

View File

@ -88,7 +88,14 @@ systemctl enable elasticsearch 2>/dev/null
service elasticsearch start
script_log "Setting up postgres..."
# allow connections from the host machine
if ! grep -q "192" "/etc/postgresql/12/main/pg_hba.conf"; then
echo "host danbooru2,danbooru2_test danbooru 192.168.64.1/32 trust" >> /etc/postgresql/12/main/pg_hba.conf
fi
# do not require passwords for authentication
sed -i -e 's/md5/trust/' /etc/postgresql/12/main/pg_hba.conf
# listen for outside connections
echo "listen_addresses = '*'" > /etc/postgresql/12/main/conf.d/listen_addresses.conf
if [ ! -f /usr/lib/postgresql/12/lib/test_parser.so ]; then
script_log "Building test_parser..."