[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-sandcastle-ng] 37/39: sandcastle: use dbconfig helpers for libeuf
From: |
gnunet |
Subject: |
[taler-sandcastle-ng] 37/39: sandcastle: use dbconfig helpers for libeufin/exchange/merchant |
Date: |
Thu, 11 Jan 2024 14:00:10 +0100 |
This is an automated email from the git hooks/post-receive script.
devan-carpenter pushed a commit to branch master
in repository sandcastle-ng.
commit b7dcb2c5fb40b85824934ab15c51f416c53161f9
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Jan 10 20:55:54 2024 +0100
sandcastle: use dbconfig helpers for libeufin/exchange/merchant
---
scripts/demo/setup-sandcastle.sh | 38 +++++---------------------------------
1 file changed, 5 insertions(+), 33 deletions(-)
diff --git a/scripts/demo/setup-sandcastle.sh b/scripts/demo/setup-sandcastle.sh
index 1b87f94..430df2a 100755
--- a/scripts/demo/setup-sandcastle.sh
+++ b/scripts/demo/setup-sandcastle.sh
@@ -174,12 +174,7 @@ systemctl start postgresql.service
# Set up bank
-# FIXME: user libeufin-dbconf instead of manual setup
-
BANK_DB=libeufinbank
-# Use "|| true" to continue if these already exist.
-sudo -i -u postgres createuser -d libeufin-bank || true
-sudo -i -u postgres createdb -O libeufin-bank $BANK_DB || true
cat <<EOF >/etc/libeufin/libeufin-bank.conf
[libeufin-bankdb-postgres]
@@ -220,7 +215,7 @@ cat <<EOF >/etc/libeufin/settings.json
}
EOF
-sudo -i -u libeufin-bank libeufin-bank dbinit
+libeufin-dbconfig
systemctl enable --now libeufin-bank.service
@@ -282,12 +277,6 @@ sudo -i -u libeufin-bank libeufin-bank passwd admin sandbox
MASTER_PUBLIC_KEY=$(sudo -i -u taler-exchange-offline taler-exchange-offline
-LDEBUG setup)
EXCHANGE_DB=talerexchange
-# Use "|| true" to continue if these already exist.
-sudo -i -u postgres createuser -d taler-exchange-httpd || true
-sudo -i -u postgres createuser taler-exchange-wire || true
-sudo -i -u postgres createuser taler-exchange-closer || true
-sudo -i -u postgres createuser taler-exchange-aggregator || true
-sudo -i -u postgres createdb -O taler-exchange-httpd $EXCHANGE_DB || true
# Generate /etc/taler/conf.d/setup.conf
cat <<EOF > /etc/taler/conf.d/setup.conf
@@ -332,6 +321,7 @@ WIRE_GATEWAY_AUTH_METHOD = basic
USERNAME = exchange
PASSWORD = ${EXCHANGE_BANK_PASSWORD}
EOF
+
chmod 400 /etc/taler/secrets/exchange-accountcredentials-default.secret.conf
chown taler-exchange-wire:taler-exchange-db
/etc/taler/secrets/exchange-accountcredentials-default.secret.conf
@@ -345,23 +335,7 @@ if [[ ! -e /etc/taler/conf.d/$CURRENCY-coins.conf ]]; then
fi
echo "Initializing exchange database"
-sudo -u taler-exchange-httpd taler-exchange-dbinit -LDEBUG -c
/etc/taler/taler.conf
-
-echo 'GRANT USAGE ON SCHEMA exchange TO "taler-exchange-wire";' | sudo -i -u
postgres psql -f - ${EXCHANGE_DB}
-echo 'GRANT SELECT,INSERT,UPDATE,DELETE ON ALL TABLES IN SCHEMA exchange TO
"taler-exchange-wire";' | sudo -i -u postgres psql -f - ${EXCHANGE_DB}
-echo 'GRANT USAGE ON SCHEMA _v TO "taler-exchange-wire";' | sudo -i -u
postgres psql -f - ${EXCHANGE_DB}
-echo 'GRANT SELECT ON ALL TABLES IN SCHEMA _v TO "taler-exchange-wire";' |
sudo -i -u postgres psql -f - ${EXCHANGE_DB}
-
-echo 'GRANT USAGE ON SCHEMA exchange TO "taler-exchange-closer";' | sudo -i -u
postgres psql -f - ${EXCHANGE_DB}
-echo 'GRANT SELECT,INSERT,UPDATE,DELETE ON ALL TABLES IN SCHEMA exchange TO
"taler-exchange-closer";' | sudo -i -u postgres psql -f - ${EXCHANGE_DB}
-echo 'GRANT USAGE ON SCHEMA _v TO "taler-exchange-closer";' | sudo -i -u
postgres psql -f - ${EXCHANGE_DB}
-echo 'GRANT SELECT ON ALL TABLES IN SCHEMA _v TO "taler-exchange-closer";' |
sudo -i -u postgres psql -f - ${EXCHANGE_DB}
-
-echo 'GRANT USAGE ON SCHEMA exchange TO "taler-exchange-aggregator";' | sudo
-i -u postgres psql -f - ${EXCHANGE_DB}
-echo 'GRANT SELECT,INSERT,UPDATE,DELETE ON ALL TABLES IN SCHEMA exchange TO
"taler-exchange-aggregator";' | sudo -i -u postgres psql -f - ${EXCHANGE_DB}
-echo 'GRANT USAGE ON SCHEMA _v TO "taler-exchange-aggregator";' | sudo -i -u
postgres psql -f - ${EXCHANGE_DB}
-echo 'GRANT SELECT ON ALL TABLES IN SCHEMA _v TO "taler-exchange-aggregator";'
| sudo -i -u postgres psql -f - ${EXCHANGE_DB}
-
+taler-exchange-dbconfig
taler-terms-generator -i /usr/share/taler/terms/exchange-tos-v0
taler-terms-generator -i /usr/share/taler/terms/exchange-pp-v0
@@ -388,18 +362,16 @@ sudo -i -u taler-exchange-offline \
# Set up merchant backend
MERCHANT_DB=talermerchant
-# Use "|| true" to continue if these already exist.
-sudo -i -u postgres createuser -d taler-merchant-httpd || true
-sudo -i -u postgres createdb -O taler-merchant-httpd $MERCHANT_DB || true
cat <<EOF >/etc/taler/secrets/merchant-db.secret.conf
[merchantdb-postgres]
CONFIG=postgres:///${MERCHANT_DB}
EOF
+
chmod 440 /etc/taler/secrets/merchant-db.secret.conf
chown taler-merchant-httpd:root /etc/taler/secrets/merchant-db.secret.conf
-sudo -u taler-merchant-httpd taler-merchant-dbinit -c /etc/taler/taler.conf
+taler-merchant-dbconfig
# The config shipped with the package can conflict with the
# trusted sandcastle exchange if the currency is KUDOS.
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-sandcastle-ng] 01/39: import sandcastle-ng, (continued)
- [taler-sandcastle-ng] 01/39: import sandcastle-ng, gnunet, 2024/01/11
- [taler-sandcastle-ng] 39/39: sandcastle-ng: incremental tos generation, gnunet, 2024/01/11
- [taler-sandcastle-ng] 21/39: sandcastle: remove clashing currency config, gnunet, 2024/01/11
- [taler-sandcastle-ng] 15/39: sandcastle-ng: ensure apache2 is disabled, gnunet, 2024/01/11
- [taler-sandcastle-ng] 20/39: sandcastle: libeufin dbinit, gnunet, 2024/01/11
- [taler-sandcastle-ng] 06/39: sandcastle-ng: make run script print to console, gnunet, 2024/01/11
- [taler-sandcastle-ng] 25/39: sandcastle-ng: add support for config overrides, gnunet, 2024/01/11
- [taler-sandcastle-ng] 34/39: sandcastle-ng: do not lift terms dir, generated terms now live in /var/lib/taler, gnunet, 2024/01/11
- [taler-sandcastle-ng] 31/39: sandcastle-ng: setup admin account properly, gnunet, 2024/01/11
- [taler-sandcastle-ng] 10/39: sandcastle-ng: increase default debt limits, gnunet, 2024/01/11
- [taler-sandcastle-ng] 37/39: sandcastle: use dbconfig helpers for libeufin/exchange/merchant,
gnunet <=
- [taler-sandcastle-ng] 09/39: sandcastle-ng: add setup for test.taler.net, gnunet, 2024/01/11
- [taler-sandcastle-ng] 32/39: sandcastle-ng: add script printing version strings, gnunet, 2024/01/11
- [taler-sandcastle-ng] 33/39: sandcastle-ng: update tags, gnunet, 2024/01/11
- [taler-sandcastle-ng] 30/39: bump GNUnet version, gnunet, 2024/01/11
- [taler-sandcastle-ng] 23/39: sandcastle: libeufin UI nav sites, gnunet, 2024/01/11
- [taler-sandcastle-ng] 24/39: bump libeufin, gnunet, 2024/01/11
- [taler-sandcastle-ng] 19/39: sandcastle: tags, gnunet, 2024/01/11
- [taler-sandcastle-ng] 22/39: sandcastle: update libeufin config, gnunet, 2024/01/11
- [taler-sandcastle-ng] 11/39: sandcastle-ng: suppress apt install dialogs, gnunet, 2024/01/11
- [taler-sandcastle-ng] 28/39: bump exchange version, gnunet, 2024/01/11