make path to config configurable

This commit is contained in:
idk
2019-07-13 05:43:10 -04:00
parent c0bce4e7b7
commit 4cbd14d890

View File

@ -136,11 +136,15 @@ func NewClient(callbacks *ClientCallBacks) (c *Client) {
func (c *Client) setDefaultProperties() {
c.properties = defaultProperties
home := os.Getenv("HOME")
home := os.Getenv("I2CP_HOME")
if len(home) == 0 {
return
home = ""
}
config := home + defaultConfigFile
conf := os.Getenv("GO_I2CP_CONF")
if len(conf) == 0 {
conf = defaultConfigFile
}
config := home + conf
Debug(CLIENT, "Loading config file %s", config)
ParseConfig(config, c.SetProperty)
}