read i2p.properties from file

pull/53/head
Zlatin Balevsky 2020-06-11 17:38:17 +01:00
parent fb32690c7c
commit 0b8b489169
No known key found for this signature in database
GPG Key ID: A72832072D525E41
3 changed files with 14 additions and 5 deletions

View File

@ -6,5 +6,5 @@ dependencies {
compile "net.i2p:i2p:${i2pVersion}" compile "net.i2p:i2p:${i2pVersion}"
testCompile 'org.junit.jupiter:junit-jupiter-api:5.4.2' testCompile 'org.junit.jupiter:junit-jupiter-api:5.4.2'
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
testCompile 'org.codehaus.groovy:groovy-all:2.4.15' testCompile "org.codehaus.groovy:groovy-all:${groovyVersion}"
} }

View File

@ -51,8 +51,13 @@ public class HostCache {
println myDest.toBase64() println myDest.toBase64()
} }
def props = System.getProperties().clone() Properties props = System.getProperties().clone()
props.putAt("inbound.nickname", "MuWire HostCache") 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) session = i2pClient.createSession(new FileInputStream(keyfile), props)
myDest = session.getMyDestination() myDest = session.getMyDestination()

View File

@ -42,8 +42,12 @@ class UpdateServer {
System.exit(1) System.exit(1)
} }
def props = System.getProperties().clone() Properties props = System.getProperties().clone()
props.putAt("inbound.nickname", "MuWire UpdateServer") 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) session = i2pClient.createSession(new FileInputStream(keyFile), props)
myDest = session.getMyDestination() myDest = session.getMyDestination()