summaryrefslogtreecommitdiff
path: root/regional-currency/setup-exchange.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regional-currency/setup-exchange.sh')
-rwxr-xr-xregional-currency/setup-exchange.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/regional-currency/setup-exchange.sh b/regional-currency/setup-exchange.sh
index fe50426..e4aff34 100755
--- a/regional-currency/setup-exchange.sh
+++ b/regional-currency/setup-exchange.sh
@@ -100,6 +100,34 @@ systemctl stop taler-exchange.target &>> setup.log
say "Configuring exchange"
+# Generate terms of service (ToS)
+TERMS_ETAG=
+if test ${DO_EXCHANGE_TERMS} == y; then
+ if test -z "${EXCHANGE_TERMS_FILE:-}"; then
+ say "Error: No EXCHANGE_TERMS_FILE set but DO_EXCHANGE_TERMS set to YES"
+ exit 1
+ fi
+
+ TERMS_ETAG="$(basename "$EXCHANGE_TERMS_FILE" .rst)"
+
+ say "Setting up terms of service (ToS)"
+ taler-terms-generator -i "${EXCHANGE_TERMS_FILE}" &>> setup.log
+fi
+
+# Generate privacy policy
+PRIVACY_ETAG=
+if test ${DO_EXCHANGE_PRIVACY} == y; then
+ if test -z "${EXCHANGE_PRIVACY_FILE:-}"; then
+ say "Error: No EXCHANGE_PRIVACY_FILE set but DO_EXCHANGE_PRIVACY set to YES"
+ exit 1
+ fi
+
+ PRIVACY_ETAG="$(basename "$EXCHANGE_PRIVACY_FILE" .rst)"
+
+ say "Setting up the privacy policy"
+ taler-terms-generator -i "${EXCHANGE_PRIVACY_FILE}" &>> setup.log
+fi
+
export EXCHANGE_BASE_URL="$PROTO://exchange.${DOMAIN_NAME}/"
cat << EOF > /etc/taler/conf.d/setup.conf
@@ -115,6 +143,9 @@ STEFAN_ABS=${CURRENCY}:0
STEFAN_LOG=${CURRENCY}:0
STEFAN_LIN=0
+TERMS_ETAG=${TERMS_ETAG}
+PRIVACY_ETAG=${PRIVACY_ETAG}
+
[merchant-exchange-${DOMAIN_NAME}]
MASTER_KEY=${MASTER_PUBLIC_KEY}
CURRENCY=${CURRENCY}