summaryrefslogtreecommitdiff
path: root/sandcastle-ng/scripts/setup-sandcastle.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sandcastle-ng/scripts/setup-sandcastle.sh')
-rwxr-xr-xsandcastle-ng/scripts/setup-sandcastle.sh38
1 files changed, 34 insertions, 4 deletions
diff --git a/sandcastle-ng/scripts/setup-sandcastle.sh b/sandcastle-ng/scripts/setup-sandcastle.sh
index 5afa20c..099238f 100755
--- a/sandcastle-ng/scripts/setup-sandcastle.sh
+++ b/sandcastle-ng/scripts/setup-sandcastle.sh
@@ -10,14 +10,31 @@
set -eu
set -x
+if [[ ! -z "${SANDCASTLE_SKIP_SETUP:-}" ]]; then
+ echo "skipping sandcastle setup, requested by environment var SANDCASTLE_SKIP_SETUP"
+ exit 1
+fi
+
echo "Provisioning sandcastle"
+# General configuration.
+# Might eventually be moved to an external file.
CURRENCY=KUDOS
EXCHANGE_IBAN=DE159593
EXCHANGE_PLAIN_PAYTO=payto://iban/$EXCHANGE_IBAN
EXCHANGE_FULL_PAYTO="payto://iban/$EXCHANGE_IBAN?receiver-name=Sandcastle+Echange+Inc"
EXCHANGE_BANK_PASSWORD=sandbox
+# Ports of the services running inside the container.
+# Should be synchronized with the sandcastle-run script.
+PORT_INTERNAL_EXCHANGE=8201
+PORT_INTERNAL_MERCHANT=8301
+PORT_INTERNAL_LIBEUFIN_BANK=8080
+PORT_INTERNAL_LANDING=8501
+PORT_INTERNAL_BLOG=8502
+PORT_INTERNAL_DONATIONS=8503
+PORT_INTERNAL_SURVEY=8504
+
# Just make sure the services are stopped
systemctl stop taler-exchange.target
systemctl stop taler-merchant-httpd.service
@@ -96,6 +113,17 @@ https://$MERCHANT_DOMAIN {
tls internal
reverse_proxy unix//run/taler/merchant-httpd/merchant-http.sock
}
+
+# Services that only listen on unix domain sockets
+# are reverse-proxied to serve on a TCP port.
+
+http://localhost:$PORT_INTERNAL_EXCHANGE {
+ reverse_proxy unix//run/taler/exchange-httpd/exchange-http.sock
+}
+
+http://localhost:$PORT_INTERNAL_MERCHANT {
+ reverse_proxy unix//run/taler/merchant-httpd/merchant-http.sock
+}
EOF
cat <<EOF >> /etc/hosts
@@ -216,6 +244,8 @@ if [[ ! -e "$TOS_PATH/stamp-generated" ]]; then
cd $TOS_PATH
taler-terms-generator -i exchange-tos-v0 -a "Taler Systems SA" -C "Taler Systems SA" -p a4 -o $TOS_PATH -l en
taler-terms-generator -i exchange-pp-v0 -a "Taler Systems SA" -C "Taler Systems SA" -p a4 -o $TOS_PATH -l en
+ taler-terms-generator -i exchange-tos-v0 -a "Taler Systems SA" -C "Taler Systems SA" -p a4 -o $TOS_PATH
+ taler-terms-generator -i exchange-pp-v0 -a "Taler Systems SA" -C "Taler Systems SA" -p a4 -o $TOS_PATH
touch "$TOS_PATH/stamp-generated"
cd -
fi
@@ -283,16 +313,16 @@ BACKEND = https://backend.demo.taler.net/
BACKEND_APIKEY = secret-token:sandbox
[landing]
SERVE = http
-HTTP_PORT = 8501
+HTTP_PORT = $PORT_INTERNAL_LANDING
[blog]
SERVE = http
-HTTP_PORT = 8502
+HTTP_PORT = $PORT_INTERNAL_BLOG
[donations]
SERVE = http
-HTTP_PORT = 8503
+HTTP_PORT = $PORT_INTERNAL_DONATIONS
[survey]
SERVE = http
-HTTP_PORT = 8504
+HTTP_PORT = $PORT_INTERNAL_SURVEY
EOF
systemctl enable --now taler-demo-landing