sandcastle-ng

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

commit 74eeff7acb6c813303c45930346ed05d4ef08eeb
parent 2d643830ec37b53457065d6fd86a62e9401bb15a
Author: Iván Ávalos <avalos@disroot.org>
Date:   Fri,  1 Aug 2025 13:20:09 +0200

add token family generation

Diffstat:
Mscripts/demo/setup-sandcastle.sh | 30+++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/scripts/demo/setup-sandcastle.sh b/scripts/demo/setup-sandcastle.sh @@ -892,8 +892,36 @@ taler-harness deployment provision-merchant-instance \ --id sandbox \ --payto "$MERCHANT_PAYTO_SANDBOX" -# Now we set up the taler-merchant-demos +# token families needed by demo blog + +langs=(de en ar zh fr hi it ja ko pt pt_BR ru es sv tr uk) +valid_before_ts=$(date -u +%s -d '+1 month') # one month later +duration_us=$(echo '30 * 24 * 60 * 60 * 1000000' | bc) # 30 days +validity_granularity_us=$(echo '24 * 60 * 60 * 1000000' | bc) # 1 day + +for lang in "${langs[@]}"; +do + curl -X POST "https://${MERCHANT_BASEURL}/instances/blog/private/tokenfamilies" \ + -H "Authorization: Bearer secret-token:$(get_credential_pw merchant/blog)" \ + -H "Content-Type: application/json" \ + --data-raw "{ + \"kind\": \"subscription\", + \"slug\": \"blog_abo_${lang}\", + \"name\": \"One month of access (${lang})\", + \"description\": \"One month of access (${lang})\", + \"description_i18n\": { + \"de\": \"Ein monat lang Zugang zu den Artikeln\", + \"en\": \"One month of access to articles\", + \"fr\": \"Un mois d'accès aux articles\", + \"es\": \"Un mes de acceso a los artículos\" + }, + \"valid_before\": { \"t_s\": ${valid_before_ts} }, + \"duration\": { \"d_us\": ${duration_us} }, + \"validity_granularity\": { \"d_us\": ${validity_granularity_us} } +}" +done +# Now we set up the taler-merchant-demos systemctl enable --now taler-demo-landing systemctl enable --now taler-demo-blog