taler-deployment

Deployment scripts and configuration files
Log | Files | Refs | README

commit 8e2b017bebd5ebfb62ee0039c356188c3b666e04
parent 2958719bebcde146cc2a229f0f75d97ebdaba22a
Author: MS <ms@taler.net>
Date:   Sun,  3 Dec 2023 15:47:51 +0100

idempotency & withdraw

- patching the configuration only once
- define exchange URL according to the PROTO variable

Diffstat:
Mnetzbon/config_libeufin_bank.sh | 7+++++--
Mnetzbon/config_libeufin_nexus.sh | 4+++-
Mnetzbon/withdraw.sh | 9++++-----
3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/netzbon/config_libeufin_bank.sh b/netzbon/config_libeufin_bank.sh @@ -47,7 +47,9 @@ fi say "Configure the bank with ${CURRENCY}..." # TODO is 20000000 big enough for admin dbt limit -cat << EOF >> /etc/libeufin/libeufin-bank.conf + +if ! taler-config -s "libeufin-bank" -o code &> /dev/null +then cat << EOF >> /etc/libeufin/libeufin-bank.conf [libeufin-bank] CURRENCY=${CURRENCY} DEFAULT_EXCHANGE=${PROTO}://exchange.${DOMAIN_NAME} @@ -56,8 +58,9 @@ DEFAULT_CUSTOMER_DEBT_LIMIT=${CURRENCY}:0 SERVE=tcp PORT=${BANK_PORT} EOF +fi -if ! taler-config -s "currency-$CURRENCY" -o code &> /dev/null +if ! taler-config -s "currency-netzbon" -o code &> /dev/null then cat << EOF >> /etc/libeufin/libeufin-bank.conf [currency-netzbon] ENABLED = YES diff --git a/netzbon/config_libeufin_nexus.sh b/netzbon/config_libeufin_nexus.sh @@ -14,9 +14,11 @@ source functions.sh # the section [ebics-setup]. This is a manual process that is # to be conducted separately. -echo -e "[nexus-postgres]\n"\ +if ! taler-config -s "nexus-postgres" -o code &> /dev/null +then echo -e "[nexus-postgres]\n"\ "config = postgresql:///libeufin" \ >> /etc/libeufin/libeufin-nexus.conf +fi say "Setting up libeufin-nexus database" libeufin-nexus-dbconfig diff --git a/netzbon/withdraw.sh b/netzbon/withdraw.sh @@ -2,14 +2,13 @@ set -eu -# Loading values (DOMAIN_NAME & CURRENCY) -. config/user.conf -DBNAME=libeufinbank -NEXUS_CONFIG_FILE="FIXME" +. config/user.conf # DOMAIN_NAME & CURRENCY +. config/internal.conf # PROTO +NEXUS_CONFIG_FILE=/etc/libeufin/libeufin-nexus.conf RESERVE_PUB=$(taler-wallet-cli \ api 'acceptManualWithdrawal' \ - '{"exchangeBaseUrl":"exchange.'$DOMAIN_NAME'", + '{"exchangeBaseUrl":'${PROTO}'://exchange.'$DOMAIN_NAME'", "amount":"'$CURRENCY':5" }' | jq -r .result.reservePub) DEBTOR_IBAN="CH8389144317421994586"