commit 084f513305ab7e34fd4d1c9510dceff9553c9f3b
parent 5b5f34cbf21c79913368c9c032eb705ddbce394e
Author: Antoine A <>
Date: Sun, 18 Feb 2024 21:36:23 +0100
Fix libeufin listening only on ipv4 or ipv6 on localhost
Diffstat:
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/bank/build.gradle b/bank/build.gradle
@@ -47,7 +47,6 @@ dependencies {
application {
mainClass = "tech.libeufin.bank.MainKt"
applicationName = "libeufin-bank"
- applicationDefaultJvmArgs = ['-Djava.net.preferIPv6Addresses=true']
}
shadowJar {
diff --git a/bank/src/main/kotlin/tech/libeufin/bank/Main.kt b/bank/src/main/kotlin/tech/libeufin/bank/Main.kt
@@ -55,6 +55,7 @@ import org.slf4j.event.Level
import tech.libeufin.bank.db.AccountDAO.*
import tech.libeufin.bank.db.Database
import tech.libeufin.common.*
+import java.net.InetAddress
import java.sql.SQLException
import java.util.zip.DataFormatException
import java.util.zip.Inflater
@@ -304,15 +305,17 @@ class ServeBank : CliktCommand("Run libeufin-bank HTTP server", name = "serve")
}
val env = applicationEngineEnvironment {
- connector {
- when (serverCfg) {
- is ServerConfig.Tcp -> {
- port = serverCfg.port
- host = serverCfg.addr
+ when (serverCfg) {
+ is ServerConfig.Tcp -> {
+ for (addr in InetAddress.getAllByName(serverCfg.addr)) {
+ connector {
+ port = serverCfg.port
+ host = addr.hostAddress
+ }
}
- is ServerConfig.Unix ->
- throw Exception("Can only serve libeufin-bank via TCP")
}
+ is ServerConfig.Unix ->
+ throw Exception("Can only serve libeufin-bank via TCP")
}
module { corebankWebApp(db, ctx) }
}
diff --git a/nexus/build.gradle b/nexus/build.gradle
@@ -50,7 +50,6 @@ dependencies {
application {
mainClassName = "tech.libeufin.nexus.MainKt"
applicationName = "libeufin-nexus"
- applicationDefaultJvmArgs = ['-Djava.net.preferIPv6Addresses=true']
}
run {