sandcastle-ng

Scripts for the deployment of Sandcastle (GNU Taler)
Log | Files | Refs | README

commit de92299536ebcad55d23db5792660df90597d17e
parent f1ceb79ee3cea5ee53040c9d5b3ce3a3b674e211
Author: Florian Dold <dold@taler.net>
Date:   Mon,  7 Sep 2026 15:20:14 +0200

sandcastle: pass bank language paths to the web UI

Redirect bank language entry paths to the SPA with a lang query value.
Preserve query parameters on the root redirect and share the rules across
socket and HTTP ingress through the bank Caddy snippet.

Issue: https://bugs.taler.net/n/7309

Diffstat:
MREADME.md | 7+++++++
Mscripts/demo/setup-sandcastle.sh | 19+++++++++++++++++++
2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md @@ -204,6 +204,13 @@ an appropriate local SELinux policy. libeufin-bank does not yet support Unix sockets, so it listens on localhost inside the container and Caddy exposes it through `bank.sock`. +The shared bank Caddy configuration redirects `/` to `/webui/` while preserving +query parameters. The demo links use language entry paths such as `/de/` and +`/de_CH/`, which redirect to `/webui/?lang=de` and +`/webui/?lang=de_CH`. The path language replaces an existing `lang` parameter; +other query parameters are retained. These temporary redirects apply to GET +and HEAD requests through both the bank socket and HTTP/HTTPS ingress. + Overrides that define `EXTERNAL_PORT`, such as `taler.localhost`, continue to publish that single Caddy ingress port for local integration testing. diff --git a/scripts/demo/setup-sandcastle.sh b/scripts/demo/setup-sandcastle.sh @@ -726,6 +726,25 @@ cat <<EOF >/etc/caddy/Caddyfile } (sandcastle_bank) { + # Keep the incoming language and other query parameters when entering the + # SPA. The bank's own root redirect currently discards them. + @bank_root { + method GET HEAD + path / + } + route @bank_root { + rewrite * /webui/ + redir {uri} 302 + } + @bank_locale { + method GET HEAD + path_regexp bank_locale ^/([A-Za-z]{2}([-_][A-Za-z0-9]{2,8})*)/?$ + } + route @bank_locale { + uri query lang {re.bank_locale.1} + rewrite * /webui/ + redir {uri} 302 + } reverse_proxy 127.0.0.1:$PORT_INTERNAL_LIBEUFIN_BANK { # libeufin-bank should eventually not require this anymore, # but currently doesn't work without this header.