taler-deployment

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

commit 251babbaecb3f5b614f3b7e3ad5d69a910beb93c
parent 23c5ecf1435c0db3f1901926e0c9bc2b7df7d691
Author: MS <ms@taler.net>
Date:   Tue, 25 Oct 2022 18:05:39 +0200

deploy blog and donations

Diffstat:
Mdocker/hybrid/config/deployment.conf | 13++++++++++++-
Mdocker/hybrid/docker-compose.yml | 3++-
Mdocker/hybrid/images/exchange/startup.sh | 6++++++
Mdocker/hybrid/images/libeufin/startup.sh | 24++++++++++++++++++++++--
Mdocker/hybrid/images/merchant/startup.sh | 37++++++++++++++++++++++++++++---------
Mdocker/hybrid/images/merchant/taler.conf | 2+-
Mdocker/hybrid/test-docker-mvp.sh | 4++--
7 files changed, 73 insertions(+), 16 deletions(-)

diff --git a/docker/hybrid/config/deployment.conf b/docker/hybrid/config/deployment.conf @@ -3,7 +3,18 @@ currency = EUR merchant-apikey = secret exchange-nexus-username = exchange-at-nexus exchange-nexus-password = secret-at-nexus + +# 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 +gnunet-sandbox-username = gnunet-at-sandbox +gnunet-sandbox-password = secret-at-sandbox +# default merchant instance +default-sandbox-username = default-at-sandbox +default-sandbox-password = secret-at-sandbox + db-password = db-secret -default-exchange = http://exchange/ +# exchange URL, as seen outside of the container +default-exchange = http://localhost:5555/ diff --git a/docker/hybrid/docker-compose.yml b/docker/hybrid/docker-compose.yml @@ -44,7 +44,8 @@ services: - talerdb ports: - 5556:80 - - 5559:8080 # Blog TBD. + - 5559:8080 # blog + - 5560:8081 # donations volumes: - talerlogs:/logs - ${TALER_DEPLOYMENT_CONFIG:?Please export TALER_DEPLOYMENT_CONFIG}:/config/deployment.conf diff --git a/docker/hybrid/images/exchange/startup.sh b/docker/hybrid/images/exchange/startup.sh @@ -60,8 +60,14 @@ for n in `seq 1 20` exit 1 fi echo Echange launched. +echo Launching wirewatch... taler-exchange-wirewatch -L DEBUG -c /config/taler.conf 2>&1 | \ rotatelogs -e /logs/taler-exchange-wirewatch-%Y-%m-%d 86400 & +echo DONE +echo Launching transfer service... +taler-exchange-transfer -L DEBUG -c /config/taler.conf 2>&1 | \ + rotatelogs -e /logs/taler-exchange-transfer-%Y-%m-%d 86400 & +echo DONE taler-exchange-offline -L DEBUG -c /config/taler.conf \ download sign \ diff --git a/docker/hybrid/images/libeufin/startup.sh b/docker/hybrid/images/libeufin/startup.sh @@ -40,7 +40,11 @@ is_serving() { fi echo $2 reachable. } +# IBANs referenced in the merchant container as well. +DEFAULT_IBAN=DE474361 EXCHANGE_IBAN=DE159593 +BLOG_IBAN=DE940993 +GNUNET_IBAN=DE463312 mkdir -p ${MAYBE_VOLUME_MOUNTPOINT} export LIBEUFIN_SANDBOX_DB_CONNECTION="jdbc:sqlite:${MAYBE_VOLUME_MOUNTPOINT}/sandbox.sqlite3" export LIBEUFIN_SANDBOX_ADMIN_PASSWORD=secret @@ -60,8 +64,24 @@ is_serving ${LIBEUFIN_SANDBOX_URL} Sandbox 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` -echo -n "Register the Exchange at Sandbox..." -register_sandbox_account $EXCHANGE_SANDBOX_USERNAME $EXCHANGE_SANDBOX_PASSWORD $EXCHANGE_IBAN "Exchange Company" +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` + +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 exchange EBICS subscriber at Sandbox.." export LIBEUFIN_SANDBOX_USERNAME=admin diff --git a/docker/hybrid/images/merchant/startup.sh b/docker/hybrid/images/merchant/startup.sh @@ -8,6 +8,9 @@ CURRENCY=`taler-config -c /config/deployment.conf -s taler-deployment -o currenc BACKEND_APIKEY=`taler-config -c /config/deployment.conf -s taler-deployment -o merchant-apikey` EXCHANGE_URL="http://exchange/" DB_PASSWORD=`taler-config -c /config/deployment.conf -s taler-deployment -o db-password` +BLOG_IBAN=DE940993 +GNUNET_IBAN=DE463312 +DEFAULT_IBAN=DE474361 while ! pg_isready -h talerdb -d taler; do echo DB not ready yet. @@ -15,7 +18,7 @@ while ! pg_isready -h talerdb -d taler; do done echo Now DB is ready. -#FIXME: wallets external to the containers put localhost'ed +# FIXME: wallets external to the containers put localhost'ed # exchanges along a /pay request. That breaks here, since the # exchange listens from another container. The following # command routes every request to 5555 (port on the host @@ -23,6 +26,17 @@ echo Now DB is ready. # merchant tries to /deposit), to the container where the exchange listens. socat TCP-LISTEN:5555,fork,reuseaddr TCP:exchange:80 & +# FIXME: browsers can only get redirected to merchant backends +# as they appear outside of the container (port 5556). OTOH, +# merchant frontends can only talk to backends as they appear +# _inside_ the container (port 80). Config, ultimately, must +# specify backends as they appear outside, otherwise frontends +# would redirect browsers with in-container addresses, that +# would make the backend not reached. The following redirection +# allows to bridge the external merchant port to the internal, +# to make frontends reach the backend. +socat TCP-LISTEN:5556,fork,reuseaddr TCP:localhost:80 & + echo Checking exchange at: ${EXCHANGE_URL} for n in `seq 1 20` do @@ -55,15 +69,20 @@ taler-merchant-httpd -c /config/taler.conf 2>&1 | \ echo DONE sleep 1 echo -n "Create default instance..." -curl -s -H "Content-Type: application/json" -X POST -d '{"auth":{"method":"external"},"payto_uris":["payto://iban/SANDBOXX/DE474361?receiver-name=Merchant43"],"id":"default","name":"default","address":{},"jurisdiction":{},"default_max_wire_fee":"'${CURRENCY}':1", "default_max_deposit_fee":"'${CURRENCY}':1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' http://merchant/management/instances +curl -s -H "Content-Type: application/json" -X POST -d '{"auth":{"method":"external"},"payto_uris":["payto://iban/SANDBOXX/'$DEFAULT_IBAN'?receiver-name=Merchant43"],"id":"default","name":"default","address":{},"jurisdiction":{},"default_max_wire_fee":"'${CURRENCY}':1", "default_max_deposit_fee":"'${CURRENCY}':1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_us" : 1},"default_pay_delay":{"d_us": 3600000000}}' http://merchant/management/instances +echo DONE +echo -n "Create blog instance..." +curl -s -H "Content-Type: application/json" -X POST -d '{"auth":{"method":"external"},"payto_uris":["payto://iban/SANDBOXX/'$BLOG_IBAN'?receiver-name=BlogCompany"],"id":"blog","name":"default","address":{},"jurisdiction":{},"default_max_wire_fee":"'${CURRENCY}':1", "default_max_deposit_fee":"'${CURRENCY}':1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_us" : 1000000},"default_pay_delay":{"d_us": 3600000000}}' http://merchant/management/instances +echo DONE +echo -n "Create donations instance..." +curl -s -H "Content-Type: application/json" -X POST -d '{"auth":{"method":"external"},"payto_uris":["payto://iban/SANDBOXX/'$GNUNET_IBAN'?receiver-name=GNUnet"],"id":"GNUnet","name":"default","address":{},"jurisdiction":{},"default_max_wire_fee":"'${CURRENCY}':1", "default_max_deposit_fee":"'${CURRENCY}':1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_us" : 1000000},"default_pay_delay":{"d_us": 3600000000}}' http://merchant/management/instances echo DONE -# FIXME: the command below works around a bug, -# where demo sites ingnore the "-c" option. -# mkdir ${HOME}/.config/ -# ln -s /config/taler.conf ${HOME}/.config/ -# echo -n "Launch blog..." -# ${HOME}/.local/bin/taler-merchant-demos --http-port 8080 blog & -# echo DONE +echo -n "Launch blog..." +${HOME}/.local/bin/taler-merchant-demos -c /config/taler.conf --http-port 8080 blog & +echo DONE +echo -n "Launch donations..." +${HOME}/.local/bin/taler-merchant-demos -c /config/taler.conf --http-port 8081 donations & +echo DONE wait diff --git a/docker/hybrid/images/merchant/taler.conf b/docker/hybrid/images/merchant/taler.conf @@ -25,5 +25,5 @@ wire_response = ${TALER_DATA_HOME}/merchant/wire/merchant.json # Unused yet. [frontends] -backend = http://localhost/ +backend = http://localhost:5556/ backend_apikey = __BACKEND_APIKEY__ diff --git a/docker/hybrid/test-docker-mvp.sh b/docker/hybrid/test-docker-mvp.sh @@ -1,8 +1,8 @@ #!/bin/bash taler-wallet-cli --no-throttle api --expect-success 'runIntegrationTest' \ - '{"amountToSpend":"EUR:1", - "amountToWithdraw":"EUR:3", + '{"amountToSpend":"EUR:10", + "amountToWithdraw":"EUR:30", "bankBaseUrl":"http://localhost:15000/demobanks/default/access-api/", "exchangeBaseUrl":"http://localhost:5555/", "merchantBaseUrl":"http://localhost:5556/"