diff options
author | Antoine A <> | 2024-02-18 21:36:23 +0100 |
---|---|---|
committer | Antoine A <> | 2024-02-18 21:36:23 +0100 |
commit | 084f513305ab7e34fd4d1c9510dceff9553c9f3b (patch) | |
tree | c8978f207a1e1913267ccd2b1afc1ec8be27e214 | |
parent | 5b5f34cbf21c79913368c9c032eb705ddbce394e (diff) | |
download | libeufin-084f513305ab7e34fd4d1c9510dceff9553c9f3b.tar.gz libeufin-084f513305ab7e34fd4d1c9510dceff9553c9f3b.tar.bz2 libeufin-084f513305ab7e34fd4d1c9510dceff9553c9f3b.zip |
Fix libeufin listening only on ipv4 or ipv6 on localhost
-rw-r--r-- | bank/build.gradle | 1 | ||||
-rw-r--r-- | bank/src/main/kotlin/tech/libeufin/bank/Main.kt | 17 | ||||
-rw-r--r-- | nexus/build.gradle | 1 |
3 files changed, 10 insertions, 9 deletions
diff --git a/bank/build.gradle b/bank/build.gradle index 75f46bf8..9070480a 100644 --- 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 index 60b61f8b..5da9149f 100644 --- 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 index b510dba6..be202f45 100644 --- 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 { |