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.

+ +

Launch browser on router startup?

+

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) +

diff --git a/apps/systray/java/src/net/i2p/apps/systray/SysTray.java b/apps/systray/java/src/net/i2p/apps/systray/SysTray.java index 510c3e78ef..8a5a39274c 100644 --- a/apps/systray/java/src/net/i2p/apps/systray/SysTray.java +++ b/apps/systray/java/src/net/i2p/apps/systray/SysTray.java @@ -46,8 +46,8 @@ public class SysTray implements SysTrayMenuListener { _portString = _configFile.getProperty("port", "7657"); _showIcon = Boolean.valueOf(_configFile.getProperty("visible", "true")).booleanValue(); - if (!(new File("router.config")).exists()) - openRouterConsole("http://localhost:" + _portString + "/index.jsp"); + //if (!(new File("router.config")).exists()) + // openRouterConsole("http://localhost:" + _portString + "/index.jsp"); if ( (System.getProperty("os.name").startsWith("Windows")) && (!Boolean.getBoolean("systray.disable")) ) _instance = new SysTray(); diff --git a/apps/systray/java/src/net/i2p/apps/systray/UrlLauncher.java b/apps/systray/java/src/net/i2p/apps/systray/UrlLauncher.java index 9a0361bf33..41e7d92054 100644 --- a/apps/systray/java/src/net/i2p/apps/systray/UrlLauncher.java +++ b/apps/systray/java/src/net/i2p/apps/systray/UrlLauncher.java @@ -147,4 +147,14 @@ public class UrlLauncher { } return true; } + + public static void main(String args[]) { + UrlLauncher launcher = new UrlLauncher(); + try { + if (args.length > 0) + launcher.openUrl(args[0]); + else + launcher.openUrl("http://localhost:7657/index.jsp"); + } catch (Exception e) {} + } } diff --git a/build.xml b/build.xml index cdde6dbf91..81cce7c467 100644 --- a/build.xml +++ b/build.xml @@ -181,7 +181,6 @@ - @@ -212,11 +211,16 @@ + + + + + @@ -244,6 +248,15 @@ + + + + + + + + + diff --git a/core/java/src/net/i2p/util/Clock.java b/core/java/src/net/i2p/util/Clock.java index 0a1c0662b3..bc02cef6f2 100644 --- a/core/java/src/net/i2p/util/Clock.java +++ b/core/java/src/net/i2p/util/Clock.java @@ -66,9 +66,9 @@ public class Clock implements Timestamper.UpdateListener { // only allow substantial modifications before the first 10 minutes if (_alreadyChanged && (System.currentTimeMillis() - _startedOn > 10 * 60 * 1000)) { - if ( (offsetMs > MAX_LIVE_OFFSET) || (offsetMs < 0 - MAX_LIVE_OFFSET) ) { + if ( (delta > MAX_LIVE_OFFSET) || (delta < 0 - MAX_LIVE_OFFSET) ) { getLog().log(Log.CRIT, "The clock has already been updated, but you want to change it by " - + offsetMs + "? Did something break?"); + + delta + " to " + offsetMs + "? Did something break?"); return; } } diff --git a/core/java/src/net/i2p/util/Copy.java b/core/java/src/net/i2p/util/Copy.java new file mode 100644 index 0000000000..94aa27fe55 --- /dev/null +++ b/core/java/src/net/i2p/util/Copy.java @@ -0,0 +1,11 @@ +package net.i2p.util; + +/** + * Usage: Copy from to + * + */ +public class Copy { + public static void main(String args[]) { + FileUtil.copy(args[0], args[1], true); + } +} diff --git a/core/java/src/net/i2p/util/Delete.java b/core/java/src/net/i2p/util/Delete.java new file mode 100644 index 0000000000..5e5c84c391 --- /dev/null +++ b/core/java/src/net/i2p/util/Delete.java @@ -0,0 +1,11 @@ +package net.i2p.util; + +/** + * Usage: Delete name + * + */ +public class Delete { + public static void main(String args[]) { + FileUtil.rmdir(args[0], false); + } +} diff --git a/core/java/src/net/i2p/util/Exec.java b/core/java/src/net/i2p/util/Exec.java new file mode 100644 index 0000000000..7d3118e716 --- /dev/null +++ b/core/java/src/net/i2p/util/Exec.java @@ -0,0 +1,25 @@ +package net.i2p.util; + +import java.io.File; + +/** + * Usage: Exec dir command [args ...] + * + */ +public class Exec { + public static void main(String args[]) { + try { + String cmd[] = new String[args.length - 1]; + System.arraycopy(args, 1, cmd, 0, cmd.length); + Process proc = Runtime.getRuntime().exec(cmd, (String[])null, new File(args[0])); + + // ugly hack, because it seems we'll block otherwise! + // http://cephas.net/blog/2004/03/23/external_applications_javas_runtimeexec.html + try { proc.exitValue(); } catch (Throwable t) { } + Runtime.getRuntime().halt(0); + + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/core/java/src/net/i2p/util/FileUtil.java b/core/java/src/net/i2p/util/FileUtil.java index d034a8e635..6cb8088526 100644 --- a/core/java/src/net/i2p/util/FileUtil.java +++ b/core/java/src/net/i2p/util/FileUtil.java @@ -127,10 +127,13 @@ public class FileUtil { /** * Read in the last few lines of a (newline delimited) textfile, or null if - * the file doesn't exist. + * the file doesn't exist. + * + * @param startAtBeginning if true, read the first maxNumLines, otherwise read + * the last maxNumLines * */ - public static String readTextFile(String filename, int maxNumLines) { + public static String readTextFile(String filename, int maxNumLines, boolean startAtBeginning) { File f = new File(filename); if (!f.exists()) return null; FileInputStream fis = null; @@ -141,8 +144,12 @@ public class FileUtil { String line = null; while ( (line = in.readLine()) != null) { lines.add(line); - while (lines.size() > maxNumLines) - lines.remove(0); + if (lines.size() >= maxNumLines) { + if (startAtBeginning) + break; + else + lines.remove(0); + } } StringBuffer buf = new StringBuffer(lines.size() * 80); for (int i = 0; i < lines.size(); i++) @@ -155,9 +162,53 @@ public class FileUtil { } } - public static void main(String args[]) { - testRmdir(); + /** return true if it was copied successfully */ + public static boolean copy(String source, String dest, boolean overwriteExisting) { + File src = new File(source); + File dst = new File(dest); + + if (dst.exists() && dst.isDirectory()) + dst = new File(dst, src.getName()); + + if (!src.exists()) return false; + if (dst.exists() && !overwriteExisting) return false; + + byte buf[] = new byte[4096]; + try { + FileInputStream in = new FileInputStream(src); + FileOutputStream out = new FileOutputStream(dst); + + int read = 0; + while ( (read = in.read(buf)) != -1) + out.write(buf, 0, read); + + in.close(); + out.close(); + return true; + } catch (IOException ioe) { + ioe.printStackTrace(); + return false; + } } + + /** + * Usage: FileUtil (delete path | copy source dest) + * + */ + public static void main(String args[]) { + if ( (args == null) || (args.length < 2) ) { + testRmdir(); + } else if ("delete".equals(args[0])) { + boolean deleted = FileUtil.rmdir(args[1], false); + if (!deleted) + System.err.println("Error deleting [" + args[1] + "]"); + } else if ("copy".equals(args[0])) { + boolean copied = FileUtil.copy(args[1], args[2], false); + if (!copied) + System.err.println("Error copying [" + args[1] + "] to [" + args[2] + "]"); + } + } + private static void testRmdir() { File t = new File("rmdirTest/test/subdir/blah"); boolean created = t.mkdirs(); diff --git a/core/java/src/net/i2p/util/ShellCommand.java b/core/java/src/net/i2p/util/ShellCommand.java index 2ad7880878..4268baeaa7 100644 --- a/core/java/src/net/i2p/util/ShellCommand.java +++ b/core/java/src/net/i2p/util/ShellCommand.java @@ -349,7 +349,9 @@ public class ShellCommand { for (int i = 0; i < args.length; i++) { command.append("\"").append(args[i]).append("\" "); } - cmd.execute(command.toString()); + try { + cmd.executeSilent(command.toString()); + } catch (IOException ioe) { ioe.printStackTrace(); } return; } diff --git a/history.txt b/history.txt index 58f0921450..f8a0cf7b4a 100644 --- a/history.txt +++ b/history.txt @@ -1,4 +1,22 @@ -$Id: history.txt,v 1.80 2004/11/22 12:57:16 jrandom Exp $ +$Id: history.txt,v 1.81 2004/11/22 20:12:36 jrandom Exp $ + +2004-11-25 jrandom + * Revised the installer to include start menu and desktop shortcuts for + windows platforms, including pretty icons (thanks DrWoo!) + * Allow clients specified in clients.config to have an explicit startup + delay. + * Update the default install to launch a browser pointing at the console + whenever I2P starts up, rather than only the first time it starts up + (configurable on /configservice.jsp, or in clients.config) + * Bugfix to the clock skew checking code to monitor the delta between + offsets, not the offset itself (duh) + * Router console html update + * New (and uuuuugly) code to verify that the wrapper.config contains + the necessary classpath entries on update. If it has to update the + wrapper.config, it will stop the JVM and service completely, since the + java service wrapper doesn't reread the wrapper.config on JVM restart - + requiring the user to manually restart the service after an update. + * Increase the TCP connection timeout to 30s (which is obscenely long) 2004-11-22 jrandom * Update to the SAM bridge to reduce some unnecessary memory allocation. diff --git a/installer/install.xml b/installer/install.xml index 75da548571..cab202f91a 100644 --- a/installer/install.xml +++ b/installer/install.xml @@ -1 +1,85 @@ - i2p 0.4.1.4 http://www.i2p.net Base installation files \ No newline at end of file + + + + + + i2p + 0.4.2 + + + + http://www.i2p.net + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Base installation files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/installer/resources/ProcessPanel.Spec.xml b/installer/resources/ProcessPanel.Spec.xml deleted file mode 100644 index 7cdb2f0e8b..0000000000 --- a/installer/resources/ProcessPanel.Spec.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - $INSTALL_PATH - - - - - - $INSTALL_PATH/postinstall.sh$INSTALL_PATH - - - \ No newline at end of file diff --git a/installer/resources/clients.config b/installer/resources/clients.config index 90c38548c3..e756acc50b 100644 --- a/installer/resources/clients.config +++ b/installer/resources/clients.config @@ -17,4 +17,11 @@ clientApp.2.args=i2ptunnel.config # run our own eepsite with a seperate jetty instance clientApp.3.main=org.mortbay.jetty.Server clientApp.3.name=eepsite -clientApp.3.args=eepsite/jetty.xml \ No newline at end of file +clientApp.3.args=eepsite/jetty.xml +clientApp.3.delay=30 + +# load a browser pointing at the web console whenever we start up +clientApp.4.main=net.i2p.apps.systray.UrlLauncher +clientApp.4.name=consoleBrowser +clientApp.4.args=http://localhost:7657/ +clientApp.4.delay=5 diff --git a/installer/resources/console.ico b/installer/resources/console.ico new file mode 100644 index 0000000000..bf40979db7 Binary files /dev/null and b/installer/resources/console.ico differ diff --git a/installer/resources/favicon.ico b/installer/resources/favicon.ico new file mode 100644 index 0000000000..fd09b1b4cc Binary files /dev/null and b/installer/resources/favicon.ico differ diff --git a/installer/resources/i2prouter_win9x.bat b/installer/resources/i2prouter_win9x.bat deleted file mode 100644 index f04a41349c..0000000000 --- a/installer/resources/i2prouter_win9x.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -start /m I2Psvc.exe -c wrapper.config -exit diff --git a/installer/resources/shortcutSpec.xml b/installer/resources/shortcutSpec.xml new file mode 100644 index 0000000000..b17a7cfc07 --- /dev/null +++ b/installer/resources/shortcutSpec.xml @@ -0,0 +1,33 @@ + + + + + + + diff --git a/installer/resources/start.ico b/installer/resources/start.ico new file mode 100644 index 0000000000..f1a7d95273 Binary files /dev/null and b/installer/resources/start.ico differ diff --git a/installer/resources/startconsole.html b/installer/resources/startconsole.html new file mode 100644 index 0000000000..bd60c4673c --- /dev/null +++ b/installer/resources/startconsole.html @@ -0,0 +1,6 @@ + + +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. + diff --git a/installer/resources/uninstall.ico b/installer/resources/uninstall.ico new file mode 100644 index 0000000000..b47af59cc2 Binary files /dev/null and b/installer/resources/uninstall.ico differ diff --git a/installer/resources/wrapper.config b/installer/resources/wrapper.config index 6147ead958..a43af1b2d5 100644 --- a/installer/resources/wrapper.config +++ b/installer/resources/wrapper.config @@ -32,6 +32,7 @@ wrapper.java.classpath.17=lib/xml-apis.jar wrapper.java.classpath.18=lib/jbigi.jar wrapper.java.classpath.19=lib/systray.jar wrapper.java.classpath.20=lib/systray4j.jar +wrapper.java.classpath.21=lib/streaming.jar # Java Library Path (location of Wrapper.DLL or libwrapper.so) wrapper.java.library.path.1=. diff --git a/readme.html b/readme.html index 118f65f8b0..4779c856f0 100644 --- a/readme.html +++ b/readme.html @@ -1,80 +1,71 @@

Congratulations on getting I2P installed!

-

Next up you'll need to go into the configuration page -and provide some info (such as your IP address, etc). You will also want to -seed your router on that page as well, and may want to consider reviewing some -of the other configuration pages. Alternately, you can update the "router.config" -file in your I2P installation directory, which is checked for updates periodically.

- -

After your router has been configured and you have reseeded, within a few minutes -(3-5), you should see the number of active peers increase. If it doesn't, you may -want to verify that the hostname and port number specified on the configuration page -are correct and reachable from the outside world.

- -

For help, you may want to review the information on the I2P website, -post up messages to the I2P discussion forum, or swing by #i2p or -#i2p-chat on IRC at irc.freenode.net, -invisiblechat/IIP, or irc.duck.i2p (they're all -linked together).

- -

Want I2P to run automatically?

- -

With the I2P install we've bundled some scripts and code (from the cool folks at -tanukisoftware) to let you -run I2P as a service on windows machines (a daemon, for you *nix geeks). Windows users can -add or remove the I2P service on the service control page, or -through the install_i2p_service_winnt.bat and uninstall_i2p_service_winnt.bat scripts. *nix -users can script up something to call ./i2prouter start with the appropriate -environment ($PATH, $JAVA_HOME, etc) and user id (I2P does not require root). To uninstall -I2P altogether, simply wipe the I2P installation directory.

- -

What next?

- -

By default, I2P comes bundled with the I2PTunnel -application configured with an HTTP proxy listening on port 4444 and an -IRC proxy listening on port 6668.

- -

The HTTP proxy lets you access "eepsites" - anonymously hosted websites - -routing your requests and their responses over I2P. There are also a few "outproxies" - -gateways onto the normal internet - through which you can browse normal websites -anonymously. Once you've configured your browser to use the proxy, you should be able -to reach some of the following sites:

- +

If this is your first time running I2P, you will see a link on the left hand +side telling you to "reseed" - click that to get connected to the network (you +only need to do it if that link shows up). Within 5 minutes, you should see +the number of "Active: " peers rise, and you should see some local "destinations" +listed (if not, see below). Once those are up, you can:

    -
  • duck.i2p: duck's eepsite, with links to other active sites
  • -
  • ugha.i2p: ugha's eepsite, a wiki that anyone can edit, and lots of links
  • -
  • forum.i2p: a secure and anonymous connection to forum.i2p.net
  • -
  • www.i2p: a secure and anonymous connection to www.i2p.net
  • -
  • dev.i2p: a secure and anonymous connection to dev.i2p.net
  • -
  • fproxy.i2p: - a secure and anonymous connection to a freenet node
  • -
  • www.postman.i2p: an anonymous email provider, allowing - mail within I2P, as well as to and from the internet (via @i2pmail.org)
  • +
  • chat anonymously - fire up your own IRC client and connect to the + server at localhost port 6668. This points at one of two anonymously hosted + IRC servers (irc.duck.i2p and irc.baffled.i2p), but neither you nor they know + where the other is.
  • +
  • browse "eepsites" - on I2P there are anonymously hosted websites - + tell your browser to use the HTTP proxy at localhost port 4444, then + browse to an eepsite - + + There are many more eepsites - just follow the links from the ones you see, + bookmark your favorites, and visit them often!
  • +
  • browse the web - there are a pair of HTTP "outproxies" in I2P hooked + up to your own HTTP proxy on port 4444 - simply set your browser's proxy to + use it (as above) and go to any normal URL - your requests will be bounced + through the I2P network.
  • +
  • transfer files - there is an I2P port + of the BitTorrent application available.
  • +
  • use anonymous email - postman has created a mail system compatible with normal mail + clients (POP3 / SMTP) that allows email within I2P as well as mail from and to the normal + internet! get your account at www.postman.i2p.
  • +
  • and lots more
-

The IRC proxy is a gateway to duck's anonymously hosted IRC server -"irc.duck.i2p". You can treat it like any other IRC server - fire up your IRC client and -connect to the server at localhost:6668 and join us on #i2p or #i2p-chat! DCC doesn't -work at the moment though.

- -

By default, those two proxies listen only on the local interface, which means you -cannot access them from other machines on your network (and neither can random strangers :) -If you want to make them accessible, or want to update them through some other way, go to -the I2PTunnel configuration interface and edit them accordingly. -You can also go to that page if you want to add a new tunnel, such as if you want to run -your own eepsite.

-

Want your own eepsite?

-

In addition, we've configured some software to let you run your own eepsite - a + +

We've bundled some software to let you run your own eepsite - a Jetty instance listening on http://localhost:7658/. Simply place your files in the eepsite/docroot/ directory (or any standard JSP/Servlet .war files under eepsite/webapps) and they'll show up. Your eepsite's -destination (which uniquely and securly identifies it) is shown on the I2PTunnel +destination (which uniquely and securely identifies it) is shown on the I2PTunnel configuration page - if you want other people to see your eepsite, you need to give them that really huge string. Just paste it into the Eepsite announce forum, add it to ugha's wiki, or paste it in the #i2p or #i2p-chat channels on IRC (be sure to split it into two lines, as its too long for one).

+

Troubleshooting

+ +

If the left hand side has a warning, telling you to check your NAT or firewall, please +see the config page and make sure that you can receive inbound +TCP connections on port 8887 (or another port that you specify). Probelms forwarding +that port account for the vast majority of issues people run into. When it says +"Active: 72/85", the "72" means how many peers you are connected with now, and "85" means +how many you have spoken with recently - if that first number is 0, you can bet that there +are firewall issues. If the second number is under 5, you should reseed (a link on the left +hand side of the page will show up to help you when necessary).

+ +

If you are still having problems, you may want to review the information on the +I2P website, post up messages to the +I2P discussion forum, or swing by #i2p or +#i2p-chat on IRC at irc.freenode.net, +invisiblechat/IIP, or irc.duck.i2p (they're all +linked together).

+

As a note, you can change this page by editing the file "docs/readme.html"

\ No newline at end of file diff --git a/router/java/src/net/i2p/router/Router.java b/router/java/src/net/i2p/router/Router.java index 868e37c03a..b4e73f507b 100644 --- a/router/java/src/net/i2p/router/Router.java +++ b/router/java/src/net/i2p/router/Router.java @@ -36,6 +36,7 @@ import net.i2p.data.i2np.TunnelMessage; import net.i2p.router.message.GarlicMessageHandler; import net.i2p.router.message.TunnelMessageHandler; import net.i2p.router.startup.StartupJob; +import net.i2p.router.startup.VerifyClasspath; import net.i2p.stat.Rate; import net.i2p.stat.RateStat; import net.i2p.util.FileUtil; @@ -793,6 +794,7 @@ public class Router { public static void main(String args[]) { installUpdates(); + verifyClasspath(); Router r = new Router(); r.runRouter(); } @@ -818,6 +820,15 @@ public class Router { } } + private static void verifyClasspath() { + boolean updated = VerifyClasspath.updateClasspath(); + if (updated) { + System.out.println("INFO: Classpath updated, but the service wrapper requires you to manually restart"); + System.out.println("INFO: Shutting down the router - please rerun it!"); + System.exit(EXIT_HARD); + } + } + private static String getPingFile(Properties envProps) { if (envProps != null) return envProps.getProperty("router.pingFile", "router.ping"); diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index bc8fdec6c5..a1ca39a35b 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -15,9 +15,9 @@ import net.i2p.CoreVersion; * */ public class RouterVersion { - public final static String ID = "$Revision: 1.85 $ $Date: 2004/11/22 12:57:16 $"; + public final static String ID = "$Revision: 1.86 $ $Date: 2004/11/22 20:12:34 $"; public final static String VERSION = "0.4.1.4"; - public final static long BUILD = 14; + public final static long BUILD = 15; public static void main(String args[]) { System.out.println("I2P Router version: " + VERSION); System.out.println("Router ID: " + RouterVersion.ID); diff --git a/router/java/src/net/i2p/router/startup/LoadClientAppsJob.java b/router/java/src/net/i2p/router/startup/LoadClientAppsJob.java index 9af4beef64..7080cf161a 100644 --- a/router/java/src/net/i2p/router/startup/LoadClientAppsJob.java +++ b/router/java/src/net/i2p/router/startup/LoadClientAppsJob.java @@ -43,11 +43,16 @@ class LoadClientAppsJob extends JobImpl { String className = clientApps.getProperty("clientApp."+i+".main"); String clientName = clientApps.getProperty("clientApp."+i+".name"); String args = clientApps.getProperty("clientApp."+i+".args"); + String delayStr = clientApps.getProperty("clientApp." + i + ".delay"); String onBoot = clientApps.getProperty("clientApp." + i + ".onBoot"); boolean onStartup = false; if (onBoot != null) onStartup = "true".equals(onBoot) || "yes".equals(onBoot); - + + long delay = (onStartup ? 0 : STARTUP_DELAY); + if (delayStr != null) + try { delay = 1000*Integer.parseInt(delayStr); } catch (NumberFormatException nfe) {} + if (className == null) break; @@ -56,8 +61,8 @@ class LoadClientAppsJob extends JobImpl { // run this guy now runClient(className, clientName, argVal); } else { - // wait 2 minutes - getContext().jobQueue().addJob(new DelayedRunClient(className, clientName, argVal)); + // wait before firing it up + getContext().jobQueue().addJob(new DelayedRunClient(className, clientName, argVal, delay)); } i++; } @@ -85,12 +90,12 @@ class LoadClientAppsJob extends JobImpl { private String _className; private String _clientName; private String _args[]; - public DelayedRunClient(String className, String clientName, String args[]) { + public DelayedRunClient(String className, String clientName, String args[], long delay) { super(LoadClientAppsJob.this.getContext()); _className = className; _clientName = clientName; _args = args; - getTiming().setStartAfter(LoadClientAppsJob.this.getContext().clock().now() + STARTUP_DELAY); + getTiming().setStartAfter(LoadClientAppsJob.this.getContext().clock().now() + delay); } public String getName() { return "Delayed client job"; } public void runJob() { diff --git a/router/java/src/net/i2p/router/startup/VerifyClasspath.java b/router/java/src/net/i2p/router/startup/VerifyClasspath.java new file mode 100644 index 0000000000..eb6a36d84a --- /dev/null +++ b/router/java/src/net/i2p/router/startup/VerifyClasspath.java @@ -0,0 +1,87 @@ +package net.i2p.router.startup; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import java.util.Properties; + +import net.i2p.data.DataHelper; + +/** + * Make sure that if there is a wrapper.config file, it includes + * all of the jar files necessary for the current build. + * HOLY CRAP THIS IS UGLY. + * + */ +public class VerifyClasspath { + private static final String NL = System.getProperty("line.separator"); + private static final Set _jars = new HashSet(); + + static { + _jars.add("lib/ant.jar"); + _jars.add("lib/heartbeat.jar"); + _jars.add("lib/i2p.jar"); + _jars.add("lib/i2ptunnel.jar"); + _jars.add("lib/jasper-compiler.jar"); + _jars.add("lib/jasper-runtime.jar"); + _jars.add("lib/javax.servlet.jar"); + _jars.add("lib/jnet.jar"); + _jars.add("lib/mstreaming.jar"); + _jars.add("lib/netmonitor.jar"); + _jars.add("lib/org.mortbay.jetty.jar"); + _jars.add("lib/router.jar"); + _jars.add("lib/routerconsole.jar"); + _jars.add("lib/sam.jar"); + _jars.add("lib/wrapper.jar"); + _jars.add("lib/xercesImpl.jar"); + _jars.add("lib/xml-apis.jar"); + _jars.add("lib/jbigi.jar"); + _jars.add("lib/systray.jar"); + _jars.add("lib/systray4j.jar"); + _jars.add("lib/streaming.jar"); + } + + /** + * update the wrapper.config + * + * @return true if the classpath was updated and a restart is + * required, false otherwise. + */ + public static boolean updateClasspath() { + Properties p = new Properties(); + File configFile = new File("wrapper.config"); + Set needed = new HashSet(_jars); + try { + DataHelper.loadProps(p, configFile); + Set toAdd = new HashSet(); + int entry = 1; + while (true) { + String value = p.getProperty("wrapper.java.classpath." + entry); + if (value == null) break; + needed.remove(value); + entry++; + } + if (needed.size() <= 0) { + // we have everything we need + return false; + } else { + // add on some new lines + FileWriter out = new FileWriter(configFile, true); + out.write(NL + "# Adding new libs as required by the update" + NL); + for (Iterator iter = needed.iterator(); iter.hasNext(); ) { + String name = (String)iter.next(); + out.write("wrapper.java.classpath." + entry + "=" + name + NL); + } + out.close(); + return true; + } + } catch (IOException ioe) { + ioe.printStackTrace(); + return false; + } + } +} diff --git a/router/java/src/net/i2p/router/transport/tcp/ConnectionBuilder.java b/router/java/src/net/i2p/router/transport/tcp/ConnectionBuilder.java index 242cd25409..8f965313cd 100644 --- a/router/java/src/net/i2p/router/transport/tcp/ConnectionBuilder.java +++ b/router/java/src/net/i2p/router/transport/tcp/ConnectionBuilder.java @@ -79,8 +79,8 @@ public class ConnectionBuilder { */ private String _error; - /** If the connection hasn't been built in 10 seconds, give up */ - public static final int CONNECTION_TIMEOUT = 10*1000; + /** If the connection hasn't been built in 30 seconds, give up */ + public static final int CONNECTION_TIMEOUT = 30*1000; public static final int WRITE_BUFFER_SIZE = 2*1024; diff --git a/router/java/src/net/i2p/router/transport/tcp/TCPListener.java b/router/java/src/net/i2p/router/transport/tcp/TCPListener.java index 2a7a1e8b95..40f6cbaf31 100644 --- a/router/java/src/net/i2p/router/transport/tcp/TCPListener.java +++ b/router/java/src/net/i2p/router/transport/tcp/TCPListener.java @@ -50,7 +50,7 @@ class TCPListener { */ private final static int MAX_FAIL_DELAY = 5*60*1000; /** if we're not making progress in 10s, drop 'em */ - final static int HANDLE_TIMEOUT = 10*1000; + final static int HANDLE_TIMEOUT = 30*1000; /** id generator for the connections */ private static volatile int __handlerId = 0;