I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 165beb3f authored by zzz's avatar zzz
Browse files

TCG: split config log tweaks and cleanups

Fix warning about no tunnels loaded
Add notes in config default files
parent 5d367940
No related branches found
No related tags found
No related merge requests found
...@@ -359,6 +359,9 @@ public class TunnelControllerGroup implements ClientApp { ...@@ -359,6 +359,9 @@ public class TunnelControllerGroup implements ClientApp {
boolean ok = migrate(props, cfgFile, dir); boolean ok = migrate(props, cfgFile, dir);
if (!ok) if (!ok)
shouldMigrate = false; shouldMigrate = false;
} else {
_log.logAlways(Log.WARN, "Using new tunnel configurations in " + dir +
" - ignoring old tunnel configuration in " + cfgFile);
} }
} catch (IOException ioe) { } catch (IOException ioe) {
if (_log.shouldLog(Log.ERROR)) if (_log.shouldLog(Log.ERROR))
...@@ -368,7 +371,6 @@ public class TunnelControllerGroup implements ClientApp { ...@@ -368,7 +371,6 @@ public class TunnelControllerGroup implements ClientApp {
} else if (!shouldMigrate) { } else if (!shouldMigrate) {
throw new IllegalArgumentException("Unable to load the controllers from " + cfgFile); throw new IllegalArgumentException("Unable to load the controllers from " + cfgFile);
} }
int i = 0;
_controllersLock.writeLock().lock(); _controllersLock.writeLock().lock();
try { try {
if (shouldMigrate && dir.isDirectory()) { if (shouldMigrate && dir.isDirectory()) {
...@@ -401,7 +403,6 @@ public class TunnelControllerGroup implements ClientApp { ...@@ -401,7 +403,6 @@ public class TunnelControllerGroup implements ClientApp {
continue; continue;
TunnelController controller = new TunnelController(cfg, ""); TunnelController controller = new TunnelController(cfg, "");
_controllers.add(controller); _controllers.add(controller);
i++;
} }
} }
} finally { } finally {
...@@ -409,6 +410,7 @@ public class TunnelControllerGroup implements ClientApp { ...@@ -409,6 +410,7 @@ public class TunnelControllerGroup implements ClientApp {
} }
_controllersLoaded = true; _controllersLoaded = true;
int i = _controllers.size();
if (i > 0) { if (i > 0) {
if (_log.shouldLog(Log.INFO)) if (_log.shouldLog(Log.INFO))
_log.info(i + " controllers loaded from " + cfgFile); _log.info(i + " controllers loaded from " + cfgFile);
...@@ -849,12 +851,12 @@ public class TunnelControllerGroup implements ClientApp { ...@@ -849,12 +851,12 @@ public class TunnelControllerGroup implements ClientApp {
DataHelper.loadProps(config, cfgFile); DataHelper.loadProps(config, cfgFile);
for (String key : config.stringPropertyNames()) { for (String key : config.stringPropertyNames()) {
if (key.startsWith(PREFIX)) { if (key.startsWith(PREFIX)) {
if (_log.shouldLog(Log.WARN)) if (_log.shouldDebug())
_log.warn("Found monolithic config file " +key+ cfgFile.toString()); _log.debug("Found monolithic config file " + cfgFile);
return loadMonolithicConfig(config, cfgFile.getAbsolutePath()); return loadMonolithicConfig(config, cfgFile.getAbsolutePath());
} else { } else {
if (_log.shouldLog(Log.WARN)) if (_log.shouldDebug())
_log.warn("Found split config file " +key+ cfgFile.toString()); _log.debug("Found split config file " + cfgFile);
List<Properties> rv = new ArrayList<Properties>(1); List<Properties> rv = new ArrayList<Properties>(1);
config.setProperty(TunnelController.PROP_CONFIG_FILE, cfgFile.getAbsolutePath()); config.setProperty(TunnelController.PROP_CONFIG_FILE, cfgFile.getAbsolutePath());
rv.add(config); rv.add(config);
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
# When running as a Windows service, the configuration directory is \ProgramData\i2p # When running as a Windows service, the configuration directory is \ProgramData\i2p
# and the install directory is \Program Files\i2p . # and the install directory is \Program Files\i2p .
# #
# On first run, this file will be split into individual config files
# in clients.config.d/ in the configuration directory.
# Look in that directory for the file to edit.
#
# fire up the web console # fire up the web console
## There are several choices, here are some examples: ## There are several choices, here are some examples:
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
# When running as a Windows service, the configuration directory is \ProgramData\i2p # When running as a Windows service, the configuration directory is \ProgramData\i2p
# and the install directory is \Program Files\i2p . # and the install directory is \Program Files\i2p .
# #
# On first run, this file will be split into individual config files
# in i2ptunnel.config.d/ in the configuration directory.
# Look in that directory for the file to edit.
#
# eepproxy # eepproxy
tunnel.0.name=I2P HTTP Proxy tunnel.0.name=I2P HTTP Proxy
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment