diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/ByteCollector.java b/apps/ministreaming/java/src/net/i2p/client/streaming/ByteCollector.java index 2f0a69080f..629684eb02 100644 --- a/apps/ministreaming/java/src/net/i2p/client/streaming/ByteCollector.java +++ b/apps/ministreaming/java/src/net/i2p/client/streaming/ByteCollector.java @@ -5,7 +5,7 @@ package net.i2p.client.streaming; * so care should be taken when using in a multithreaded environment. * */ -public class ByteCollector { +class ByteCollector { byte[] contents; int size; diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerImpl.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerImpl.java index 4af292085e..87cc678610 100644 --- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerImpl.java +++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerImpl.java @@ -35,7 +35,7 @@ import net.i2p.util.Log; * or receive any messages with its .receiveMessage * */ -public class I2PSocketManagerImpl implements I2PSocketManager, I2PSessionListener { +class I2PSocketManagerImpl implements I2PSocketManager, I2PSessionListener { private I2PAppContext _context; private Log _log; private I2PSession _session; diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketOptionsImpl.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketOptionsImpl.java index e8700a01a2..6eb405f550 100644 --- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketOptionsImpl.java +++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketOptionsImpl.java @@ -7,7 +7,7 @@ import java.util.Properties; * Define the configuration for streaming and verifying data on the socket. * */ -public class I2PSocketOptionsImpl implements I2PSocketOptions { +class I2PSocketOptionsImpl implements I2PSocketOptions { private long _connectTimeout; private long _readTimeout; private long _writeTimeout; diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java index 64f9ce98f8..fbc28ab385 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java @@ -217,7 +217,10 @@ public class ConfigNetHandler extends FormHandler { } if ( (_port != null) && (_port.length() > 0) ) { String oldPort = _context.router().getConfigSetting(ConfigNetHelper.PROP_I2NP_TCP_PORT); - if ( (oldPort == null) || (!oldPort.equalsIgnoreCase(_port)) ) { + if ( (oldPort == null) && (_port.equals("8887")) ) { + // still on default.. noop + } else if ( (oldPort == null) || (!oldPort.equalsIgnoreCase(_port)) ) { + // its not the default OR it has changed _context.router().setConfigSetting(ConfigNetHelper.PROP_I2NP_TCP_PORT, _port); addFormNotice("Updating TCP port from " + oldPort + " to " + _port); restartRequired = true; diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java index 8133aadb43..392329f010 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java @@ -1,10 +1,17 @@ package net.i2p.router.web; +import java.io.File; +import java.io.FileWriter; import java.io.IOException; +import java.util.Iterator; +import java.util.Properties; +import java.util.TreeMap; +import net.i2p.data.DataHelper; import net.i2p.router.ClientTunnelSettings; import net.i2p.router.Router; import net.i2p.apps.systray.SysTray; +import net.i2p.apps.systray.UrlLauncher; import org.tanukisoftware.wrapper.WrapperManager; /** @@ -86,6 +93,12 @@ public class ConfigServiceHandler extends FormHandler { } catch (Throwable t) { addFormError("Warning: unable to contact the systray manager - " + t.getMessage()); } + } else if ("View console on startup".equals(_action)) { + browseOnStartup(true); + addFormNotice("Console is to be shown on startup"); + } else if ("Do not view console on startup".equals(_action)) { + browseOnStartup(false); + addFormNotice("Console is not to be shown on startup"); } else { addFormNotice("Blah blah blah. whatever. I'm not going to " + _action); } @@ -107,4 +120,81 @@ public class ConfigServiceHandler extends FormHandler { addFormError("Warning: unable to remove the service - " + ioe.getMessage()); } } + + private final static String NL = System.getProperty("line.separator"); + private void browseOnStartup(boolean shouldLaunchBrowser) { + File f = new File("clients.config"); + Properties p = new Properties(); + try { + DataHelper.loadProps(p, f); + + int i = 0; + int launchIndex = -1; + while (true) { + String className = p.getProperty("clientApp." + i + ".main"); + if (className == null) break; + if (UrlLauncher.class.getName().equals(className)) { + launchIndex = i; + break; + } + i++; + } + + if ((launchIndex >= 0) && shouldLaunchBrowser) + return; + if ((launchIndex < 0) && !shouldLaunchBrowser) + return; + + if (shouldLaunchBrowser) { + p.setProperty("clientApp." + i + ".main", UrlLauncher.class.getName()); + p.setProperty("clientApp." + i + ".name", "BrowserLauncher"); + p.setProperty("clientApp." + i + ".args", "http://localhost:7657/index.jsp"); + p.setProperty("clientApp." + i + ".delay", "5"); + } else { + p.remove("clientApp." + launchIndex + ".main"); + p.remove("clientApp." + launchIndex + ".name"); + p.remove("clientApp." + launchIndex + ".args"); + p.remove("clientApp." + launchIndex + ".onBoot"); + p.remove("clientApp." + launchIndex + ".delay"); + + i = launchIndex + 1; + while (true) { + String main = p.getProperty("clientApp." + i + ".main"); + String name = p.getProperty("clientApp." + i + ".name"); + String args = p.getProperty("clientApp." + i + ".args"); + String boot = p.getProperty("clientApp." + i + ".onBoot"); + String delay= p.getProperty("clientApp." + i + ".delay"); + + if (main == null) break; + + p.setProperty("clientApp." + (i-1) + ".main", main); + p.setProperty("clientApp." + (i-1) + ".name", name); + p.setProperty("clientApp." + (i-1) + ".args", args); + if (boot != null) + p.setProperty("clientApp." + (i-1) + ".onBoot", boot); + if (delay != null) + p.setProperty("clientApp." + (i-1) + ".delay", delay); + + p.remove("clientApp." + i + ".main"); + p.remove("clientApp." + i + ".name"); + p.remove("clientApp." + i + ".args"); + p.remove("clientApp." + i + ".onBoot"); + p.remove("clientApp." + i + ".delay"); + + i++; + } + } + + TreeMap sorted = new TreeMap(p); + FileWriter out = new FileWriter(f); + for (Iterator iter = sorted.keySet().iterator(); iter.hasNext(); ) { + String name = (String)iter.next(); + String val = (String)sorted.get(name); + out.write(name + "=" + val + NL); + } + out.close(); + } catch (IOException ioe) { + addFormError("Error updating the client config"); + } + } } \ No newline at end of file diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ContentHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ContentHelper.java index a59ad50e4f..bf515c82d0 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ContentHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ContentHelper.java @@ -10,6 +10,7 @@ import net.i2p.util.FileUtil; public class ContentHelper { private String _page; private int _maxLines; + private boolean _startAtBeginning; private RouterContext _context; /** * Configure this bean to query a particular router context @@ -28,6 +29,10 @@ public class ContentHelper { public ContentHelper() {} public void setPage(String page) { _page = page; } + public void setStartAtBeginning(String moo) { + _startAtBeginning = Boolean.valueOf(""+moo).booleanValue(); + } + public void setMaxLines(String lines) { if (lines != null) { try { @@ -40,14 +45,14 @@ public class ContentHelper { } } public String getContent() { - String str = FileUtil.readTextFile(_page, _maxLines); + String str = FileUtil.readTextFile(_page, _maxLines, _startAtBeginning); if (str == null) return ""; else return str; } public String getTextContent() { - String str = FileUtil.readTextFile(_page, _maxLines); + String str = FileUtil.readTextFile(_page, _maxLines, _startAtBeginning); if (str == null) return ""; else diff --git a/apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java index 93893c2836..83bd62e33d 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java @@ -42,7 +42,7 @@ public class LogsHelper { } public String getServiceLogs() { - String str = FileUtil.readTextFile("wrapper.log", 500); + String str = FileUtil.readTextFile("wrapper.log", 500, false); if (str == null) return ""; else diff --git a/apps/routerconsole/jsp/configservice.jsp b/apps/routerconsole/jsp/configservice.jsp index 1a705cacaa..36bc763070 100644 --- a/apps/routerconsole/jsp/configservice.jsp +++ b/apps/routerconsole/jsp/configservice.jsp @@ -67,6 +67,14 @@ please select the following option and review the thread dumped to wrapper.log.
+ +I2P's main configuration interface is this web console, so for your convenience + I2P can launch a web browser pointing at + http://localhost:7657/index.jsp whenever + the router starts up.
+ + diff --git a/apps/routerconsole/jsp/help.jsp b/apps/routerconsole/jsp/help.jsp index 00e56fe716..6449ec93a8 100644 --- a/apps/routerconsole/jsp/help.jsp +++ b/apps/routerconsole/jsp/help.jsp @@ -37,7 +37,9 @@ by their binary code license. This product includes software developed by the A lets you tunnel normal TCP/IP traffic over I2P (such as the eepproxy and the irc proxy).The router by default also includes human's public domain SAM bridge, -which other client applications (such as aum's stasher) can use. For +which other client applications (such the bittorrent port) can use. +There is also an optimized library for doing large number calculations - jbigi - which in turn uses the +LGPL licensed GMP library, tuned for various PC architectures. For details on other applications available, as well as their licenses, please see the license policy. Source for the I2P code and most bundled client applications can be found on our download page, and is @@ -47,7 +49,14 @@ in cvs.
+ A more complete list of updates can be found + online + (anonymously) +
+ +Continue to your I2P Router console. +If that page does not load, please make sure I2P is running, or review the file +wrapper.log for critical errors. +