diff options
author | Antoine A <> | 2024-02-20 17:14:25 +0100 |
---|---|---|
committer | Antoine A <> | 2024-02-20 17:14:25 +0100 |
commit | f5886b8d06d1e2024d6b6a16cc8b6aaa41a79432 (patch) | |
tree | b8ee49fef99b8f944cbc3462b3d45daa66d009ac | |
parent | a5ad1dd966f17a085607c3d4ed3b629d35c94268 (diff) | |
download | deployment-f5886b8d06d1e2024d6b6a16cc8b6aaa41a79432.tar.gz deployment-f5886b8d06d1e2024d6b6a16cc8b6aaa41a79432.tar.bz2 deployment-f5886b8d06d1e2024d6b6a16cc8b6aaa41a79432.zip |
Fix admin password generation and other improvements
-rwxr-xr-x | regional-currency/functions.sh | 11 | ||||
-rwxr-xr-x | regional-currency/main.sh | 5 |
2 files changed, 11 insertions, 5 deletions
diff --git a/regional-currency/functions.sh b/regional-currency/functions.sh index edc824a..9e18afd 100755 --- a/regional-currency/functions.sh +++ b/regional-currency/functions.sh @@ -66,7 +66,7 @@ function ask_questions() { fi fi if test -z "${DO_OFFLINE:-}"; then - read -r -p "Do you want Taler Exchange keys on this server (y) or externally on another server (n) ?" DO_OFFLINE + read -r -p "Do you want Taler Exchange keys on this server (y) or externally on another server (n): " DO_OFFLINE echo "DO_OFFLINE=${DO_OFFLINE}" >>config/user.conf fi if test -z "${MASTER_PUBLIC_KEY:-}"; then @@ -84,10 +84,11 @@ function ask_questions() { read -r -p "- Enter a phone number to test your API key (e.g. '+447911123456'): " TELESIGN_PHONE TELESIGN_AUTH_TOKEN=$(echo "$TELESIGN_CUSTOMER_ID:$TELESIGN_API_KEY" | base64 -w 0) export AUTH_TOKEN=$TELESIGN_AUTH_TOKEN - echo "12345" | libeufin-tan-sms.sh $TELESIGN_PHONE - read -r -s -p "- Enter the code received by $TELESIGN_PHONE : " TELESIGN_TEST_CODE - if test "${TELESIGN_TEST_CODE:-y}" != "12345"; then - say "Wrong code, rerun this script to enter the right Telesign auth info" + RANDOM_CODE=$RANDOM + echo "$RANDOM_CODE" | libeufin-tan-sms.sh $TELESIGN_PHONE + read -r -s "- Enter the code received by $TELESIGN_PHONE : " TELESIGN_TEST_CODE + if test "${TELESIGN_TEST_CODE:-y}" != "$RANDOM_CODE"; then + say "Wrong code got '$TELESIGN_TEST_CODE' expected '$RANDOM_CODE', rerun this script to enter the right Telesign auth info" exit 1 fi echo "TELESIGN_AUTH_TOKEN=\"${TELESIGN_AUTH_TOKEN}\"" >>config/user.conf diff --git a/regional-currency/main.sh b/regional-currency/main.sh index 5234b78..37d8018 100755 --- a/regional-currency/main.sh +++ b/regional-currency/main.sh @@ -64,6 +64,11 @@ if test -z "${BANK_EXCHANGE_PASSWORD:-}"; then echo "BANK_EXCHANGE_PASSWORD=\"${BANK_EXCHANGE_PASSWORD}\"" >>config/internal.conf fi +if test -z "${BANK_ADMIN_PASSWORD:-}"; then + BANK_ADMIN_PASSWORD=$(uuidgen) + echo "BANK_ADMIN_PASSWORD=\"${BANK_ADMIN_PASSWORD}\"" >>config/user.conf +fi + if test -z "${BANK_PORT:-}"; then echo "BANK_PORT=8080" >>config/user.conf fi |