summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMS <ms@taler.net>2023-12-03 15:47:51 +0100
committerMS <ms@taler.net>2023-12-03 15:47:51 +0100
commit8e2b017bebd5ebfb62ee0039c356188c3b666e04 (patch)
tree80682d326267b496071353762bb480be96011593
parent2958719bebcde146cc2a229f0f75d97ebdaba22a (diff)
downloaddeployment-8e2b017bebd5ebfb62ee0039c356188c3b666e04.tar.gz
deployment-8e2b017bebd5ebfb62ee0039c356188c3b666e04.tar.bz2
deployment-8e2b017bebd5ebfb62ee0039c356188c3b666e04.zip
idempotency & withdraw
- patching the configuration only once - define exchange URL according to the PROTO variable
-rwxr-xr-xnetzbon/config_libeufin_bank.sh7
-rwxr-xr-xnetzbon/config_libeufin_nexus.sh4
-rwxr-xr-xnetzbon/withdraw.sh9
3 files changed, 12 insertions, 8 deletions
diff --git a/netzbon/config_libeufin_bank.sh b/netzbon/config_libeufin_bank.sh
index 9755596..97eefe3 100755
--- 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
index c18e86f..5d95008 100755
--- 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
index d885b1d..c0d6fcf 100755
--- 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"