[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: Read webui URL from the config.
From: |
gnunet |
Subject: |
[libeufin] branch master updated: Read webui URL from the config. |
Date: |
Thu, 03 Nov 2022 12:40:52 +0100 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new 172c84cd Read webui URL from the config.
172c84cd is described below
commit 172c84cd04ab9eb3e08a45e0f03cb64c8f91b014
Author: MS <ms@taler.net>
AuthorDate: Thu Nov 3 12:39:08 2022 +0100
Read webui URL from the config.
That helps when not running behind a reverse proxy.
---
sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt | 6 ++----
sandbox/src/main/kotlin/tech/libeufin/sandbox/JSON.kt | 3 ++-
sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 18 +++++++-----------
3 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
index 4ae592ef..b577d0c4 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
@@ -19,7 +19,6 @@
package tech.libeufin.sandbox
-import io.ktor.http.*
import org.jetbrains.exposed.dao.Entity
import org.jetbrains.exposed.dao.EntityClass
import org.jetbrains.exposed.dao.IntEntity
@@ -33,7 +32,6 @@ import org.jetbrains.exposed.dao.id.LongIdTable
import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.transactions.TransactionManager
import org.jetbrains.exposed.sql.transactions.transaction
-import tech.libeufin.util.internalServerError
import java.sql.Connection
/**
@@ -98,7 +96,7 @@ object DemobankConfigsTable : LongIdTable() {
val name = text("hostname")
val suggestedExchangeBaseUrl = text("suggestedExchangeBaseUrl").nullable()
val suggestedExchangePayto = text("suggestedExchangePayto").nullable()
- val uiTitle = text("uiTitle")
+ val captchaUrl = text("captchaUrl").nullable()
}
class DemobankConfigEntity(id: EntityID<Long>) : LongEntity(id) {
@@ -109,9 +107,9 @@ class DemobankConfigEntity(id: EntityID<Long>) :
LongEntity(id) {
var bankDebtLimit by DemobankConfigsTable.bankDebtLimit
var usersDebtLimit by DemobankConfigsTable.usersDebtLimit
var name by DemobankConfigsTable.name
+ var captchaUrl by DemobankConfigsTable.captchaUrl
var suggestedExchangeBaseUrl by
DemobankConfigsTable.suggestedExchangeBaseUrl
var suggestedExchangePayto by DemobankConfigsTable.suggestedExchangePayto
- var uiTitle by DemobankConfigsTable.uiTitle
}
/**
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/JSON.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/JSON.kt
index 8e749416..0772919a 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/JSON.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/JSON.kt
@@ -125,7 +125,8 @@ data class TalerWithdrawalStatus(
val suggested_exchange: String? = null,
val sender_wire: String? = null,
val aborted: Boolean,
- val confirm_transfer_url: String
+ // Not needed with CLI wallets.
+ val confirm_transfer_url: String?
)
data class TalerWithdrawalSelection(
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index b6819a4d..39e9d6b2 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -75,7 +75,6 @@ import org.slf4j.event.Level
import org.w3c.dom.Document
import startServer
import tech.libeufin.util.*
-import java.io.*
import java.math.BigDecimal
import java.net.BindException
import java.net.URL
@@ -143,9 +142,9 @@ class Config : CliktCommand(
"--show",
help = "Only show values, other options will be ignored."
).flag("--no-show", default = false)
- private val uiTitleOption by option(
- "--ui-title", help = "Title of the Web UI"
- ).default("Demo Bank")
+ private val captchaUrl by option(
+ "--captcha-url", help = "Needed for browser wallets."
+ )
private val currencyOption by option("--currency").default("EUR")
private val bankDebtLimitOption by
option("--bank-debt-limit").int().default(1000000)
private val usersDebtLimitOption by
option("--users-debt-limit").int().default(1000)
@@ -180,7 +179,7 @@ class Config : CliktCommand(
val allowRegistrations =
maybeDemobank.demoBank.allowRegistrations
val name = maybeDemobank.demoBank.name //
always 'default'
val withSignupBonus =
maybeDemobank.demoBank.withSignupBonus
- val uiTitle = maybeDemobank.demoBank.uiTitle
+ val webuiUrl =
maybeDemobank.demoBank.captchaUrl
})
)
return@transaction
@@ -196,7 +195,7 @@ class Config : CliktCommand(
allowRegistrations = allowRegistrationsOption
name = nameArgument
this.withSignupBonus = withSignupBonusOption
- uiTitle = uiTitleOption
+ captchaUrl = captchaUrl
}
BankAccountEntity.new {
iban = getIban()
@@ -214,7 +213,6 @@ class Config : CliktCommand(
maybeDemobank.demoBank.allowRegistrations =
allowRegistrationsOption
maybeDemobank.demoBank.withSignupBonus = withSignupBonusOption
maybeDemobank.demoBank.name = nameArgument
- maybeDemobank.demoBank.uiTitle = uiTitleOption
}
}
}
@@ -1144,10 +1142,8 @@ val sandboxApp: Application.() -> Unit = {
)
}
val demobank = ensureDemobank(call)
- var captcha_page = call.request.header("X-Frontend-Uri")
?: call.request.getBaseUrl()
- if (!captcha_page.endsWith("/")) {
- captcha_page += "/"
- }
+ var captcha_page = demobank.captchaUrl
+ if (captcha_page == null) logger.warn("CAPTCHA URL not
found")
captcha_page += "demobanks/${demobank.name}"
val ret = TalerWithdrawalStatus(
selection_done = wo.selectionDone,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: Read webui URL from the config.,
gnunet <=