commit 4543e8562f1e6cb4a49a5557126658ee4840576c
parent 6222e0a3b6a48c5b858d7d6d62c5bf7f9cad0efe
Author: Antoine A <>
Date: Thu, 5 Dec 2024 16:24:18 +0100
regional: support new split taler configurations
Diffstat:
3 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/regional-currency/nginx-conf/exchange.taler-nginx.conf b/regional-currency/nginx-conf/exchange.taler-nginx.conf
@@ -11,6 +11,6 @@ server {
keepalive_timeout 6500s;
location / {
- proxy_pass http://unix:/var/run/taler/exchange-httpd/exchange-http.sock;
+ proxy_pass http://unix:/var/run/taler-exchange/httpd/exchange-http.sock;
}
}
diff --git a/regional-currency/setup-exchange.sh b/regional-currency/setup-exchange.sh
@@ -69,9 +69,9 @@ if test -z "${MASTER_PUBLIC_KEY:-}"; then
echo -e "[exchange-offline]\n"\
"MASTER_PRIV_FILE=\$HOME/${MASTER_PRIV_FILE}\n"\
"SECM_TOFU_FILE=\$HOME/${SECMOD_TOFU_FILE}\n"\
- >/etc/taler/conf.d/offline-setup.conf
+ >/etc/taler-exchange/conf.d/offline-setup.conf
- MASTER_PUBLIC_KEY=$(sudo -i -u taler-exchange-offline taler-exchange-offline -c /etc/taler/taler.conf -LDEBUG setup 2>> setup.log)
+ MASTER_PUBLIC_KEY=$(sudo -i -u taler-exchange-offline taler-exchange-offline -LDEBUG setup 2>> setup.log)
echo "MASTER_PUBLIC_KEY=\"${MASTER_PUBLIC_KEY}\"" >>config/user.conf
if test -z "${DO_OFFLINE:-}"; then
# Set 'DO_OFFLINE'
@@ -81,7 +81,7 @@ if test -z "${MASTER_PUBLIC_KEY:-}"; then
else
say "Master public key is $MASTER_PUBLIC_KEY"
if test ${DO_OFFLINE:-y} == y; then
- MASTER_PUBLIC_KEY2=$(sudo -i -u taler-exchange-offline taler-exchange-offline -c /etc/taler/taler.conf setup 2>> setup.log)
+ MASTER_PUBLIC_KEY2=$(sudo -i -u taler-exchange-offline taler-exchange-offline setup 2>> setup.log)
if test "${MASTER_PUBLIC_KEY2}" != "${MASTER_PUBLIC_KEY}"; then
say "Error: master public key missmatch ${MASTER_PUBLIC_KEY2} does not match ${MASTER_PUBLIC_KEY}"
exit 1
@@ -124,12 +124,10 @@ fi
export EXCHANGE_BASE_URL="$PROTO://exchange.${DOMAIN_NAME}/"
-cat << EOF > /etc/taler/conf.d/setup.conf
-[taler]
+cat << EOF > /etc/taler-exchange/conf.d/setup.conf
+[exchange]
CURRENCY=${CURRENCY}
CURRENCY_ROUND_UNIT=${CURRENCY}:0.01
-
-[exchange]
AML_THRESHOLD=${CURRENCY}:1000000
MASTER_PUBLIC_KEY=${MASTER_PUBLIC_KEY}
BASE_URL=${EXCHANGE_BASE_URL}
@@ -152,34 +150,33 @@ ENABLE_CREDIT=YES
@inline-secret@ exchange-accountcredentials-default ../secrets/exchange-accountcredentials-default.secret.conf
EOF
-cat << EOF > /etc/taler/secrets/exchange-db.secret.conf
+cat << EOF > /etc/taler-exchange/secrets/exchange-db.secret.conf
[exchangedb-postgres]
CONFIG=postgres:///exchange
EOF
-chmod 440 /etc/taler/secrets/exchange-db.secret.conf
-chown root:taler-exchange-db /etc/taler/secrets/exchange-db.secret.conf
+chmod 440 /etc/taler-exchange/secrets/exchange-db.secret.conf
+chown root:taler-exchange-db /etc/taler-exchange/secrets/exchange-db.secret.conf
-cat << EOF > /etc/taler/secrets/exchange-accountcredentials-default.secret.conf
+cat << EOF > /etc/taler-exchange/secrets/exchange-accountcredentials-default.secret.conf
[exchange-accountcredentials-default]
WIRE_GATEWAY_URL=${PROTO}://bank.$DOMAIN_NAME/accounts/exchange/taler-wire-gateway/
-WIRE_GATEWAY_AUTH_METHOD=basic
-USERNAME=exchange
-PASSWORD=${BANK_EXCHANGE_PASSWORD}
+WIRE_GATEWAY_AUTH_METHOD=bearer
+TOKEN=${BANK_EXCHANGE_TOKEN}
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
+chmod 400 /etc/taler-exchange/secrets/exchange-accountcredentials-default.secret.conf
+chown taler-exchange-wire:taler-exchange-db /etc/taler-exchange/secrets/exchange-accountcredentials-default.secret.conf
taler-harness deployment gen-coin-config \
--min-amount "${CURRENCY}":0.01 \
--max-amount "${CURRENCY}":100 |
sed -e "s/FEE_DEPOSIT = ${CURRENCY}:0.01/FEE_DEPOSIT = ${CURRENCY}:0/" \
- >/etc/taler/conf.d/"${CURRENCY}"-coins.conf
+ >/etc/taler-exchange/conf.d/"${CURRENCY}"-coins.conf
say "Initializing exchange database"
-taler-exchange-dbconfig -c /etc/taler/taler.conf &>> setup.log
+taler-exchange-dbconfig &>> setup.log
say "Launching exchange"
systemctl enable taler-exchange.target &>> setup.log
@@ -202,7 +199,6 @@ if test ${DO_OFFLINE} == y; then
say "Offline interaction..."
sudo -i -u taler-exchange-offline \
taler-exchange-offline \
- -c /etc/taler/taler.conf \
download \
sign \
upload &>> setup.log
diff --git a/regional-currency/setup-libeufin.sh b/regional-currency/setup-libeufin.sh
@@ -82,13 +82,11 @@ say "Setting up libeufin-bank..."
say "Setting up libeufin-bank admin account..."
sudo -u libeufin-bank \
libeufin-bank passwd \
- -c /etc/libeufin/libeufin-bank.conf \
admin "${BANK_ADMIN_PASSWORD}" &>> setup.log
say "Setting up admin's debt limit..."
sudo -u libeufin-bank \
libeufin-bank edit-account \
- -c /etc/libeufin/libeufin-bank.conf \
admin --debit_threshold=${CURRENCY}:200000000 &>> setup.log
say "Setting up SPA configuration..."
@@ -97,9 +95,13 @@ echo "settings = { bankName: \"${BANK_NAME}\" }" >/etc/libeufin/settings.js
say "Create exchange account..."
if test -z "${EXCHANGE_PAYTO:-}"; then
# FIXME create-account should have a way to update the password if the account already exists
- EXCHANGE_PAYTO_NEW="$(sudo -u libeufin-bank libeufin-bank create-account -c /etc/libeufin/libeufin-bank.conf --username exchange --password "${BANK_EXCHANGE_PASSWORD}" --name Exchange --exchange 2>> setup.log)"
+ EXCHANGE_PAYTO_NEW="$(sudo -u libeufin-bank libeufin-bank create-account --username exchange --password "${BANK_EXCHANGE_PASSWORD}" --name Exchange --exchange 2>> setup.log)"
echo "EXCHANGE_PAYTO=\"${EXCHANGE_PAYTO_NEW}\"" >> config/user.conf
fi
+if test -z "${BANK_EXCHANGE_TOKEN:-}"; then
+ BANK_EXCHANGE_TOKEN=$(sudo -u libeufin-bank libeufin-bank create-token -u exchange -s wiregateway -d forever)
+ echo "BANK_EXCHANGE_TOKEN=\"${BANK_EXCHANGE_TOKEN}\"" >>config/internal.conf
+fi
say "Start the bank..."