summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorms <ms@taler.net>2022-01-12 20:25:42 +0100
committerms <ms@taler.net>2022-01-12 20:25:42 +0100
commit2732c2740260aa38c2f5980c82d06baec6340a08 (patch)
tree35905cd17aff6be7a01705a5b0d8c5d9b7d42686
parent91ff0bdc9cfe5e2ce00238416cd712e322b3ee25 (diff)
downloaddeployment-2732c2740260aa38c2f5980c82d06baec6340a08.tar.gz
deployment-2732c2740260aa38c2f5980c82d06baec6340a08.tar.bz2
deployment-2732c2740260aa38c2f5980c82d06baec6340a08.zip
deploy public bank accounts
-rwxr-xr-xbin/WIP/taler-local42
1 files changed, 23 insertions, 19 deletions
diff --git a/bin/WIP/taler-local b/bin/WIP/taler-local
index 4a607d2..76b9ffe 100755
--- a/bin/WIP/taler-local
+++ b/bin/WIP/taler-local
@@ -645,20 +645,21 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name):
# This value is BOTH a username
# and a bank account label.
bank_account_name,
- password
+ password,
+ is_public=False
):
demobank_url = urljoin_nodrop(sandbox_url, "/demobanks/default")
user_env = os.environ.copy()
user_env["LIBEUFIN_SANDBOX_USERNAME"] = bank_account_name
user_env["LIBEUFIN_SANDBOX_PASSWORD"] = password
- Command(
- [
- f"{TALER_PREFIX}/bin/libeufin-cli", "sandbox",
- "--sandbox-url", demobank_url,
- "demobank", "register"
- ],
- env = user_env
- ).run()
+ register_cmd = [
+ f"{TALER_PREFIX}/bin/libeufin-cli",
+ "sandbox", "--sandbox-url", demobank_url,
+ "demobank", "register"
+ ]
+ if is_public:
+ register_cmd.append("--public")
+ Command(register_cmd, env = user_env).run()
admin_env = os.environ.copy()
admin_env["LIBEUFIN_SANDBOX_USERNAME"] = SANDBOX_ADMIN_USERNAME
admin_env["LIBEUFIN_SANDBOX_PASSWORD"] = SANDBOX_ADMIN_PASSWORD
@@ -723,11 +724,11 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name):
# Instances
INSTANCES = [
- "GNUnet",
- "Taler",
- "Tor",
- "survey",
- "blog"
+ dict(name="GNUnet", isPublic=True),
+ dict(name="Taler", isPublic=True),
+ dict(name="Tor", isPublic=True),
+ dict(name="survey"),
+ dict(name="blog"),
]
# Credentials / API keys
@@ -1430,10 +1431,11 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name):
]).run()
print(" OK")
- # Give each instance a Sandbox account (note: 'default')
+ # Give each instance a Sandbox account (note: 'default'
# won't have one, as it should typically only manage other
- # instances.
- for instance_id in INSTANCES:
+ # instances).
+ for instance in INSTANCES:
+ instance_id = instance["name"]
print_nn(f"Create account of {instance_id} at Sandbox...")
prepare_sandbox_account(
sandbox_url=SANDBOX_URL,
@@ -1442,7 +1444,8 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name):
ebics_user_id=f"unused{instance_id}EbicsUserId",
person_name=f"Shop Owner of {instance_id}",
bank_account_name=f"sandbox-account-{instance_id.lower()}",
- password=ALL_INSTANCES_BANK_PASSWORD
+ password=ALL_INSTANCES_BANK_PASSWORD,
+ is_public=instance.get("isPublic")
)
print(" OK")
print_nn("Create Customer account at Sandbox...")
@@ -1671,7 +1674,8 @@ def prepare(x_forwarded_host, x_forwarded_proto, postgres_db_name):
fail(f"Merchant backend did not re start correctly.")
print(" OK")
- for instance_id in INSTANCES:
+ for instance in INSTANCES:
+ instance_id = instance["name"]
print_nn(f"Creating the {instance_id} instance...")
ensure_instance(
currency=CURRENCY,