From eb2ab88f1c7620461afbe14850c3462ea7247923 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sun, 17 Nov 2024 12:12:41 +0100 Subject: [PATCH] kvernberg/taler/bank: init --- hosts/kvernberg/services/pvvvvvv/bank.nix | 40 +++++++++++++++++++ hosts/kvernberg/services/pvvvvvv/default.nix | 1 + hosts/kvernberg/services/pvvvvvv/exchange.nix | 13 +++++- 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 hosts/kvernberg/services/pvvvvvv/bank.nix diff --git a/hosts/kvernberg/services/pvvvvvv/bank.nix b/hosts/kvernberg/services/pvvvvvv/bank.nix new file mode 100644 index 0000000..ab067c5 --- /dev/null +++ b/hosts/kvernberg/services/pvvvvvv/bank.nix @@ -0,0 +1,40 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.services.libeufin.bank; + tcfg = config.services.taler; + inherit (tcfg.settings.taler) CURRENCY; +in { + services.libeufin.bank = { + enable = true; + debug = true; + openFirewall = true; + createLocalDatabase = true; + initialAccounts = [ + { username = "exchange"; + password = "exchange"; + name = "Exchange"; + } + ]; + settings = { + libeufin-bank = { + WIRE_TYPE = "x-taler-bank"; + X_TALER_BANK_PAYTO_HOSTNAME = "kvernberg.pvv.ntnu.no:8082"; + BASE_URL = "kvernberg.pvv.ntnu.no:8082"; + + ALLOW_REGISTRATION = "yes"; + + REGISTRATION_BONUS_ENABLED = "yes"; + REGISTRATION_BONUS = "${CURRENCY}:100"; + + DEFAULT_DEBT_LIMIT = "${CURRENCY}:500"; + + ALLOW_CONVERSION = "no"; + ALLOW_EDIT_CASHOUT_PAYTO_URI = "yes"; + + SUGGESTED_WITHDRAWAL_EXCHANGE = "http://kvernberg.pvv.ntnu.no:8081/"; + + inherit CURRENCY; + }; + }; + }; +} diff --git a/hosts/kvernberg/services/pvvvvvv/default.nix b/hosts/kvernberg/services/pvvvvvv/default.nix index ddb1f36..daafe0b 100644 --- a/hosts/kvernberg/services/pvvvvvv/default.nix +++ b/hosts/kvernberg/services/pvvvvvv/default.nix @@ -1,6 +1,7 @@ { imports = [ ./exchange.nix + ./bank.nix ]; services.taler = { diff --git a/hosts/kvernberg/services/pvvvvvv/exchange.nix b/hosts/kvernberg/services/pvvvvvv/exchange.nix index e5abf19..6e34e3b 100644 --- a/hosts/kvernberg/services/pvvvvvv/exchange.nix +++ b/hosts/kvernberg/services/pvvvvvv/exchange.nix @@ -14,7 +14,7 @@ in { openFirewall = true; denominationConfig = '' ## Old denomination names cannot be used again - #[COIN-${CURRENCY}-k1-1-0] + # [COIN-${CURRENCY}-k1-1-0] ## NOK Denominations [coin-${CURRENCY}-nok-1-0] @@ -147,6 +147,17 @@ in { exchange-offline = { MASTER_PRIV_FILE = config.sops.secrets.exchange-offline-master.path; }; + exchange-account-test = { + PAYTO_URI = "payto://x-taler-bank/bank:8082/exchange?receiver-name=Exchange"; + ENABLE_DEBIT = "YES"; + ENABLE_CREDIT = "YES"; + }; + exchange-accountcredentials-test = { + WIRE_GATEWAY_URL = "http://kvernberg.pvv.ntnu.no:8082/accounts/exchange/taler-wire-gateway/"; + WIRE_GATEWAY_AUTH_METHOD = "BASIC"; + USERNAME = "exchange"; + PASSWORD = "exchange"; + }; }; }; }