commit 07e787292eccc0a46dc1a5ca59e92b2cee82cdb3
parent cc392e99dc44733bb78dec19cc2137841902832b
Author: MS <ms@taler.net>
Date: Fri, 11 Sep 2020 18:15:08 +0200
adapt config to serve via HTTP
Diffstat:
2 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/bin/taler-config-generate b/bin/taler-config-generate
@@ -66,11 +66,14 @@ def config(obj):
obj.cfg_put("paths", "TALER_DATA_HOME", "${HOME}/taler-data")
obj.cfg_put("taler", "CURRENCY", obj.currency)
obj.cfg_put("taler", "CURRENCY_ROUND_UNIT", f"{obj.currency}:0.01")
+ if obj.envname != "local":
+ obj.cfg_put("bank", "serve", "uwsgi")
+ obj.cfg_put("bank", "uwsgi_serve", "unix")
+ obj.cfg_put("bank", "uwsgi_unixpath", "$HOME/sockets/bank.uwsgi")
+ obj.cfg_put("bank", "uwsgi_unixpath_mode", "660")
+ else:
+ obj.cfg_put("bank", "http_port", get_port("bank"))
- obj.cfg_put("bank", "serve", "uwsgi")
- obj.cfg_put("bank", "uwsgi_serve", "unix")
- obj.cfg_put("bank", "uwsgi_unixpath", "$HOME/sockets/bank.uwsgi")
- obj.cfg_put("bank", "uwsgi_unixpath_mode", "660")
obj.cfg_put("bank", "database", "taler"+obj.envname)
obj.cfg_put("bank", "max_debt", "%s:500.0" % obj.currency)
obj.cfg_put("bank", "max_debt_bank", "%s:1000000000.0" % obj.currency)
@@ -104,8 +107,13 @@ def config(obj):
obj.cfg_put("backoffice-all", "uwsgi_unixpath", "$HOME/sockets/backoffice.uwsgi")
obj.cfg_put("backoffice-all", "instances", "FSF default Tor")
- obj.cfg_put("merchant", "serve", "unix")
- obj.cfg_put("merchant", "unixpath", "$HOME/sockets/merchant.http")
+ if obj.envname != "local":
+ obj.cfg_put("merchant", "serve", "unix")
+ obj.cfg_put("merchant", "unixpath", "$HOME/sockets/merchant.http")
+ else
+ obj.cfg_put("merchant", "serve", "tcp")
+ obj.cfg_put("merchant", "port", get_port(urls["merchant_backend"]))
+
obj.cfg_put("merchant", "wire_transfer_delay", "0 s")
obj.cfg_put("merchant", "default_max_wire_fee", obj.currency + ":" + "0.01")
obj.cfg_put("merchant", "default_max_deposit_fee", obj.currency + ":" + "0.05")
@@ -124,8 +132,14 @@ def config(obj):
obj.cfg_put("auditor", "tiny_amount", obj.currency + ":0.01")
obj.cfg_put("exchange", "base_url", urls["exchange"])
- obj.cfg_put("exchange", "serve", "unix")
- obj.cfg_put("exchange", "unixpath", "$HOME/sockets/exchange.http")
+
+ if obj.envname != "local":
+ obj.cfg_put("exchange", "serve", "unix")
+ obj.cfg_put("exchange", "unixpath", "$HOME/sockets/exchange.http")
+ else:
+ obj.cfg_put("exchange", "serve", "tcp")
+ obj.cfg_put("exchange", "port", get_port(urls["exchange"]))
+
obj.cfg_put("exchange", "master_public_key", obj.exchange_pub)
obj.cfg_put("exchange", "terms_etag", "0")
obj.cfg_put("exchange", "terms_dir", "$HOME/local/share/taler-exchange/tos")
diff --git a/bin/taler_urls.py b/bin/taler_urls.py
@@ -1,3 +1,5 @@
+from urllib.parse import urlparse
+
taler_urls = dict(
online = dict(
donations = "https://donations.{}.taler.net/",
@@ -34,4 +36,6 @@ def get_urls(envname):
for k, v in taler_urls["online"].items()
)
-
+def get_port(localhost_url):
+ parsed = urlparse(localhost_url)
+ return parsed.port