ssl dockercompose test config

This commit is contained in:
Yuri Astrakhan 2023-09-30 12:38:57 -04:00
parent d1fe026639
commit ae8e0709d7
3 changed files with 19 additions and 0 deletions

View File

@ -72,6 +72,7 @@ services:
- PGPASSWORD=postgres
volumes:
- ./tests/fixtures:/fixtures
- ./tests/fixtures/initdb-dc-ssl.sh:/docker-entrypoint-initdb.d/10_martin.sh
- ./tests/fixtures/initdb-dc.sh:/docker-entrypoint-initdb.d/20_martin.sh
db-legacy:

17
tests/fixtures/initdb-dc-ssl.sh vendored Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env sh
set -e
mv /var/lib/postgresql/data/pg_hba.conf /var/lib/postgresql/data/pg_hba.conf.bak
cat > /var/lib/postgresql/data/pg_hba.conf <<EOF
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
#local all all trust
# localhost connections
#host all all 127.0.0.1/32 trust
# external connections
hostssl all all all scram-sha-256
EOF

View File

@ -38,4 +38,5 @@ echo -e "\n\n\n"
echo "################################################################################################"
echo "Active pg_hba.conf configuration"
echo "################################################################################################"
psql -P pager=off -v ON_ERROR_STOP=1 -c "select pg_reload_conf();"
psql -P pager=off -v ON_ERROR_STOP=1 -c "select * from pg_hba_file_rules;"