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) ------------------------------------------------
This commit is contained in:
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -67,6 +67,14 @@
|
||||
please select the following option and review the thread dumped to
|
||||
<a href="logs.jsp#servicelogs">wrapper.log</a>.</p>
|
||||
<input type="submit" name="action" value="Dump threads" />
|
||||
|
||||
<h4>Launch browser on router startup?</h4>
|
||||
<p>I2P's main configuration interface is this web console, so for your convenience
|
||||
I2P can launch a web browser pointing at
|
||||
<a href="http://localhost:7657/index.jsp">http://localhost:7657/index.jsp</a> whenever
|
||||
the router starts up.</p>
|
||||
<input type="submit" name="action" value="View console on startup" />
|
||||
<input type="submit" name="action" value="Do not view console on startup" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
@ -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).</p>
|
||||
|
||||
<p>The router by default also includes human's public domain <a href="http://www.i2p.net/sam">SAM</a> bridge,
|
||||
which other client applications (such as aum's <a href="http://stasher.i2p/">stasher</a>) can use. For
|
||||
which other client applications (such the <a href="http://duck.i2p/i2p-bt/">bittorrent port</a>) can use.
|
||||
There is also an optimized library for doing large number calculations - jbigi - which in turn uses the
|
||||
LGPL licensed <a href="http://swox.com/gmp/">GMP</a> library, tuned for various PC architectures. For
|
||||
details on other applications available, as well as their licenses, please see the
|
||||
<a href="http://www.i2p.net/licenses">license policy</a>. Source for the I2P code and most bundled
|
||||
client applications can be found on our <a href="http://www.i2p.net/download">download page</a>, and is
|
||||
@ -47,7 +49,14 @@ in <a href="http://www.i2p.net/cvs">cvs</a>.</p>
|
||||
<jsp:useBean class="net.i2p.router.web.ContentHelper" id="contenthelper" scope="request" />
|
||||
<jsp:setProperty name="contenthelper" property="page" value="history.txt" />
|
||||
<jsp:setProperty name="contenthelper" property="maxLines" value="500" />
|
||||
<jsp:setProperty name="contenthelper" property="startAtBeginning" value="true" />
|
||||
<jsp:getProperty name="contenthelper" property="textContent" />
|
||||
|
||||
<p>
|
||||
A more complete list of updates can be found
|
||||
<a href="http://dev.i2p.net/cgi-bin/cvsweb.cgi/i2p/history.txt?rev=HEAD">online</a>
|
||||
(<a href="http://dev.i2p/cgi-bin/cvsweb.cgi/i2p/history.txt?rev=HEAD">anonymously</a>)
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
@ -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();
|
||||
|
@ -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) {}
|
||||
}
|
||||
}
|
||||
|
15
build.xml
15
build.xml
@ -181,7 +181,6 @@
|
||||
<copy file="installer/resources/clients.config" todir="pkg-temp/" />
|
||||
<copy file="installer/resources/i2prouter" todir="pkg-temp/" />
|
||||
<copy file="installer/resources/i2prouter.bat" todir="pkg-temp/" />
|
||||
<copy file="installer/resources/i2prouter_win9x.bat" todir="pkg-temp/" />
|
||||
<copy file="installer/resources/i2ptunnel.config" todir="pkg-temp/" />
|
||||
<!-- <copy file="installer/resources/install_i2p_service_unix" todir="pkg-temp/" /> -->
|
||||
<copy file="installer/resources/install_i2p_service_winnt.bat" todir="pkg-temp/" />
|
||||
@ -212,11 +211,16 @@
|
||||
<copy file="history.txt" todir="pkg-temp/" />
|
||||
<mkdir dir="pkg-temp/docs" />
|
||||
<copy file="readme.html" todir="pkg-temp/docs/" />
|
||||
<copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
|
||||
<copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
|
||||
<copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
|
||||
<copy file="installer/resources/uninstall.ico" todir="pkg-temp/docs/" />
|
||||
<mkdir dir="pkg-temp/eepsite" />
|
||||
<mkdir dir="pkg-temp/eepsite/webapps" />
|
||||
<mkdir dir="pkg-temp/eepsite/logs" />
|
||||
<mkdir dir="pkg-temp/eepsite/docroot" />
|
||||
<copy file="installer/resources/eepsite_index.html" tofile="pkg-temp/eepsite/docroot/index.html" />
|
||||
<copy file="installer/resources/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
|
||||
<copy file="installer/resources/jetty.xml" tofile="pkg-temp/eepsite/jetty.xml" />
|
||||
</target>
|
||||
<target name="tarball" depends="preppkg">
|
||||
@ -244,6 +248,15 @@
|
||||
</target>
|
||||
<taskdef name="izpack" classpath="${basedir}/installer/lib/izpack/standalone-compiler.jar" classname="com.izforge.izpack.ant.IzPackTask" />
|
||||
<target name="installer" depends="preppkg">
|
||||
<jar destfile="./pkg-temp/lib/copy.jar" basedir="./core/java/build/obj" includes="net/i2p/util/*.class">
|
||||
<manifest><attribute name="Main-Class" value="net.i2p.util.Copy" /></manifest>
|
||||
</jar>
|
||||
<jar destfile="./pkg-temp/lib/delete.jar" basedir="./core/java/build/obj" includes="net/i2p/util/*.class">
|
||||
<manifest><attribute name="Main-Class" value="net.i2p.util.Delete" /></manifest>
|
||||
</jar>
|
||||
<jar destfile="./pkg-temp/lib/exec.jar" basedir="./core/java/build/obj" includes="net/i2p/util/*.class">
|
||||
<manifest><attribute name="Main-Class" value="net.i2p.util.Exec" /></manifest>
|
||||
</jar>
|
||||
<izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
|
||||
</target>
|
||||
</project>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
11
core/java/src/net/i2p/util/Copy.java
Normal file
11
core/java/src/net/i2p/util/Copy.java
Normal file
@ -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);
|
||||
}
|
||||
}
|
11
core/java/src/net/i2p/util/Delete.java
Normal file
11
core/java/src/net/i2p/util/Delete.java
Normal file
@ -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);
|
||||
}
|
||||
}
|
25
core/java/src/net/i2p/util/Exec.java
Normal file
25
core/java/src/net/i2p/util/Exec.java
Normal file
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
20
history.txt
20
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.
|
||||
|
@ -1 +1,85 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
|
||||
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
|
||||
|
||||
<installation version="1.0">
|
||||
|
||||
<info>
|
||||
<appname>i2p</appname>
|
||||
<appversion>0.4.2</appversion>
|
||||
<authors>
|
||||
<author name="I2P" email="support@i2p.net"/>
|
||||
</authors>
|
||||
<url>http://www.i2p.net</url>
|
||||
</info>
|
||||
|
||||
<guiprefs width="590" height="356" resizable="yes">
|
||||
<laf name="liquid">
|
||||
<os family="unix"/>
|
||||
</laf>
|
||||
</guiprefs>
|
||||
|
||||
<locale>
|
||||
<langpack iso3="eng"/>
|
||||
</locale>
|
||||
|
||||
<native type="izpack" name="ShellLink.dll" />
|
||||
|
||||
<resources>
|
||||
<res id="Installer.image" src="installer/resources/i2plogo.png" />
|
||||
<res id="InfoPanel.info" src="installer/resources/readme.license.txt"/>
|
||||
<!-- <res id="ProcessPanel.Spec.xml" src="installer/resources/ProcessPanel.Spec.xml"/> -->
|
||||
<res id="shortcutSpec.xml" src="installer/resources/shortcutSpec.xml" />
|
||||
</resources>
|
||||
|
||||
<panels>
|
||||
<panel classname="HelloPanel"/>
|
||||
<panel classname="InfoPanel"/>
|
||||
<panel classname="TargetPanel"/>
|
||||
<panel classname="InstallPanel"/>
|
||||
<panel classname="ShortcutPanel"><os family="windows" /></panel>
|
||||
<!-- <panel classname="ProcessPanel"><os family="windows" /></panel> -->
|
||||
<panel classname="SimpleFinishPanel"/>
|
||||
</panels>
|
||||
|
||||
<packs>
|
||||
<pack name="Base" required="yes">
|
||||
<description>Base installation files</description>
|
||||
<fileset dir="pkg-temp" includes="**/*" targetdir="$INSTALL_PATH"/>
|
||||
|
||||
<!-- postinstall stuff for windows -->
|
||||
<executable targetfile="$INSTALL_PATH/lib/copy.jar" type="jar" stage="postinstall" keep="true" failure="warn"> <os family="windows" />
|
||||
<args><arg value="$INSTALL_PATH\lib\wrapper\win32\I2Psvc.exe" /><arg value="$INSTALL_PATH" /></args></executable>
|
||||
<executable targetfile="$INSTALL_PATH/lib/copy.jar" type="jar" stage="postinstall" keep="true" failure="warn"> <os family="windows" />
|
||||
<args><arg value="$INSTALL_PATH\lib\wrapper\win32\wrapper.dll" /><arg value="$INSTALL_PATH\lib" /></args></executable>
|
||||
<executable targetfile="$INSTALL_PATH/lib/copy.jar" type="jar" stage="postinstall" keep="true" failure="warn"> <os family="windows" />
|
||||
<args><arg value="$INSTALL_PATH\lib\wrapper\win32\wrapper.jar" /><arg value="$INSTALL_PATH\lib" /></args></executable>
|
||||
<executable targetfile="$INSTALL_PATH/lib/delete.jar" type="jar" stage="postinstall" keep="true" failure="warn"> <os family="windows" />
|
||||
<args><arg value="$INSTALL_PATH\i2prouter" /></args></executable>
|
||||
<executable targetfile="$INSTALL_PATH/lib/delete.jar" type="jar" stage="postinstall" keep="true" failure="warn"> <os family="windows" />
|
||||
<args><arg value="$INSTALL_PATH\install_i2p_service_unix" /></args></executable>
|
||||
<executable targetfile="$INSTALL_PATH/lib/delete.jar" type="jar" stage="postinstall" keep="true" failure="warn"> <os family="windows" />
|
||||
<args><arg value="$INSTALL_PATH\install-headless.txt" /></args></executable>
|
||||
<executable targetfile="$INSTALL_PATH/lib/delete.jar" type="jar" stage="postinstall" keep="true" failure="warn"> <os family="windows" />
|
||||
<args><arg value="$INSTALL_PATH\osid" /></args></executable>
|
||||
<executable targetfile="$INSTALL_PATH/lib/delete.jar" type="jar" stage="postinstall" keep="true" failure="warn"> <os family="windows" />
|
||||
<args><arg value="$INSTALL_PATH\postinstall.sh" /></args></executable>
|
||||
<executable targetfile="$INSTALL_PATH/lib/delete.jar" type="jar" stage="postinstall" keep="true" failure="warn"> <os family="windows" />
|
||||
<args><arg value="$INSTALL_PATH\postinstall.bat" /></args></executable>
|
||||
<executable targetfile="$INSTALL_PATH/lib/delete.jar" type="jar" stage="postinstall" keep="true" failure="warn"> <os family="windows" />
|
||||
<args><arg value="$INSTALL_PATH\uninstall_i2p_service_unix" /></args></executable>
|
||||
<executable targetfile="$INSTALL_PATH/lib/delete.jar" type="jar" stage="postinstall" keep="true" failure="warn"> <os family="windows" />
|
||||
<args><arg value="$INSTALL_PATH\lib\wrapper" /></args></executable>
|
||||
<!--
|
||||
<executable targetfile="$INSTALL_PATH/lib/exec.jar" type="jar" stage="postinstall" keep="true" failure="warn"> <os family="windows" />
|
||||
<args><arg value="$INSTALL_PATH" /><arg value="$INSTALL_PATH\I2Psvc.exe" /><arg value="-c" /><arg value="$INSTALL_PATH\wrapper.config" /></args></executable>
|
||||
-->
|
||||
|
||||
<!-- postinstall stuff for *nix -->
|
||||
<!-- stage=never means chmod a+x -->
|
||||
<executable targetfile="$INSTALL_PATH/postinstall.sh" type="bin" stage="never" keep="true" failure="warn"><os family="unix" /></executable>
|
||||
<executable targetfile="$INSTALL_PATH/postinstall.sh" type="bin" stage="postinstall" keep="true" failure="warn"><os family="unix" />
|
||||
<args><arg value="$INSTALL_PATH" /></args></executable>
|
||||
|
||||
</pack>
|
||||
</packs>
|
||||
|
||||
</installation>
|
||||
|
@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
|
||||
|
||||
<processing>
|
||||
<job name="Launching I2P...">
|
||||
<os family="windows" />
|
||||
<executefile name="$INSTALL_PATH\postinstall.bat">
|
||||
<arg>$INSTALL_PATH</arg>
|
||||
</executefile>
|
||||
</job>
|
||||
<job name="Launching I2P...">
|
||||
<os family="unix" />
|
||||
<executefile name="/bin/sh">
|
||||
<arg>$INSTALL_PATH/postinstall.sh</arg><arg>$INSTALL_PATH</arg>
|
||||
</executefile>
|
||||
</job>
|
||||
</processing>
|
@ -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
|
||||
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
|
||||
|
BIN
installer/resources/console.ico
Normal file
BIN
installer/resources/console.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
BIN
installer/resources/favicon.ico
Normal file
BIN
installer/resources/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
@ -1,3 +0,0 @@
|
||||
@echo off
|
||||
start /m I2Psvc.exe -c wrapper.config
|
||||
exit
|
33
installer/resources/shortcutSpec.xml
Normal file
33
installer/resources/shortcutSpec.xml
Normal file
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shortcuts>
|
||||
<programGroup defaultName="I2P" location="startMenu" />
|
||||
<shortcut name="Start I2P"
|
||||
target="$INSTALL_PATH\I2Psvc.exe"
|
||||
commandLine="-c wrapper.config"
|
||||
workingDirectory="$INSTALL_PATH"
|
||||
iconFile="$INSTALL_PATH\docs\start.ico"
|
||||
initialState="noShow"
|
||||
programGroup="yes"
|
||||
startMenu="no"
|
||||
desktop="yes"
|
||||
startup="no" />
|
||||
<shortcut name="I2P router console"
|
||||
target="$INSTALL_PATH\docs\startconsole.html"
|
||||
commandLine=""
|
||||
workingDirectory="$INSTALL_PATH"
|
||||
iconFile="$INSTALL_PATH\docs\console.ico"
|
||||
initialState="noShow"
|
||||
programGroup="yes"
|
||||
startMenu="no"
|
||||
desktop="yes"
|
||||
startup="no" />
|
||||
<shortcut name="Uninstall I2P"
|
||||
target="$INSTALL_PATH\uninstaller\uninstaller.jar"
|
||||
commandLine=""
|
||||
workingDirectory="$INSTALL_PATH"
|
||||
iconFile="$INSTALL_PATH\docs\uninstall.ico"
|
||||
initialState="noShow"
|
||||
startMenu="no"
|
||||
programGroup="yes"
|
||||
startup="no" />
|
||||
</shortcuts>
|
BIN
installer/resources/start.ico
Normal file
BIN
installer/resources/start.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
6
installer/resources/startconsole.html
Normal file
6
installer/resources/startconsole.html
Normal file
@ -0,0 +1,6 @@
|
||||
<html><body>
|
||||
<meta http-equiv="Refresh" CONTENT="0;URL=http://localhost:7657/index.jsp" />
|
||||
Continue to your <a href="http://localhost:7657/index.jsp">I2P Router console</a>.
|
||||
If that page does not load, please make sure I2P is running, or review the file
|
||||
wrapper.log for critical errors.
|
||||
</body></html>
|
BIN
installer/resources/uninstall.ico
Normal file
BIN
installer/resources/uninstall.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
@ -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=.
|
||||
|
117
readme.html
117
readme.html
@ -1,80 +1,71 @@
|
||||
<h1>Congratulations on getting I2P installed!</h1>
|
||||
|
||||
<p>Next up you'll need to go into the <a href="config.jsp">configuration page</a>
|
||||
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.</p>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<p>For help, you may want to review the information on the <a href="http://www.i2p.net/">I2P website</a>,
|
||||
post up messages to the <a href="http://forum.i2p.net/">I2P discussion forum</a>, or swing by #i2p or
|
||||
#i2p-chat on IRC at <a href="irc://irc.freenode.net/#i2p">irc.freenode.net</a>,
|
||||
<a href="http://www.invisiblechat.com/">invisiblechat/IIP</a>, or irc.duck.i2p (they're all
|
||||
linked together).</p>
|
||||
|
||||
<h2>Want I2P to run automatically?</h2>
|
||||
|
||||
<p>With the I2P install we've bundled some scripts and code (from the cool folks at
|
||||
<a href="http://wrapper.tanukisoftware.org/doc/english/">tanukisoftware</a>) 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 <a href="/configservice.jsp">service control page</a>, or
|
||||
through the install_i2p_service_winnt.bat and uninstall_i2p_service_winnt.bat scripts. *nix
|
||||
users can script up something to call <code>./i2prouter start</code> 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.</p>
|
||||
|
||||
<h2>What next?</h2>
|
||||
|
||||
<p>By default, I2P comes bundled with the <a href="http://www.i2p.net/i2ptunnel">I2PTunnel</a>
|
||||
application configured with an <b>HTTP proxy</b> listening on <b>port 4444</b> and an
|
||||
<b>IRC proxy</b> listening on <b>port 6668</b>.</p>
|
||||
|
||||
<p>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:</p>
|
||||
|
||||
<p>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, <a href="#trouble">see below</a>). Once those are up, you can:</p>
|
||||
<ul>
|
||||
<li><a href="http://duck.i2p/">duck.i2p</a>: duck's eepsite, with links to other active sites</li>
|
||||
<li><a href="http://ugha.i2p/">ugha.i2p</a>: ugha's eepsite, a wiki that anyone can edit, and lots of links</li>
|
||||
<li><a href="http://forum.i2p/">forum.i2p</a>: a secure and anonymous connection to <a href="http://forum.i2p.net/">forum.i2p.net</a></li>
|
||||
<li><a href="http://www.i2p/">www.i2p</a>: a secure and anonymous connection to <a href="http://www.i2p.net/">www.i2p.net</a></li>
|
||||
<li><a href="http://dev.i2p/">dev.i2p</a>: a secure and anonymous connection to <a href="http://dev.i2p.net/">dev.i2p.net</a></li>
|
||||
<li><a href="http://fproxy.i2p/">fproxy.i2p</a>:
|
||||
a secure and anonymous connection to a freenet node</li>
|
||||
<li><a href="http://www.postman.i2p/">www.postman.i2p</a>: an anonymous email provider, allowing
|
||||
mail within I2P, as well as to and from the internet (via @i2pmail.org)</li>
|
||||
<li><b>chat anonymously</b> - fire up your own IRC client and connect to the
|
||||
server at <b>localhost port 6668</b>. 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.</li>
|
||||
<li><b>browse "eepsites"</b> - on I2P there are anonymously hosted websites -
|
||||
tell your browser to use the <b>HTTP proxy at localhost port 4444</b>, then
|
||||
browse to an eepsite -
|
||||
<ul>
|
||||
<li><a href="http://duck.i2p/">duck.i2p</a>: duck's eepsite, with links to other active sites</li>
|
||||
<li><a href="http://ugha.i2p/">ugha.i2p</a>: ugha's eepsite, a wiki that anyone can edit, and lots of links</li>
|
||||
<li><a href="http://files.i2p/">files.i2p</a>: a search engine that tries to keep track of things on I2P</li>
|
||||
<li><a href="http://forum.i2p/">forum.i2p</a>: a secure and anonymous connection to <a href="http://forum.i2p.net/">forum.i2p.net</a></li>
|
||||
<li><a href="http://www.i2p/">www.i2p</a>: a secure and anonymous connection to <a href="http://www.i2p.net/">www.i2p.net</a></li>
|
||||
<li><a href="http://dev.i2p/">dev.i2p</a>: a secure and anonymous connection to <a href="http://dev.i2p.net/">dev.i2p.net</a></li>
|
||||
<li><a href="http://fproxy.i2p/">fproxy.i2p</a>: a secure and anonymous connection to a freenet node</li>
|
||||
</ul>
|
||||
There are many more eepsites - just follow the links from the ones you see,
|
||||
bookmark your favorites, and visit them often!</li>
|
||||
<li><b>browse the web</b> - 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.</li>
|
||||
<li><b>transfer files</b> - there is an <a href="http://duck.i2p/i2p-bt/">I2P port</a>
|
||||
of the <a href="http://www.bittorrent.com/">BitTorrent</a> application available.</li>
|
||||
<li><b>use anonymous email</b> - 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 <a href="http://www.postman.i2p/">www.postman.i2p</a>.</li>
|
||||
<li>and lots more</li>
|
||||
</ul>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<p>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 <a href="/i2ptunnel/" target="_blank">I2PTunnel configuration interface</a> 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.</p>
|
||||
|
||||
<h2>Want your own eepsite?</h2>
|
||||
<p>In addition, we've configured some software to let you run your own eepsite - a
|
||||
|
||||
<p>We've bundled some software to let you run your own eepsite - a
|
||||
<a href="http://jetty.mortbay.org/">Jetty</a> instance listening on
|
||||
<a href="http://localhost:7658/">http://localhost:7658/</a>. Simply place your files in
|
||||
the <code>eepsite/docroot/</code> directory (or any standard JSP/Servlet <code>.war</code>
|
||||
files under <code>eepsite/webapps</code>) and they'll show up. Your eepsite's
|
||||
<i>destination</i> (which uniquely and securly identifies it) is shown on the I2PTunnel
|
||||
<i>destination</i> (which uniquely and securely identifies it) is shown on the I2PTunnel
|
||||
<a href="/i2ptunnel/">configuration page</a> - if you want other people to see your eepsite,
|
||||
you need to give them that really huge string. Just paste it into the
|
||||
<a href="http://forum.i2p/viewforum.php?f=16">Eepsite announce</a> forum, add it to
|
||||
ugha's <a href="http://ugha.i2p/I2pLinks">wiki</a>, 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).</p>
|
||||
|
||||
<h2><a name="trouble">Troubleshooting</a></h2>
|
||||
|
||||
<p>If the left hand side has a warning, telling you to check your NAT or firewall, please
|
||||
see the <a href="/config.jsp">config page</a> and make sure that you can receive <b>inbound
|
||||
TCP connections on port 8887</b> (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).</p>
|
||||
|
||||
<p>If you are still having problems, you may want to review the information on the
|
||||
<a href="http://www.i2p.net/">I2P website</a>, post up messages to the
|
||||
<a href="http://forum.i2p.net/">I2P discussion forum</a>, or swing by #i2p or
|
||||
#i2p-chat on IRC at <a href="irc://irc.freenode.net/#i2p">irc.freenode.net</a>,
|
||||
<a href="http://www.invisiblechat.com/">invisiblechat/IIP</a>, or irc.duck.i2p (they're all
|
||||
linked together).</p>
|
||||
|
||||
<p><b>As a note, you can change this page by editing the file "docs/readme.html"</b></p>
|
@ -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");
|
||||
|
@ -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);
|
||||
|
@ -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() {
|
||||
|
87
router/java/src/net/i2p/router/startup/VerifyClasspath.java
Normal file
87
router/java/src/net/i2p/router/startup/VerifyClasspath.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user