diff options
Diffstat (limited to 'experiment/scripts/auditor.sh')
-rw-r--r-- | experiment/scripts/auditor.sh | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/experiment/scripts/auditor.sh b/experiment/scripts/auditor.sh index d602214..32406d1 100644 --- a/experiment/scripts/auditor.sh +++ b/experiment/scripts/auditor.sh @@ -44,24 +44,14 @@ psql postgres -tAc "SELECT 1 FROM pg_roles WHERE rolname='auditor-ingress'" | \ psql postgres -tAc "SELECT 1 FROM pg_roles WHERE rolname='auditor'" | \ grep -q 1 || \ createuser auditor -psql postgres -tAc "SELECT 1 FROM pg_roles WHERE rolname='sync'" | \ - grep -q 1 || \ - createuser sync createdb -O auditor-ingress "exchange-ingress" createdb -O auditor "auditor" EOF su auditor-ingress << EOF -psql -d exchange-ingress -U auditor-ingress -tAc 'GRANT ALL ON ALL TABLES IN SCHEMA public TO sync;' +psql -d exchange-ingress -U auditor-ingress -tAc 'GRANT ALL ON ALL TABLES IN SCHEMA public TO auditor;' EOF - - # Only needed if we want to repicate this database again - # - #createdb -O sync exchange-production - #createdb -O auditor-wire libeufin - #psql -d exchange-prodution -U sync -tAc 'GRANT SELECT ON ALL TABLE IN SCHEMA public TO auditor;' - #psql -d libeufin -U auditor-wire -tAc 'GRANT SELECT ON ALL TABLE IN SCHEMA public TO auditor;' } function setup_exchange_replication() { @@ -81,7 +71,9 @@ function setup_exchange_replication() { DB_USER=egress wait_for_db su postgres << EOF - psql -d exchange-ingress -tAc "CREATE SUBSCRIPTION IF NOT EXISTS ${NODE_NAME} CONNECTION 'postgresql://egress:${DB_PASSWORD}@${DB_HOSTS}/${DB_NAME}' PUBLICATION exchange;" + psql -d exchange-ingress -tAc "ALTER SUBSCRIPTION ${NODE_NAME} DISABLE;" + psql -d exchange-ingress -tAc "ALTER SUBSCRIPTION ${NODE_NAME} SET (slot_name=NONE);" + psql -d exchange-ingress -tAc "CREATE SUBSCRIPTION ${NODE_NAME} CONNECTION 'postgresql://egress:${DB_PASSWORD}@${DB_HOSTS}/${DB_NAME}' PUBLICATION exchange;" || true EOF } |