taler-deployment

Deployment scripts and configuration files
Log | Files | Refs | README

commit ee6f9578d38d3951513b7cbfe055349c30413257
parent 814e58bfdac99b1f2e80ef7bfe1ac1f72ef9e22d
Author: ms <ms@taler.net>
Date:   Wed,  1 Dec 2021 14:29:16 +0100

fix base URLs according to X-Forwarded-*

Diffstat:
Mbin/WIP/taler-local | 18+++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/bin/WIP/taler-local b/bin/WIP/taler-local @@ -852,7 +852,6 @@ def prepare(x_forwarded_host, x_forwarded_proto): currency, rev_proxy_url, wire_method, - merchant_wire_address, exchange_wire_gateway_username, exchange_wire_gateway_password, frontend_api_key, @@ -974,9 +973,6 @@ def prepare(x_forwarded_host, x_forwarded_proto): obj.cfg_put("auditordb-postgres", "config", "postgres:///taler") obj.cfg_put("exchange-account-1", "enable_debit", "yes") obj.cfg_put("exchange-account-1", "enable_credit", "yes") - obj.cfg_put("merchant-account-merchant", "payto_uri", - f"payto://{wire_method}/{rev_proxy_url + '/sandbox'}/{merchant_wire_address}" - ) obj.cfg_put("merchant-account-merchant", "wire_response", "${TALER_DATA_HOME}/merchant/wire/merchant.json", @@ -1062,15 +1058,17 @@ def prepare(x_forwarded_host, x_forwarded_proto): shutil.rmtree(CFG_OUTDIR) print(" OK") + def get_link(path = ""): + return x_forwarded_proto + "://" + x_forwarded_host + path + print_nn("Generate preliminary taler.conf...") mc = config_main( "taler.conf", outdir=CFG_OUTDIR, unix_sockets_dir=UNIX_SOCKETS_DIR, currency=CURRENCY, - rev_proxy_url=REV_PROXY_URL, + rev_proxy_url=get_link(), # Gets X-Forwarded-* compatible base URL. wire_method=WIRE_METHOD, - merchant_wire_address=IBAN_MERCHANT_DEFAULT, exchange_wire_gateway_username=EXCHANGE_NEXUS_USERNAME, exchange_wire_gateway_password=EXCHANGE_NEXUS_PASSWORD, frontend_api_key=FRONTENDS_API_TOKEN, @@ -1223,7 +1221,7 @@ def prepare(x_forwarded_host, x_forwarded_proto): unix_sockets_dir=UNIX_SOCKETS_DIR, currency=CURRENCY, api_key=FRONTENDS_API_TOKEN, - rev_proxy_url=REV_PROXY_URL + rev_proxy_url=get_link() ) print(" OK") print_nn("Generating anastasis.conf...") @@ -1232,7 +1230,7 @@ def prepare(x_forwarded_host, x_forwarded_proto): outdir=CFG_OUTDIR, unix_sockets_dir=UNIX_SOCKETS_DIR, currency=CURRENCY, - rev_proxy_url=REV_PROXY_URL, + rev_proxy_url=get_link(), api_key=FRONTENDS_API_TOKEN ) print(" OK") @@ -1487,13 +1485,11 @@ def prepare(x_forwarded_host, x_forwarded_proto): except Exception as error: fail(error) FACADE_URL=response.json().get("facades")[0].get("baseUrl") - def get_link(path): - return x_forwarded_proto + "://" + x_forwarded_host + path print_nn("Set suggested exchange at Sandbox...") Command([ "libeufin-sandbox", "default-exchange", - get_link('/exchange/') + get_link('/exchange/'), EXCHANGE_PAYTO], env={ "PATH": os.environ["PATH"],