diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-04-14 23:58:50 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-04-14 23:58:50 +0200 |
commit | b425532268ffacb23eb95ee78a875dafbe603265 (patch) | |
tree | c59097240a9bab892e7385510f9b5c0a03b6cf1f /bin/WIP | |
parent | 59bf9fc2047cd41592758f28ee72dfef214a447b (diff) | |
download | deployment-b425532268ffacb23eb95ee78a875dafbe603265.tar.gz deployment-b425532268ffacb23eb95ee78a875dafbe603265.tar.bz2 deployment-b425532268ffacb23eb95ee78a875dafbe603265.zip |
remove Anastasis from buildbot deployment
Diffstat (limited to 'bin/WIP')
-rwxr-xr-x | bin/WIP/taler-local | 122 |
1 files changed, 30 insertions, 92 deletions
diff --git a/bin/WIP/taler-local b/bin/WIP/taler-local index 2a9058b..7ec4dc4 100755 --- a/bin/WIP/taler-local +++ b/bin/WIP/taler-local @@ -201,22 +201,6 @@ def build_sync(r, p): (p / "taler-buildstamp").touch() -def build_anastasis(r, p): - update_checkout(r, p) - subprocess.run(["./bootstrap"], check=True) - pfx = Path.home() / ".local" - default_configure( - "CFLAGS=-ggdb -O0", - "--enable-logging=verbose", - f"--with-microhttpd={pfx}", - f"--with-exchange={pfx}", - f"--with-merchant={pfx}", - f"--with-gnunet={pfx}", - "--disable-doc", - ) - subprocess.run(["make", "install"], check=True) - (p / "taler-buildstamp").touch() - def build_demos(r, p): update_checkout(r, p) @@ -266,15 +250,6 @@ repos = { "libmicrohttpd"], build_sync, ), - "anastasis": Repo( - "anastasis", - "git://git.taler.net/anastasis", - ["exchange", - "merchant", - "libmicrohttpd", - "gnunet"], - build_anastasis, - ), "wallet-core": Repo( "wallet-core", "git://git.taler.net/wallet-core", @@ -399,7 +374,7 @@ def build(without_repos, only_repos) -> None: "--repos", "-r", metavar="REPOS", help="REPOS is a unspaced and comma-separated list of the repositories to clone.", - default="libmicrohttpd,gnunet,exchange,merchant,wallet-core,taler-merchant-demos,sync,anastasis,libeufin", + default="libmicrohttpd,gnunet,exchange,merchant,wallet-core,taler-merchant-demos,sync,libeufin", show_default=True, ) @click.option( @@ -427,7 +402,7 @@ def bootstrap(list_repos, repos) -> None: r_dir.mkdir(parents=True, exist_ok=True) subprocess.run(["git", "-C", str(sources), "clone", r.url], check=True) - reposList = split_repos_list(repos) + reposList = split_repos_list(repos) checkout_repos(load_repos(reposList)) # Globals sharead accross multiple sub-commands: @@ -494,7 +469,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): if reason: print("ERROR:", reason) exit(1) - + def kill(proc): proc.terminate() proc.wait() @@ -509,7 +484,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): env["LIBEUFIN_NEXUS_PASSWORD"] = password env["LIBEUFIN_NEXUS_URL"] = nexus_url return env - + def get_sandbox_cli_env( username, password ): @@ -620,7 +595,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): sandbox_url, bank_account_label, password, - ): + ): customer_env = os.environ.copy() customer_env["LIBEUFIN_SANDBOX_USERNAME"] = bank_account_label customer_env["LIBEUFIN_SANDBOX_PASSWORD"] = password @@ -673,7 +648,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): ], env = admin_env ).run() - + WIRE_METHOD = "iban" # euFin URLs @@ -709,7 +684,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): username = "sandbox-account-survey", password = ALL_INSTANCES_BANK_PASSWORD )).run() - + def get_random_iban(): cc_no_check = 131400 # is "DE00" bban = "".join(random.choices("0123456789", k=4)) @@ -717,7 +692,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): return "DE" + (f"0{check_digits}"[-2:]) + bban # IBANs - + IBAN_MERCHANT_DEFAULT = get_random_iban() IBAN_MERCHANT_DEMOSHOP = get_random_iban() @@ -729,7 +704,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): dict(name="survey"), dict(name="blog"), ] - + # Credentials / API keys EXCHANGE_NEXUS_USERNAME = "exchange-nexus-user" EXCHANGE_NEXUS_PASSWORD = "exchange-nexus-password" @@ -738,7 +713,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): ALL_INSTANCES_BANK_PASSWORD = "secret" EXCHANGE_BANK_ACCOUNT_SANDBOX = "sandbox-account-exchange" EXCHANGE_BANK_ACCOUNT_PASSWORD = "secret" - + # EBICS EBICS_HOST_ID = "ebicsDeployedHost" EXCHANGE_EBICS_USER_ID = "exchangeEbicsUserId" @@ -806,15 +781,15 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): def __init__(self, filename): self.sections = OrderedDict() self.filename = filename - + def destroy(self): del self.sections self.sections = OrderedDict() - + def cfg_put(self, section_name, key, value): s = self.sections[section_name] = self.sections.get(section_name, OrderedDict()) s[key] = value - + def cfg_write(self, outdir): if outdir: if not os.path.isdir(outdir): @@ -822,7 +797,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): fstream = open(os.path.join(outdir, self.filename), "w") else: fstream = open(sys.stdout) - + for section_name, section in self.sections.items(): fstream.write("[" + section_name + "]" + "\n") for key, value in section.items(): @@ -891,7 +866,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): obj.cfg_put(sec, "fee_refund", currency + ":" + f_refund) obj.cfg_put(sec, "fee_deposit", currency + ":" + f_deposit) obj.cfg_put(sec, "rsa_keysize", rsa_keysize) - + obj = ConfigFile("taler.conf") obj.cfg_put("paths", "TALER_DATA_HOME", str(TALER_DATA_DIR)) if not taler_runtime_dir.is_dir(): @@ -899,7 +874,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): obj.cfg_put("paths", "TALER_RUNTIME_DIR", str(taler_runtime_dir)) obj.cfg_put("taler", "CURRENCY", currency) obj.cfg_put("taler", "CURRENCY_ROUND_UNIT", f"{currency}:0.01") - + obj.cfg_put("bank", "serve", "uwsgi") obj.cfg_put("bank", "uwsgi_serve", "unix") obj.cfg_put("bank", "uwsgi_unixpath", str(unix_sockets_dir / "bank.sock")) @@ -911,35 +886,35 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): obj.cfg_put("bank", "base_url", rev_proxy_url + "/bank/") obj.cfg_put("bank", "database", f"postgres:///{postgres_db_name}") obj.cfg_put("bank", "suggested_exchange", rev_proxy_url + "/exchange/") - + obj.cfg_put("donations", "serve", "http") obj.cfg_put("donations", "http_serve", "unix") obj.cfg_put("donations", "http_unixpath", str(unix_sockets_dir / "donations.sock")) obj.cfg_put("donations", "http_unixpath_mode", "660") - + obj.cfg_put("landing", "serve", "http") obj.cfg_put("landing", "http_serve", "unix") obj.cfg_put("landing", "http_unixpath", str(unix_sockets_dir / "landing.sock")) obj.cfg_put("landing", "http_unixpath_mode", "660") - + obj.cfg_put("blog", "serve", "http") obj.cfg_put("blog", "http_serve", "unix") obj.cfg_put("blog", "http_unixpath", str(unix_sockets_dir / "blog.sock")) obj.cfg_put("blog", "http_unixpath_mode", "660") - + obj.cfg_put("survey", "serve", "http") obj.cfg_put("survey", "http_serve", "unix") obj.cfg_put("survey", "http_unixpath", str(unix_sockets_dir / "survey.sock")) obj.cfg_put("survey", "http_unixpath_mode", "660") obj.cfg_put("survey", "bank_password", "x") - + obj.cfg_put("merchant", "serve", "unix") obj.cfg_put("merchant", "unixpath", str(unix_sockets_dir / "merchant-backend.sock")) obj.cfg_put("merchant", "wire_transfer_delay", "0 s") obj.cfg_put("merchant", "default_max_wire_fee", currency + ":" + "0.01") obj.cfg_put("merchant", "default_max_deposit_fee", currency + ":" + "0.05") obj.cfg_put("merchantdb-postgres", "config", f"postgres:///{postgres_db_name}") - + obj.cfg_put("frontends", "backend", rev_proxy_url + "/merchant-backend/") obj.cfg_put( "merchant-exchange-{}".format(currency), @@ -955,7 +930,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): obj.cfg_put("auditor", "auditor_url", rev_proxy_url + "/auditor") obj.cfg_put("auditor", "unixpath", str(unix_sockets_dir / "auditor.sock")) obj.cfg_put("auditor", "tiny_amount", currency + ":0.01") - + obj.cfg_put( "taler-exchange-secmod-eddsa", "unixpath", @@ -984,7 +959,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): obj.cfg_put("exchange", "terms_dir", "$HOME/.local/share/taler-exchange/tos") obj.cfg_put("exchange", "privacy_etag", "0") obj.cfg_put("exchange", "privacy_dir", "$HOME/.local/share/taler-exchange/pp") - + obj.cfg_put("exchangedb-postgres", "db_conn_str", f"postgres:///{postgres_db_name}") obj.cfg_put("exchangedb-postgres", "config", f"postgres:///{postgres_db_name}") obj.cfg_put("auditordb-postgres", "db_conn_str", f"postgres:///{postgres_db_name}") @@ -996,7 +971,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): "${TALER_DATA_HOME}/merchant/wire/merchant.json", ) obj.cfg_put("merchant-account-merchant", "wire_file_mode", "770") - + obj.cfg_put("frontends", "backend_apikey", f"{frontend_api_key}") coin(obj, currency, "ct_10", "0.10") coin(obj, currency, "1", "1") @@ -1006,7 +981,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): coin(obj, currency, "1000", "1000") obj.cfg_write(outdir) return obj - + def config_sync( filename, outdir, unix_sockets_dir, @@ -1024,32 +999,6 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): obj.cfg_put("sync", "payment_backend_url", rev_proxy_url + "merchant-backend/instances/Taler/") obj.cfg_put("syncdb-postgres", "config", f"postgres:///{postgres_db_name}") obj.cfg_write(outdir) - - def config_anastasis( - filename, outdir, - unix_sockets_dir, - currency, rev_proxy_url, - api_key, postgres_db_name): - obj = ConfigFile(filename) - obj.cfg_put("taler", "currency", currency) - obj.cfg_put("anastasis", "serve", "unix") - obj.cfg_put("anastasis", "business_name", f"GNU Taler Demo Anastasis Provider") - obj.cfg_put("anastasis", "unixpath", str(unix_sockets_dir / "anastasis.sock")) - obj.cfg_put("anastasis", "annual_fee", f"{currency}:0") - obj.cfg_put("anastasis", "question_cost", f"{currency}:0") - obj.cfg_put("anastasis", "insurance", f"{currency}:0") - obj.cfg_put("anastasis", "truth_upload_fee", f"{currency}:0") - obj.cfg_put("anastasis", "fulfillment_url", "taler://fulfillment-success/") - obj.cfg_put("anastasis", "server_salt", "kreb3ia9dmj43gfa") - obj.cfg_put("stasis-postgres", "config", f"postgres:///{postgres_db_name}") - obj.cfg_put("anastasis-merchant-backend", - "payment_backend_url", - rev_proxy_url + "merchant-backend/instances/anastasis/" - ) - obj.cfg_put("anastasis-merchant-backend", "api_key", f"Bearer secret-token:{api_key}") - obj.cfg_put("authorization-question", "cost", f"{currency}:0") - obj.cfg_put("authorization-question", "enabled", "yes") - obj.cfg_write(outdir) def unit_file_content(description, cmd, env=None): executable_name = cmd.split(" ")[0].split("/")[-1] @@ -1065,7 +1014,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): content += f"\nEnvironmentFile={env}" return content - + print_nn("Ensure no service is running...") if is_serving(REV_PROXY_URL + "/", tries=3): fail("Reverse proxy is unexpectedly running!") @@ -1277,17 +1226,6 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): postgres_db_name=postgres_db_name ) print(" OK") - print_nn("Generating anastasis.conf...") - config_anastasis( - "anastasis.conf", - outdir=CFG_OUTDIR, - unix_sockets_dir=UNIX_SOCKETS_DIR, - currency=CURRENCY, - rev_proxy_url=get_link(), - api_key=FRONTENDS_API_TOKEN, - postgres_db_name=postgres_db_name - ) - print(" OK") print_nn("Reset and init exchange DB..") Command([ f"{TALER_PREFIX}/bin/taler-exchange-dbinit", @@ -1452,7 +1390,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): "-c", CFG_OUTDIR / "taler.conf", "enable-account", EXCHANGE_PAYTO, "upload" ]).run() - print(" OK") + print(" OK") # Give each instance a Sandbox account (note: 'default' # won't have one, as it should typically only manage other @@ -1605,7 +1543,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): ).run() ## Step 6: Set up merchant - + print_nn("Reset and init merchant database...") Command([ f"{TALER_PREFIX}/bin/taler-merchant-dbinit", @@ -1613,7 +1551,7 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name): "--reset" ]).run() print(" OK") - + def ensure_instance( currency, instance_id, |