summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-05-31 09:31:27 +0200
committerFlorian Dold <florian@dold.me>2023-05-31 09:31:31 +0200
commit2500fb64943aa9e31d69f72bbbcbac0947e1e016 (patch)
treef2841696f4ad4b7cd3f9ca816f85f85f23fbbe9e
parentfbeb538cc44d3d654f2909d040822b841a2ee22e (diff)
downloaddeployment-2500fb64943aa9e31d69f72bbbcbac0947e1e016.tar.gz
deployment-2500fb64943aa9e31d69f72bbbcbac0947e1e016.tar.bz2
deployment-2500fb64943aa9e31d69f72bbbcbac0947e1e016.zip
sandcastle: allow shell for bank container
-rw-r--r--sandcastle/images/libeufin/Dockerfile3
-rw-r--r--sandcastle/images/libeufin/startup.sh32
2 files changed, 22 insertions, 13 deletions
diff --git a/sandcastle/images/libeufin/Dockerfile b/sandcastle/images/libeufin/Dockerfile
index 12768b9..dd3ddf7 100644
--- a/sandcastle/images/libeufin/Dockerfile
+++ b/sandcastle/images/libeufin/Dockerfile
@@ -5,4 +5,5 @@ COPY create_bank_accounts.sh /
COPY demobank-ui-settings.js /usr/local/share/taler/demobank-ui/
RUN chmod +x /startup.sh
COPY nginx.conf /
-ENTRYPOINT /startup.sh
+
+ENTRYPOINT ["/startup.sh"]
diff --git a/sandcastle/images/libeufin/startup.sh b/sandcastle/images/libeufin/startup.sh
index 9480781..45301bf 100644
--- a/sandcastle/images/libeufin/startup.sh
+++ b/sandcastle/images/libeufin/startup.sh
@@ -23,13 +23,11 @@ export LIBEUFIN_NEXUS_URL="http://localhost:${NEXUS_PORT}"
# invoke: username password iban name
register_sandbox_account() {
- export LIBEUFIN_SANDBOX_USERNAME=$1
- export LIBEUFIN_SANDBOX_PASSWORD=$2
# A unavailable username upon registration should
# fail, hence non idempotence is acceptable here.
- test -a $INIT_MARKER || libeufin-cli sandbox demobank register --name "$4" --iban $3
- unset LIBEUFIN_SANDBOX_USERNAME
- unset LIBEUFIN_SANDBOX_PASSWORD
+ test -a $INIT_MARKER && return
+ LIBEUFIN_SANDBOX_USERNAME=$1 LIBEUFIN_SANDBOX_PASSWORD=$2 \
+ libeufin-cli sandbox demobank register --name "$4" --iban $3
}
# takes port and service name
@@ -50,11 +48,28 @@ is_serving() {
fi
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"
+ exec bash
+ ;;
+ *)
+ ;;
+esac
+
mkdir -p ${MAYBE_VOLUME_MOUNTPOINT}
export LIBEUFIN_SANDBOX_ADMIN_PASSWORD=secret
@@ -71,13 +86,6 @@ test -a $INIT_MARKER || libeufin-sandbox default-exchange \
"payto://iban/SANDBOXX/${EXCHANGE_IBAN}?receiver-name=Exchange+Company"
echo DONE
-# 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`
-
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 &