Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaUnisikhin committed Mar 18, 2024
1 parent 110578f commit 2700953
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
9 changes: 8 additions & 1 deletion docker/bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 || {
Expand Down
7 changes: 4 additions & 3 deletions docker/odyssey.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker/xproto/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

0 comments on commit 2700953

Please sign in to comment.