summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine A <>2024-02-29 13:24:02 +0100
committerAntoine A <>2024-02-29 13:24:02 +0100
commite35a3f3d31999961a8d1923a97e655b80612b397 (patch)
treeaac0f34ec63479024f26b0548999d6d37a39ccc4
parentc53bf19a09373e3668539cf84b45d779bce6429a (diff)
downloaddeployment-e35a3f3d31999961a8d1923a97e655b80612b397.tar.gz
deployment-e35a3f3d31999961a8d1923a97e655b80612b397.tar.bz2
deployment-e35a3f3d31999961a8d1923a97e655b80612b397.zip
regio: automated use of offline exchange setup only, for now
-rwxr-xr-xregional-currency/ask_questions.py19
-rwxr-xr-xregional-currency/setup-exchange.sh21
2 files changed, 18 insertions, 22 deletions
diff --git a/regional-currency/ask_questions.py b/regional-currency/ask_questions.py
index e983121..de5f6dc 100755
--- a/regional-currency/ask_questions.py
+++ b/regional-currency/ask_questions.py
@@ -276,25 +276,20 @@ if ask_yes_no("ENABLE_TLS", "5. Setup TLS using Let's Encrypt? (Y/n): ", True):
else:
add_conf("PROTO", "http")
-if not ask_yes_no(
- "DO_OFFLINE",
- "6. Do you want Taler Exchange keys on this server (Y) or externally on another server (n): ",
- True,
-):
- ask_str("MASTER_PUBLIC_KEY", "6.1. Enter the exchange-offline master public key: ")
+add_conf("DO_OFFLINE", "y") # TODO support offline setup again when the documentation is ready
if ask_yes_no(
"DO_TELESIGN",
- "7. Setup SMS two-factor authentication using Telesign https://www.telesign.com? (Y/n): ",
+ "6. Setup SMS two-factor authentication using Telesign https://www.telesign.com? (Y/n): ",
True,
):
def ask_telesign():
- customer_id = ask_str(None, "7.1. Enter your Telesign Customer ID: ")
- api_key = ask_str(None, "7.2. Enter your Telesign API Key: ")
+ customer_id = ask_str(None, "6.1. Enter your Telesign Customer ID: ")
+ api_key = ask_str(None, "6.2. Enter your Telesign API Key: ")
phone_number = ask_str(
None,
- "7.3. Enter a phone number to test your API key (e.g. '+447911123456'): ",
+ "6.3. Enter a phone number to test your API key (e.g. '+447911123456'): ",
)
auth_token = base64.b64encode(f"{customer_id}:{api_key}".encode()).decode()
if not try_cmd(
@@ -306,7 +301,7 @@ if ask_yes_no(
"Failed to send an SMS using Telesign API, check your credentials and phone number"
)
return None
- code = ask_str(None, f"7.4. Enter the code received by {phone_number} : ")
+ code = ask_str(None, f"6.4. Enter the code received by {phone_number} : ")
if code != "12345":
print(
f"Wrong code got '{code}' expected '12345', check your credentials and phone number"
@@ -317,6 +312,6 @@ if ask_yes_no(
conf_value("TELESIGN_AUTH_TOKEN", ask_telesign)
ask_str(
"BANK_ADMIN_PASSWORD",
- "8. Enter the admin password for the bank (or press enter to autogenerate password): ",
+ "7. Enter the admin password for the bank (or press enter to autogenerate password): ",
str(uuid.uuid4()),
)
diff --git a/regional-currency/setup-exchange.sh b/regional-currency/setup-exchange.sh
index 050e33d..fe50426 100755
--- a/regional-currency/setup-exchange.sh
+++ b/regional-currency/setup-exchange.sh
@@ -190,12 +190,23 @@ if test ${DO_OFFLINE} == y; then
sign \
upload &>> setup.log
+ say "Exchange account setup..."
sudo -i -u taler-exchange-offline \
taler-exchange-offline \
enable-account "${EXCHANGE_PAYTO}" \
wire-fee now x-taler-bank "${CURRENCY}":0 "${CURRENCY}":0 \
global-fee now "${CURRENCY}":0 "${CURRENCY}":0 "${CURRENCY}":0 1h 6a 0 \
upload &>> setup.log
+
+ if test ${DO_CONVERSION} == y; then
+ say "Conversion account setup..."
+
+ sudo -i -u taler-exchange-offline taler-exchange-offline \
+ enable-account \
+ "${CONVERSION_PAYTO}" \
+ conversion-url "${PROTO}://bank.$DOMAIN_NAME/conversion-info/" \
+ upload &>> setup.log
+ fi
fi
say "Waiting for exchange /keys..."
@@ -205,14 +216,4 @@ curl -sS --max-time 2 \
--retry 10 \
"${EXCHANGE_BASE_URL}"keys &>> setup.log
-if test ${DO_CONVERSION} == y; then
- say "Conversion account setup..."
-
- sudo -i -u taler-exchange-offline taler-exchange-offline \
- enable-account \
- "${CONVERSION_PAYTO}" \
- conversion-url "${PROTO}://bank.$DOMAIN_NAME/conversion-info/" \
- upload &>> setup.log
-fi
-
say "Exchange setup finished"