From 5435518212245176a4f78bce5f9faff45b3d1eaa Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Tue, 4 Jun 2019 20:20:25 +0100 Subject: [PATCH] core-side i2cp options --- core/src/main/groovy/com/muwire/core/Core.groovy | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/core/src/main/groovy/com/muwire/core/Core.groovy b/core/src/main/groovy/com/muwire/core/Core.groovy index 6d604edb..9bfaf1dc 100644 --- a/core/src/main/groovy/com/muwire/core/Core.groovy +++ b/core/src/main/groovy/com/muwire/core/Core.groovy @@ -56,6 +56,7 @@ public class Core { final EventBus eventBus final Persona me final File home + final Properties i2pOptions private final TrustService trustService private final PersisterService persisterService @@ -83,12 +84,19 @@ public class Core { } } - def sysProps = System.getProperties().clone() - sysProps["inbound.nickname"] = "MuWire" + i2pOptions = new Properties() + def i2pOptionsFile = new File(home,"i2p.properties") + if (i2pOptionsFile.exists()) { + i2pOptionsFile.withInputStream { i2pOptions.load(it) } + } else { + i2pOptions["inbound.nickname"] = "MuWire" + } + + // options like tunnel length and quantity I2PSession i2pSession I2PSocketManager socketManager keyDat.withInputStream { - socketManager = new I2PSocketManagerFactory().createManager(it, sysProps) + socketManager = new I2PSocketManagerFactory().createManager(it, i2pOptions) } socketManager.getDefaultOptions().setReadTimeout(60000) socketManager.getDefaultOptions().setConnectTimeout(30000)