diff --git a/host-cache/build.gradle b/host-cache/build.gradle index 9bdc70e0..86761c1c 100644 --- a/host-cache/build.gradle +++ b/host-cache/build.gradle @@ -6,5 +6,5 @@ dependencies { compile "net.i2p:i2p:${i2pVersion}" testCompile 'org.junit.jupiter:junit-jupiter-api:5.4.2' testCompile 'junit:junit:4.12' - testCompile 'org.codehaus.groovy:groovy-all:2.4.15' + testCompile "org.codehaus.groovy:groovy-all:${groovyVersion}" } diff --git a/host-cache/src/main/groovy/com/muwire/hostcache/HostCache.groovy b/host-cache/src/main/groovy/com/muwire/hostcache/HostCache.groovy index 13e14d76..9100ab9c 100644 --- a/host-cache/src/main/groovy/com/muwire/hostcache/HostCache.groovy +++ b/host-cache/src/main/groovy/com/muwire/hostcache/HostCache.groovy @@ -51,8 +51,13 @@ public class HostCache { println myDest.toBase64() } - def props = System.getProperties().clone() - props.putAt("inbound.nickname", "MuWire HostCache") + Properties props = System.getProperties().clone() + props["inbound.nickname"] = "MuWire HostCache" + + def i2pPropsFile = new File(home,"i2p.properties") + if (i2pPropsFile.exists()) { + i2pPropsFile.withInputStream { props.load(it) } + } session = i2pClient.createSession(new FileInputStream(keyfile), props) myDest = session.getMyDestination() diff --git a/update-server/src/main/groovy/com/muwire/update/UpdateServer.groovy b/update-server/src/main/groovy/com/muwire/update/UpdateServer.groovy index 82bea81c..3e89d53c 100644 --- a/update-server/src/main/groovy/com/muwire/update/UpdateServer.groovy +++ b/update-server/src/main/groovy/com/muwire/update/UpdateServer.groovy @@ -42,8 +42,12 @@ class UpdateServer { System.exit(1) } - def props = System.getProperties().clone() - props.putAt("inbound.nickname", "MuWire UpdateServer") + Properties props = System.getProperties().clone() + props["inbound.nickname"] = "MuWire UpdateServer" + def i2pPropsFile = new File(home, "i2p.properties") + if (i2pPropsFile.exists()) { + i2pPropsFile.withInputStream { props.load(it) } + } session = i2pClient.createSession(new FileInputStream(keyFile), props) myDest = session.getMyDestination()