commit ddd4390f4cadbdf5d007847c2c4ab309128209e3
parent 70de4fedd2fbd127f58c9e8e05ffb4a641345248
Author: Antoine A <>
Date: Wed, 29 Nov 2023 14:14:37 +0000
Add more config defaults
Diffstat:
4 files changed, 39 insertions(+), 17 deletions(-)
diff --git a/bank/src/main/kotlin/tech/libeufin/bank/Config.kt b/bank/src/main/kotlin/tech/libeufin/bank/Config.kt
@@ -112,10 +112,10 @@ fun TalerConfig.loadBankConfig(): BankConfig = catchError {
regionalCurrencySpec = currencySpecificationFor(regionalCurrency),
allowRegistration = lookupBoolean("libeufin-bank", "allow_registration") ?: false,
allowAccountDeletion = lookupBoolean("libeufin-bank", "allow_account_deletion") ?: false,
- defaultCustomerDebtLimit = requireAmount("libeufin-bank", "default_customer_debt_limit", regionalCurrency),
+ defaultCustomerDebtLimit = amount("libeufin-bank", "default_customer_debt_limit", regionalCurrency) ?: TalerAmount(0, 0, regionalCurrency),
+ defaultAdminDebtLimit = amount("libeufin-bank", "default_admin_debt_limit", regionalCurrency) ?: TalerAmount(0, 0, regionalCurrency),
registrationBonus = amount("libeufin-bank", "registration_bonus", regionalCurrency) ?: TalerAmount(0, 0, regionalCurrency),
suggestedWithdrawalExchange = lookupString("libeufin-bank", "suggested_withdrawal_exchange"),
- defaultAdminDebtLimit = requireAmount("libeufin-bank", "default_admin_debt_limit", regionalCurrency),
spaCaptchaURL = lookupString("libeufin-bank", "spa_captcha_url"),
spaPath = lookupPath("libeufin-bank", "spa"),
allowConversion = allowConversion,
diff --git a/contrib/bank.conf b/contrib/bank.conf
@@ -3,13 +3,13 @@
# Internal currency of the libeufin-bank
#CURRENCY = KUDOS
-# Default debt limit for newly created customer accounts
+# Default debt limit for newly created customer accounts Default is CURRENCY:0
#DEFAULT_CUSTOMER_DEBT_LIMIT = KUDOS:200
-# Default debt limit of the admin. Typically higher, since sign-up bonuses and cashin are deducted from the admin account.
+# Default debt limit of the admin. Typically higher, since sign-up bonuses and cashin are deducted from the admin account. Default is CURRENCY:0
#DEFAULT_ADMIN_DEBT_LIMIT = KUDOS:20000000
-# Value of the registration bonus for new users. Default is "CURRENCY:0"
+# Value of the registration bonus for new users. Default is CURRENCY:0
#REGISTRATION_BONUS = KUDOS:100
# Allow account registration by anyone.
@@ -24,10 +24,10 @@
# External currency used during cashin and cashout
#FIAT_CURRENCY = EUR
-# Path to TAN challenge transmission script via sms. If not specified, this TAN channel wil be unuspported.
+# Path to TAN challenge transmission script via sms. If not specified, this TAN channel will not be supported.
#TAN_SMS =
-# Path to TAN challenge transmission script via email. If not specified, this TAN channel wil be unuspported.
+# Path to TAN challenge transmission script via email. If not specified, this TAN channel will not be supported.
#TAN_EMAIL =
# How "libeufin-bank serve" serves its API, this can either be tcp or unix
diff --git a/integration/conf/mini.conf b/integration/conf/mini.conf
@@ -0,0 +1,7 @@
+[libeufin-bank]
+CURRENCY = KUDOS
+SERVE = tcp
+PORT = 8090
+
+[libeufin-bankdb-postgres]
+CONFIG = postgresql:///libeufincheck
+\ No newline at end of file
diff --git a/integration/test/IntegrationTest.kt b/integration/test/IntegrationTest.kt
@@ -57,11 +57,32 @@ fun randBytes(lenght: Int): ByteArray {
}
class IntegrationTest {
+ val nexusCmd = LibeufinNexusCommand()
+ val bankCmd = LibeufinBankCommand();
+ val client = HttpClient(CIO) {
+ install(HttpRequestRetry) {
+ maxRetries = 10
+ constantDelay(200, 100)
+ }
+ }
+
+ @Test
+ fun mini() {
+ bankCmd.run("dbinit -c conf/mini.conf -r")
+ bankCmd.run("passwd admin password -c conf/mini.conf")
+ kotlin.concurrent.thread(isDaemon = true) {
+ bankCmd.run("serve -c conf/mini.conf")
+ }
+
+ runBlocking {
+ // Check bank is running
+ client.get("http://0.0.0.0:8090/public-accounts").assertNoContent()
+ }
+ }
+
@Test
- fun db() {
- val nexusCmd = LibeufinNexusCommand()
+ fun conversion() {
nexusCmd.run("dbinit -c conf/integration.conf -r")
- val bankCmd = LibeufinBankCommand();
bankCmd.run("dbinit -c conf/integration.conf -r")
bankCmd.run("passwd admin password -c conf/integration.conf")
val json = obj {
@@ -76,13 +97,6 @@ class IntegrationTest {
}
runBlocking {
- val client = HttpClient(CIO) {
- install(HttpRequestRetry) {
- maxRetries = 10
- constantDelay(200, 100)
- }
- }
-
val nexusDb = NexusDb("postgresql:///libeufincheck")
val userPayTo = IbanPayTo(genIbanPaytoUri())
val fiatPayTo = IbanPayTo(genIbanPaytoUri())