diff --git a/scripts/taler-merchant/install_dual_terms.sh b/scripts/taler-merchant/install_dual_terms.sh new file mode 100644 index 0000000..2855e3f --- /dev/null +++ b/scripts/taler-merchant/install_dual_terms.sh @@ -0,0 +1,232 @@ +#!/bin/bash +# Install dual-currency "No Formal Terms" ToS for the merchant backend. +# Run as root inside the merchant container (taler-hacktivism). +# +# Sets files under TERMS_DIR/en/ for TERMS_ETAG = merchant-tos-dual-v0 +# (see configs/taler-merchant/merchant-overrides.conf). +set -euo pipefail +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin${PATH:+:$PATH}" + +ETAG="${TERMS_ETAG:-merchant-tos-dual-v2}" +CONF="${TALER_MERCHANT_CONFIG:-/etc/taler-merchant/taler-merchant.conf}" + +DATA_HOME="" +if command -v taler-config >/dev/null 2>&1; then + DATA_HOME=$(taler-config -c "$CONF" -f -s PATHS -o TALER_DATA_HOME 2>/dev/null || true) +fi +# common fallbacks +for d in \ + "$DATA_HOME" \ + /var/lib/taler-merchant/ \ + /var/lib/taler-merchant +do + [ -n "${d:-}" ] || continue + d="${d%/}/" + if [ -d "$d" ] || mkdir -p "$d" 2>/dev/null; then + DATA_HOME="$d" + break + fi +done +DATA_HOME="${DATA_HOME:-/var/lib/taler-merchant/}" +TERMS_DIR="${TERMS_DIR:-${DATA_HOME%/}/terms}" +LANG_DIR="$TERMS_DIR/en" +mkdir -p "$LANG_DIR" + +TITLE="No Formal Terms · Dual Currency Notice" + +BODY_MD='# No Formal Terms · Dual Currency Notice + +This is a **self-hosted GNU Taler merchant backend** at `taler.hacktivism.ch` (hacktivism.ch). + +**No formal terms of service** from Taler Operations AG (or any other third-party portal operator) apply to this instance. This short notice is the site policy for using the backend. + +## Dual currency + +This backend is configured for **two currencies at once**: + +- **GOA** — explorational / experimental currency of the local stack (`exchange.hacktivism.ch`, `bank.hacktivism.ch`). GOA is **not** legal tender. It has **no guaranteed real-world value**, redemption, or convertibility. +- **CHF** — Swiss francs, a **real** currency. CHF amounts are real money settled via the CHF exchange configured on this host (taler-ops / TOPS infrastructure as deployed). Treat CHF with the seriousness of ordinary payments. + +By creating a merchant instance, accepting payments, or otherwise using this service you acknowledge that: + +- GOA is for exploration and testing only. +- CHF involves real money — only use funds you control and can afford to risk on a self-hosted experimental stack. +- There is no guaranteed availability, support, or uptime. +- Operators may reset GOA state, change configuration, delete instance data, or interrupt service without notice. +- Software is provided as-is, without warranty. + +If you do not agree, do not use this merchant backend. + +## Related + +- Exchange (GOA): https://exchange.hacktivism.ch/terms +- Bank intro: https://bank.hacktivism.ch/intro/ +- Merchant intro: https://taler.hacktivism.ch/intro/ +' + +BODY_TXT='No Formal Terms · Dual Currency Notice + +This is a self-hosted GNU Taler merchant backend at taler.hacktivism.ch (hacktivism.ch). + +No formal terms of service from Taler Operations AG (or any other third-party portal operator) apply to this instance. This short notice is the site policy for using the backend. + +Dual currency +------------- +This backend is configured for two currencies at once: + +- GOA — explorational / experimental currency of the local stack + (exchange.hacktivism.ch, bank.hacktivism.ch). GOA is not legal tender. + It has no guaranteed real-world value, redemption, or convertibility. +- CHF — Swiss francs, a real currency. CHF amounts are real money + settled via the CHF exchange configured on this host (taler-ops / TOPS + infrastructure as deployed). Treat CHF with the seriousness of + ordinary payments. + +By creating a merchant instance, accepting payments, or otherwise using +this service you acknowledge that: + +- GOA is for exploration and testing only. +- CHF involves real money — only use funds you control and can afford + to risk on a self-hosted experimental stack. +- There is no guaranteed availability, support, or uptime. +- Operators may reset GOA state, change configuration, delete instance + data, or interrupt service without notice. +- Software is provided as-is, without warranty. + +If you do not agree, do not use this merchant backend. + +Related +------- +- Exchange (GOA): https://exchange.hacktivism.ch/terms +- Bank intro: https://bank.hacktivism.ch/intro/ +- Merchant intro: https://taler.hacktivism.ch/intro/ +' + +printf '%s\n' "$BODY_TXT" >"$LANG_DIR/${ETAG}.txt" +printf '%s\n' "$BODY_MD" >"$LANG_DIR/${ETAG}.md" + +# HTML (browser-friendly; style close to exchange short terms) +cat >"$LANG_DIR/${ETAG}.html" < + + + + + ${TITLE} + + + +
taler.hacktivism.ch · merchant
+

${TITLE}

+

This is a self-hosted GNU Taler merchant backend at + taler.hacktivism.ch (hacktivism.ch).

+

No formal terms of service from Taler Operations AG + (or any other third-party portal operator) apply to this instance. + This short notice is the site policy for using the backend.

+ +

Dual currency

+

This backend is configured for two currencies at once:

+
+
+ GOA · explorational + Local stack currency + (exchange, + bank). + Not legal tender. No guaranteed real-world value, redemption, or convertibility. +
+
+ CHF · real + Swiss francs. Real money, settled via the CHF exchange configured + on this host (taler-ops / TOPS infrastructure as deployed). + Treat CHF with the seriousness of ordinary payments. +
+
+ +

By using this service you acknowledge

+ +

If you do not agree, do not use this merchant backend.

+ +

Related

+ + +

Privacy

+

Processing under Swiss FADP (revDSG). What data is retained + (instances, orders, deposits, logs, …) is listed on + /privacy.

+ + + +HTML + +# Optional PDF so Accept: */* / wallets preferring PDF still get content +PDF="$LANG_DIR/${ETAG}.pdf" +if command -v pandoc >/dev/null 2>&1; then + if pandoc -f markdown -t pdf -o "$PDF" "$LANG_DIR/${ETAG}.md" 2>/dev/null; then + echo "pdf via pandoc: $PDF" + elif command -v wkhtmltopdf >/dev/null 2>&1; then + wkhtmltopdf "$LANG_DIR/${ETAG}.html" "$PDF" 2>/dev/null && echo "pdf via wkhtmltopdf" || true + fi +elif command -v wkhtmltopdf >/dev/null 2>&1; then + wkhtmltopdf "$LANG_DIR/${ETAG}.html" "$PDF" 2>/dev/null && echo "pdf via wkhtmltopdf" || true +fi +# If no PDF toolchain: leave absent — httpd will serve md/html/txt by Accept + +chmod -R a+rX "$TERMS_DIR" +if id taler-merchant-httpd >/dev/null 2>&1; then + chown -R taler-merchant-httpd: "$TERMS_DIR" 2>/dev/null \ + || chown -R taler-merchant-httpd:www-data "$TERMS_DIR" 2>/dev/null \ + || true +fi + +echo "Installed under $LANG_DIR:" +ls -la "$LANG_DIR"/${ETAG}.* 2>/dev/null || ls -la "$LANG_DIR" +echo +echo "Config should set:" +echo " [merchant]" +echo " TERMS_ETAG = ${ETAG}" +echo " TERMS_DIR = \${TALER_DATA_HOME}terms/" +echo "Then restart taler-merchant-httpd."