From 2700953922c0aec1e799b7b7925bf4f113825eeb Mon Sep 17 00:00:00 2001 From: NikitaUnisikhin Date: Mon, 18 Mar 2024 07:27:02 +0000 Subject: [PATCH] fix --- docker/bin/setup | 9 ++++++++- docker/odyssey.conf | 7 ++++--- docker/xproto/test.sh | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/docker/bin/setup b/docker/bin/setup index ceb3b1ff5..2ef3993b1 100755 --- a/docker/bin/setup +++ b/docker/bin/setup @@ -49,7 +49,7 @@ sudo -u postgres /usr/bin/pg_basebackup -D /var/lib/postgresql/14/repl -R -h loc sudo -u postgres /usr/lib/postgresql/14/bin/pg_ctl -D /var/lib/postgresql/14/repl/ -o '-p 5433' start # Create databases -for database_name in db scram_db ldap_db auth_query_db db1 hba_db tsa_db addr_db xproto_db; do +for database_name in db scram_db ldap_db auth_query_db db1 hba_db tsa_db addr_db xproto_db 'spqr-console'; do sudo -u postgres createdb $database_name >> "$SETUP_LOG" 2>&1 || { echo "ERROR: 'createdb $database_name' failed, examine the log" cat "$SETUP_LOG" @@ -178,6 +178,13 @@ psql -h localhost -p 5432 -U postgres -c "create user xproto" -d xproto_db >> $S exit 1 } +psql -h localhost -p 5432 -U postgres -c "create user 'spqr-console'" -d 'spqr-console' >> $SETUP_LOG 2>&1 || { + echo "ERROR: users creation failed, examine the log" + cat "$SETUP_LOG" + cat "$PG_LOG" + exit 1 +} + # Grant access for ldap_storage_credentials psql -h localhost -p 5432 -U postgres -c "GRANT ALL ON DATABASE ldap_db1 TO ldap_readonly" -d postgres >> $SETUP_LOG 2>&1 || { diff --git a/docker/odyssey.conf b/docker/odyssey.conf index 45a8d5a5a..f3660a246 100644 --- a/docker/odyssey.conf +++ b/docker/odyssey.conf @@ -25,12 +25,13 @@ unix_socket_dir "/tmp" unix_socket_mode "0644" log_format "%p %t %l [%i %s] (%c) %m\n" -log_debug no +log_debug yes log_config yes -log_session no -log_query no +log_session yes +log_query yes log_stats yes daemonize yes +log_file "/xproto/logs.txt" locks_dir "/tmp/odyssey" graceful_die_on_errors yes diff --git a/docker/xproto/test.sh b/docker/xproto/test.sh index 32962f314..9de9c67aa 100755 --- a/docker/xproto/test.sh +++ b/docker/xproto/test.sh @@ -2,4 +2,4 @@ git clone https://github.com/pg-sharding/spqr.git /xproto/spqr cp /xproto/spqr/test/xproto/proto_test.go /xproto/proto_test.go rm -rf /xproto/spqr docker build -t xproto-tests /xproto -docker run -e POSTGRES_HOST=localhost -e POSTGRES_PORT=5432 -e POSTGRES_DB=xproto_db -e POSTGRES_USER=xproto --network=host xproto-tests \ No newline at end of file +docker run -e POSTGRES_HOST=odyssey -e POSTGRES_PORT=6432 -e POSTGRES_DB=xproto_db -e POSTGRES_USER=xproto --network=odyssey_od_net xproto-tests \ No newline at end of file