diff options
author | Florian Dold <florian@dold.me> | 2023-09-25 00:42:33 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-09-25 00:42:39 +0200 |
commit | 3454856ed0f9c2737f7b66e99f05c66eba71fb79 (patch) | |
tree | 4d4fba82743ee8a2e7695ad6447810691161a898 | |
parent | 2b02ea1160d78c192f1e1f316ab32966a392da55 (diff) | |
download | deployment-3454856ed0f9c2737f7b66e99f05c66eba71fb79.tar.gz deployment-3454856ed0f9c2737f7b66e99f05c66eba71fb79.tar.bz2 deployment-3454856ed0f9c2737f7b66e99f05c66eba71fb79.zip |
sandcastle: use new libeufin-bank
-rw-r--r-- | sandcastle/.env | 4 | ||||
-rw-r--r-- | sandcastle/buildconfig/exchange.tag | 2 | ||||
-rw-r--r-- | sandcastle/buildconfig/gnunet.tag | 2 | ||||
-rw-r--r-- | sandcastle/buildconfig/libeufin.tag | 2 | ||||
-rw-r--r-- | sandcastle/buildconfig/merchant.tag | 2 | ||||
-rw-r--r-- | sandcastle/buildconfig/wallet.tag | 2 | ||||
-rw-r--r-- | sandcastle/config/deployment.conf | 28 | ||||
-rw-r--r-- | sandcastle/config/exchange/taler.conf | 6 | ||||
-rw-r--r-- | sandcastle/config/libeufin-bank/taler.conf | 16 | ||||
-rw-r--r-- | sandcastle/docker-compose.yml | 3 | ||||
-rw-r--r-- | sandcastle/images/base/Dockerfile | 6 | ||||
-rw-r--r-- | sandcastle/images/exchange/scripts/config.sh | 14 | ||||
-rw-r--r-- | sandcastle/images/libeufin/Dockerfile | 1 | ||||
-rw-r--r-- | sandcastle/images/libeufin/create_bank_accounts.sh | 45 | ||||
-rw-r--r-- | sandcastle/images/libeufin/startup.sh | 198 |
15 files changed, 98 insertions, 233 deletions
diff --git a/sandcastle/.env b/sandcastle/.env index a1ba29d..3179771 100644 --- a/sandcastle/.env +++ b/sandcastle/.env @@ -9,6 +9,4 @@ TALER_SURVEY_PORT=5561 TALER_LANDING_PORT=5562 TALER_SYNC_PORT=5563 -LIBEUFIN_SANDBOX_PORT=15000 -LIBEUFIN_NEXUS_PORT=15001 -LIBEUFIN_FRONTEND_PORT=15002 +LIBEUFIN_BANK_PORT=15000 diff --git a/sandcastle/buildconfig/exchange.tag b/sandcastle/buildconfig/exchange.tag index 3ab9664..188bef5 100644 --- a/sandcastle/buildconfig/exchange.tag +++ b/sandcastle/buildconfig/exchange.tag @@ -1 +1 @@ -v0.9.3-dev.7 +v0.9.3 diff --git a/sandcastle/buildconfig/gnunet.tag b/sandcastle/buildconfig/gnunet.tag index 07238df..1847373 100644 --- a/sandcastle/buildconfig/gnunet.tag +++ b/sandcastle/buildconfig/gnunet.tag @@ -1 +1 @@ -v0.19.5-talerdev.3 +v0.20.0 diff --git a/sandcastle/buildconfig/libeufin.tag b/sandcastle/buildconfig/libeufin.tag index cb27af9..3ab9664 100644 --- a/sandcastle/buildconfig/libeufin.tag +++ b/sandcastle/buildconfig/libeufin.tag @@ -1 +1 @@ -v0.9.3-dev.1 +v0.9.3-dev.7 diff --git a/sandcastle/buildconfig/merchant.tag b/sandcastle/buildconfig/merchant.tag index 06dc5b3..188bef5 100644 --- a/sandcastle/buildconfig/merchant.tag +++ b/sandcastle/buildconfig/merchant.tag @@ -1 +1 @@ -v0.9.3-dev.4 +v0.9.3 diff --git a/sandcastle/buildconfig/wallet.tag b/sandcastle/buildconfig/wallet.tag index da1b019..cfd3802 100644 --- a/sandcastle/buildconfig/wallet.tag +++ b/sandcastle/buildconfig/wallet.tag @@ -1 +1 @@ -v0.9.3-dev.22 +v0.9.3-dev.24 diff --git a/sandcastle/config/deployment.conf b/sandcastle/config/deployment.conf index 3be97aa..ffa4562 100644 --- a/sandcastle/config/deployment.conf +++ b/sandcastle/config/deployment.conf @@ -2,8 +2,6 @@ currency = EUR merchant-apikey = secret-token:sandbox merchant-url = http://localhost:5556/ -exchange-nexus-username = exchange-at-nexus -exchange-nexus-password = secret-at-nexus bank-signup-bonus = yes bank-allow-registrations = yes @@ -21,24 +19,18 @@ bank-url = http://localhost:15002/ bank-backend-url = http://localhost:15000/ # Bank accounts -exchange-sandbox-username = exchange-at-sandbox -exchange-sandbox-password = secret-at-sandbox -blog-sandbox-username = blog-at-sandbox -blog-sandbox-password = secret-at-sandbox -pos-sandbox-username = pos-at-sandbox -pos-sandbox-password = secret-at-sandbox -gnunet-sandbox-username = gnunet-at-sandbox -gnunet-sandbox-password = secret-at-sandbox -taler-sandbox-username = taler-at-sandbox -taler-sandbox-password = secret-at-sandbox -tor-sandbox-username = tor-at-sandbox -tor-sandbox-password = secret-at-sandbox -survey-sandbox-username = survey-at-sandbox -survey-sandbox-password = secret-at-sandbox + +exchange-bank-password = exchangebankpw +blog-bank-password = secret-at-sandbox +pos-bank-password = secret-at-sandbox +gnunet-bank-password = secret-at-sandbox +taler-bank-password = secret-at-sandbox +tor-bank-password = secret-at-sandbox +survey-bank-password = secret-at-sandbox # default merchant instance -default-sandbox-username = default-at-sandbox -default-sandbox-password = secret-at-sandbox +default-bank-password = secret-at-sandbox db-password = db-secret + # exchange URL, as seen outside of the container default-exchange = http://localhost:5555/ diff --git a/sandcastle/config/exchange/taler.conf b/sandcastle/config/exchange/taler.conf index 61165c7..f7b3181 100644 --- a/sandcastle/config/exchange/taler.conf +++ b/sandcastle/config/exchange/taler.conf @@ -23,10 +23,10 @@ sm_priv_key = /data/taler-exchange-secmod-cs/secmod-private-key unixpath = /sockets/exchange-secmod-cs.sock [exchange-accountcredentials-1] -username = __EXCHANGE_NEXUS_USERNAME__ +username = exchange wire_gateway_auth_method = basic -wire_gateway_url = __NEXUS_URL__/facades/__TALER_FACADE_NAME__/taler-wire-gateway/ -password = __EXCHANGE_NEXUS_PASSWORD__ +wire_gateway_url = __BANK_URL__/accounts/exchange/taler-wire-gateway/ +password = __EXCHANGE_BANK_PASSWORD__ [exchange-account-1] enable_credit = yes diff --git a/sandcastle/config/libeufin-bank/taler.conf b/sandcastle/config/libeufin-bank/taler.conf new file mode 100644 index 0000000..55b65db --- /dev/null +++ b/sandcastle/config/libeufin-bank/taler.conf @@ -0,0 +1,16 @@ +[libeufin-bank] +CURRENCY = __CURRENCY__ +DEFAULT_CUSTOMER_DEBT_LIMIT = __CURRENCY__:200 +DEFAULT_ADMIN_DEBT_LIMIT = __CURRENCY__:200000 +REGISTRATION_BONUS = __CURRENCY__:100 +REGISTRATION_BONUS_ENABLED = yes +MAX_AUTH_TOKEN_DURATION = 1d + +SERVE = tcp +PORT = 15000 + +[libeufin-bankdb-postgres] +CONFIG = postgresql://talerdb/taler?user=root&password=__DB_PASSWORD__ + +#CONFIG = postgresql://root:__DB_PASSWORD__@talerdb/taler +#CONFIG = postgresql:///talerdb diff --git a/sandcastle/docker-compose.yml b/sandcastle/docker-compose.yml index 6a8097e..7049d55 100644 --- a/sandcastle/docker-compose.yml +++ b/sandcastle/docker-compose.yml @@ -78,8 +78,7 @@ services: bank: build: ./images/libeufin ports: - - 127.0.0.1:${LIBEUFIN_SANDBOX_PORT}:15000 # Sandbox - - 127.0.0.1:${LIBEUFIN_NEXUS_PORT}:15001 # Nexus + - 127.0.0.1:${LIBEUFIN_BANK_PORT}:15000 # libeufin-bank - 127.0.0.1:${LIBEUFIN_FRONTEND_PORT}:80 # Nginx serving the SPA volumes: - talerlogs:/logs diff --git a/sandcastle/images/base/Dockerfile b/sandcastle/images/base/Dockerfile index 90e4db5..575f40b 100644 --- a/sandcastle/images/base/Dockerfile +++ b/sandcastle/images/base/Dockerfile @@ -46,7 +46,7 @@ RUN apt-get install -y \ # FIXME: Try to use debian packages where possible and otherwise really use # a venv or per-user installation of the package. -RUN pip3 install --break-system-packages requests click poetry uwsgi htmlark +RUN pip3 install --break-system-packages requests click poetry uwsgi htmlark sphinx-book-theme # Libmicro httpd @@ -135,11 +135,11 @@ COPY buildconfig/wallet.tag /buildconfig/ RUN TAG=$(cat /buildconfig/wallet.tag) && \ git clone git://git.taler.net/wallet-core \ --branch $TAG -RUN npm install -g pnpm@^8.0.0 +RUN npm install -g pnpm@^8.7.0 WORKDIR /wallet-core RUN ./bootstrap RUN ./configure -RUN make install +RUN make install-tools # Sync diff --git a/sandcastle/images/exchange/scripts/config.sh b/sandcastle/images/exchange/scripts/config.sh index c95034f..e3e9a75 100644 --- a/sandcastle/images/exchange/scripts/config.sh +++ b/sandcastle/images/exchange/scripts/config.sh @@ -19,20 +19,18 @@ cp /config/exchange/taler.conf $TALERCONF CURRENCY=`taler-config -c /config/deployment.conf -s taler-deployment -o currency` EXCHANGE_URL=`taler-config -c /config/deployment.conf -s taler-deployment -o default-exchange` -EXCHANGE_NEXUS_USERNAME=`taler-config -c /config/deployment.conf -s taler-deployment -o exchange-nexus-username` -EXCHANGE_NEXUS_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o exchange-nexus-password` +EXCHANGE_BANK_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o exchange-bank-password` EXCHANGE_IBAN=DE159593 -TALER_FACADE_NAME=taler-facade DB_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o db-password` + sed -i "s;__EXCHANGE_URL__;${EXCHANGE_URL};" $TALERCONF sed -i "s;__DB_PASSWORD__;${DB_PASSWORD};" $TALERCONF sed -i "s/__CURRENCY__/${CURRENCY}/" $TALERCONF -sed -i "s/__EXCHANGE_NEXUS_USERNAME__/${EXCHANGE_NEXUS_USERNAME}/" $TALERCONF -sed -i "s/__EXCHANGE_NEXUS_PASSWORD__/${EXCHANGE_NEXUS_PASSWORD}/" $TALERCONF +sed -i "s/__EXCHANGE_BANK_PASSWORD__/${EXCHANGE_BANK_PASSWORD}/" $TALERCONF sed -i "s/__EXCHANGE_IBAN__/${EXCHANGE_IBAN}/" $TALERCONF -sed -i "s/__TALER_FACADE_NAME__/${TALER_FACADE_NAME}/" $TALERCONF -sed -i "s;__NEXUS_URL__;http://bank:15001;" $TALERCONF +sed -i "s;__BANK_URL__;http://bank:15000;" $TALERCONF -EXCHANGE_MASTER_PUB=$(taler-exchange-offline -c $TALERCONF setup) +# This is executed last since taler-exchange-offline already needs the config! +EXCHANGE_MASTER_PUB=$(taler-exchange-offline -c $TALERCONF setup) sed -i "s/__EXCHANGE_MASTER_PUB__/$EXCHANGE_MASTER_PUB/" $TALERCONF diff --git a/sandcastle/images/libeufin/Dockerfile b/sandcastle/images/libeufin/Dockerfile index dd3ddf7..99745aa 100644 --- a/sandcastle/images/libeufin/Dockerfile +++ b/sandcastle/images/libeufin/Dockerfile @@ -1,7 +1,6 @@ FROM taler_local/taler_base COPY startup.sh / -COPY create_bank_accounts.sh / COPY demobank-ui-settings.js /usr/local/share/taler/demobank-ui/ RUN chmod +x /startup.sh COPY nginx.conf / diff --git a/sandcastle/images/libeufin/create_bank_accounts.sh b/sandcastle/images/libeufin/create_bank_accounts.sh deleted file mode 100644 index 7bae214..0000000 --- a/sandcastle/images/libeufin/create_bank_accounts.sh +++ /dev/null @@ -1,45 +0,0 @@ -BLOG_IBAN=DE940993 -GNUNET_IBAN=DE463312 -DEFAULT_IBAN=DE474361 -TOR_IBAN=DE358263 -TALER_IBAN=DE102893 -SURVEY_IBAN=DE731371 - -EXCHANGE_SANDBOX_USERNAME=`taler-config -c /config/deployment.conf -s taler-deployment -o exchange-sandbox-username` -EXCHANGE_SANDBOX_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o exchange-sandbox-password` -POS_SANDBOX_USERNAME=`taler-config -c /config/deployment.conf -s taler-deployment -o pos-sandbox-username` -POS_SANDBOX_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o pos-sandbox-password` -BLOG_SANDBOX_USERNAME=`taler-config -c /config/deployment.conf -s taler-deployment -o blog-sandbox-username` -BLOG_SANDBOX_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o blog-sandbox-password` -GNUNET_SANDBOX_USERNAME=`taler-config -c /config/deployment.conf -s taler-deployment -o gnunet-sandbox-username` -GNUNET_SANDBOX_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o gnunet-sandbox-password` -DEFAULT_SANDBOX_USERNAME=`taler-config -c /config/deployment.conf -s taler-deployment -o default-sandbox-username` -DEFAULT_SANDBOX_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o default-sandbox-password` -TOR_SANDBOX_USERNAME=`taler-config -c /config/deployment.conf -s taler-deployment -o tor-sandbox-username` -TOR_SANDBOX_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o tor-sandbox-password` -TALER_SANDBOX_USERNAME=`taler-config -c /config/deployment.conf -s taler-deployment -o taler-sandbox-username` -TALER_SANDBOX_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o taler-sandbox-password` -SURVEY_SANDBOX_USERNAME=`taler-config -c /config/deployment.conf -s taler-deployment -o survey-sandbox-username` -SURVEY_SANDBOX_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o survey-sandbox-password` - -echo -n "create default merchant instance bank account..." -register_sandbox_account $DEFAULT_SANDBOX_USERNAME $DEFAULT_SANDBOX_PASSWORD $DEFAULT_IBAN "default merchant instance" -echo DONE -echo -n "create exchange bank account..." -register_sandbox_account $EXCHANGE_SANDBOX_USERNAME $EXCHANGE_SANDBOX_PASSWORD $EXCHANGE_IBAN "exchange company" -echo DONE -echo -n "create Blog bank account..." -register_sandbox_account $BLOG_SANDBOX_USERNAME $BLOG_SANDBOX_PASSWORD $BLOG_IBAN BlogCompany -echo DONE -echo -n "create GNUnet bank account..." -register_sandbox_account $GNUNET_SANDBOX_USERNAME $GNUNET_SANDBOX_PASSWORD $GNUNET_IBAN GNUnet -echo DONE -echo -n "create Taler bank account..." -register_sandbox_account $TALER_SANDBOX_USERNAME $TALER_SANDBOX_PASSWORD $TALER_IBAN Taler -echo DONE -echo -n "create Tor bank account..." -register_sandbox_account $TOR_SANDBOX_USERNAME $TOR_SANDBOX_PASSWORD $TOR_IBAN Tor -echo DONE -echo -n "create survey bank account..." -register_sandbox_account $SURVEY_SANDBOX_USERNAME $SURVEY_SANDBOX_PASSWORD $SURVEY_IBAN Survey -echo DONE diff --git a/sandcastle/images/libeufin/startup.sh b/sandcastle/images/libeufin/startup.sh index 8f52cd4..2238523 100644 --- a/sandcastle/images/libeufin/startup.sh +++ b/sandcastle/images/libeufin/startup.sh @@ -2,33 +2,22 @@ set -o pipefail set -eu + export JAVA_OPTS="-Xss4m -XX:MaxJavaStackTraceDepth=1073741823" -MAYBE_VOLUME_MOUNTPOINT="/data/libeufin" -export LIBEUFIN_SANDBOX_DB_CONNECTION="jdbc:sqlite:${MAYBE_VOLUME_MOUNTPOINT}/sandbox.sqlite3" -export LIBEUFIN_NEXUS_DB_CONNECTION="jdbc:sqlite:${MAYBE_VOLUME_MOUNTPOINT}/nexus.sqlite3" -# This file indicates that data preparation ran already -# once. It helps against some non idempotent commands. -INIT_MARKER=${MAYBE_VOLUME_MOUNTPOINT}/init-done -export LD_LIBRARY_PATH=/usr/local/lib # helps taler-config +# helps taler-config +export LD_LIBRARY_PATH=/usr/local/lib + +mkdir -p /etc/taler/ +TALERCONF=/etc/taler/taler.conf +cp /config/libeufin-bank/taler.conf $TALERCONF + CURRENCY=$(taler-config -c /config/deployment.conf -s taler-deployment -o currency) -SANDBOX_PORT=15000 -NEXUS_PORT=15001 -SANDBOX_BASE_URL="http://localhost:${SANDBOX_PORT}" -EXCHANGE_URL=$(taler-config -c /config/deployment.conf -s taler-deployment -o default-exchange) -CAPTCHA_URL=$(taler-config -c /config/deployment.conf -s taler-deployment -o bank-url) -# As wanted by the Libeufin CLI: -export LIBEUFIN_SANDBOX_URL=${SANDBOX_BASE_URL} -export LIBEUFIN_NEXUS_URL="http://localhost:${NEXUS_PORT}" - -# invoke: username password iban name -register_sandbox_account() { - # A unavailable username upon registration should - # fail, hence non idempotence is acceptable here. - test -a $INIT_MARKER && return - LIBEUFIN_SANDBOX_USERNAME=$1 LIBEUFIN_SANDBOX_PASSWORD=$2 \ - libeufin-cli sandbox demobank register --name "$4" --iban $3 -} +EXCHANGE_IBAN=DE159593 +DB_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o db-password` + +sed -i "s;__DB_PASSWORD__;${DB_PASSWORD};" $TALERCONF +sed -i "s/__CURRENCY__/${CURRENCY}/" $TALERCONF # takes port and service name is_serving() { @@ -49,18 +38,9 @@ is_serving() { echo $2 reachable. } -EXCHANGE_IBAN=DE159593 - BANK_SIGNUP_BONUS=$(taler-config -c /config/deployment.conf -s taler-deployment -o bank-signup-bonus) BANK_ALLOW_REGISTRATIONS=$(taler-config -c /config/deployment.conf -s taler-deployment -o bank-allow-registrations) -# Provide navigation bar links. -export TALER_ENV_URL_MERCHANT_BLOG=`taler-config -c /config/deployment.conf -s taler-deployment -o blog-url` -export TALER_ENV_URL_MERCHANT_DONATIONS=`taler-config -c /config/deployment.conf -s taler-deployment -o donations-url` -export TALER_ENV_URL_MERCHANT_SURVEY=`taler-config -c /config/deployment.conf -s taler-deployment -o survey-url` -export TALER_ENV_URL_INTRO=`taler-config -c /config/deployment.conf -s taler-deployment -o landing-url` -export TALER_ENV_URL_BANK=`taler-config -c /config/deployment.conf -s taler-deployment -o bank-url` - case "${1:-}" in shell) echo "Starting interactive shell" @@ -70,118 +50,47 @@ case "${1:-}" in ;; esac +echo "running libeufin-bank dbinit" +libeufin-bank dbinit + +echo "running libeufin-bank serve in background" +libeufin-bank serve & + +is_serving http://localhost:15000/config libeufin-bank + +EXCHANGE_IBAN=DE159593 +BLOG_IBAN=DE940993 +GNUNET_IBAN=DE463312 +DEFAULT_IBAN=DE474361 +TOR_IBAN=DE358263 +TALER_IBAN=DE102893 +SURVEY_IBAN=DE731371 + +EXCHANGE_SANDBOX_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o exchange-bank-password` +POS_SANDBOX_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o pos-bank-password` +BLOG_SANDBOX_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o blog-bank-password` +GNUNET_SANDBOX_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o gnunet-bank-password` +DEFAULT_SANDBOX_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o default-bank-password` +TOR_SANDBOX_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o tor-bank-password` +TALER_SANDBOX_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o taler-bank-password` +SURVEY_SANDBOX_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o survey-bank-password` + +req=$(jq -n ' + { + username: "exchange", + password: $PW, + name: "exchange", + is_public: true, + is_taler_exchange: true, + internal_payto_uri: $PAYTO, + }' \ + --arg PW $EXCHANGE_SANDBOX_PASSWORD \ + --arg PAYTO "payto://iban/$EXCHANGE_IBAN" + ) +echo $req +curl -v -X POST -H "Content-Type: application/json" --data "$req" http://localhost:15000/accounts + -mkdir -p ${MAYBE_VOLUME_MOUNTPOINT} -export LIBEUFIN_SANDBOX_ADMIN_PASSWORD=secret -echo -n "Creating ${CURRENCY} default demobank..." -test -a $INIT_MARKER || libeufin-sandbox config \ - --currency ${CURRENCY} \ - --with-signup-bonus \ - --captcha-url ${CAPTCHA_URL} \ - default -echo DONE -echo -n "Specify default exchange..." -test -a $INIT_MARKER || libeufin-sandbox default-exchange \ - ${EXCHANGE_URL} \ - "payto://iban/SANDBOXX/${EXCHANGE_IBAN}?receiver-name=Exchange+Company" -echo DONE - -echo -n "Launching Sandbox (container-internal URL: ${SANDBOX_BASE_URL})..." -libeufin-sandbox serve --ipv4-only --log-level warn --no-localhost-only --port $SANDBOX_PORT 2>&1 | \ - rotatelogs -e /logs/libeufin-sandbox-serve-%Y-%m-%d.log 86400 & -echo DONE -is_serving "${SANDBOX_BASE_URL}/demobanks/default/integration-api/config" Sandbox - -source create_bank_accounts.sh - -echo -n "Create exchange EBICS subscriber at Sandbox.." -export LIBEUFIN_SANDBOX_USERNAME=admin -export LIBEUFIN_SANDBOX_PASSWORD=secret -echo -n "Create EBICS host at Sandbox.." -test -a $INIT_MARKER || libeufin-cli sandbox ebicshost create --host-id talerebics -echo DONE -echo -n "Create exchange's EBICS subscriber at Sandbox.." -test -a $INIT_MARKER || libeufin-cli sandbox \ - demobank new-ebicssubscriber --host-id talerebics \ - --user-id exchangeebics --partner-id talerpartner \ - --bank-account $EXCHANGE_SANDBOX_USERNAME -echo DONE -## NEXUS SETUP -EXCHANGE_NEXUS_USERNAME=`taler-config -c /config/deployment.conf -s taler-deployment -o exchange-nexus-username` -EXCHANGE_NEXUS_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o exchange-nexus-password` - - -echo -n "Creating Nexus superuser..." -# Idempotent in the sense that if the user is found, -# they'll get the password changed. -libeufin-nexus superuser $EXCHANGE_NEXUS_USERNAME \ - --password $EXCHANGE_NEXUS_PASSWORD -echo DONE -echo -n "Launching Nexus (container-internal URL: $LIBEUFIN_NEXUS_URL)..." -libeufin-nexus serve --ipv4-only --log-level warn --no-localhost-only --port $NEXUS_PORT 2>&1 | \ - rotatelogs -e /logs/libeufin-nexus-serve-%Y-%m-%d.log 86400 & -echo DONE -is_serving $LIBEUFIN_NEXUS_URL Nexus - -export LIBEUFIN_NEXUS_USERNAME=$EXCHANGE_NEXUS_USERNAME -export LIBEUFIN_NEXUS_PASSWORD=$EXCHANGE_NEXUS_PASSWORD - -echo -n Creating a EBICS connection at Nexus.. -# Not idempotent: the implementation does check if -# a connection with the requested name exists, and -# returns "409 Conflict". FIXME -test -a $INIT_MARKER || libeufin-cli connections new-ebics-connection \ - --ebics-url "${SANDBOX_BASE_URL}/ebicsweb" \ - --host-id talerebics \ - --partner-id talerpartner \ - --ebics-user-id exchangeebics \ - talerconn -echo DONE -echo -n Setup EBICS keying.. -# idempotent (noop if 'talerconn' is found) -libeufin-cli connections connect talerconn > /dev/null -echo DONE -echo -n Download bank account name from Sandbox.. -# idempotent (only stores new bank account names) -libeufin-cli connections download-bank-accounts talerconn -echo DONE -echo -n Importing bank account info into Nexus.. -# idempotent -NEXUS_IMPORTED_BANKACCOUNT=nexus-bankaccount -libeufin-cli connections import-bank-account \ - --offered-account-id $EXCHANGE_SANDBOX_USERNAME \ - --nexus-bank-account-id $NEXUS_IMPORTED_BANKACCOUNT \ - talerconn -echo DONE -echo -n Setup payments submission task.. -# Tries every second. -# Not idempotent, FIXME -test -a $INIT_MARKER || libeufin-cli accounts task-schedule \ - --task-type submit \ - --task-name exchange-payments \ - --task-cronspec "* * *" \ - $NEXUS_IMPORTED_BANKACCOUNT -echo DONE -# Tries every second. Ask C52 -echo -n Setup history fetch task.. -# Not idempotent, FIXME -test -a $INIT_MARKER || libeufin-cli accounts task-schedule \ - --task-type fetch \ - --task-name exchange-history \ - --task-cronspec "* * *" \ - --task-param-level report \ - --task-param-range-type latest \ - $NEXUS_IMPORTED_BANKACCOUNT -echo DONE -echo -n Create the Taler facade at Nexus.. -# Not idempotent, in the sense that a duplicate -# facade will be created. FIXME -FACADE_NAME=taler-facade -test -a $INIT_MARKER || libeufin-cli facades \ - new-taler-wire-gateway-facade \ - --currency ${CURRENCY} --facade-name $FACADE_NAME \ - talerconn $NEXUS_IMPORTED_BANKACCOUNT -echo DONE # starting the SPA BLOG_URL=`taler-config -c /config/deployment.conf -s taler-deployment -o blog-url` DONATIONS_URL=`taler-config -c /config/deployment.conf -s taler-deployment -o donations-url` @@ -198,7 +107,6 @@ sed -i "s;__BANK_WEBUI_URL__;${BANK_WEBUI_URL};" /usr/local/share/taler/demobank sed -i "s;__BANK_BACKEND_URL__;${BANK_BACKEND_URL};" /usr/local/share/taler/demobank-ui/demobank-ui-settings.js # Serves BANK_WEBUI_URL nginx -c /nginx.conf 2>&1 | rotatelogs -e /logs/bank-ui-%Y-%m-%d.log 86400 & -touch $INIT_MARKER echo "Launched bank services" |