merge of '65027e70ec9585f6013d97ec88d4f251869e47fd'

and 'c26f9208a0245c8b4b421076479271214ff1d660'
This commit is contained in:
str4d
2016-06-13 06:03:03 +00:00
47 changed files with 618 additions and 279 deletions

View File

@ -11,9 +11,10 @@ import java.util.Iterator;
import java.util.Set; import java.util.Set;
import net.i2p.data.Hash; import net.i2p.data.Hash;
import net.i2p.data.DataHelper import net.i2p.data.DataHelper;
import net.i2p.router.Router; import net.i2p.router.Router;
import net.i2p.router.RouterContext; import net.i2p.router.RouterContext;
import net.i2p.router.web.StatsGenerator;
import net.i2p.util.I2PThread; import net.i2p.util.I2PThread;
import net.i2p.util.Log; import net.i2p.util.Log;
@ -49,7 +50,7 @@ class AdminRunner implements Runnable {
} else if ( (command.indexOf("routerStats.html") >= 0) || (command.indexOf("oldstats.jsp") >= 0) ) { } else if ( (command.indexOf("routerStats.html") >= 0) || (command.indexOf("oldstats.jsp") >= 0) ) {
try { try {
out.write(DataHelper.getASCII("HTTP/1.1 200 OK\nConnection: close\nCache-control: no-cache\nContent-type: text/html\n\n")); out.write(DataHelper.getASCII("HTTP/1.1 200 OK\nConnection: close\nCache-control: no-cache\nContent-type: text/html\n\n"));
_generator.generateStatsPage(new OutputStreamWriter(out)); _generator.generateStatsPage(new OutputStreamWriter(out), true);
out.close(); out.close();
} catch (IOException ioe) { } catch (IOException ioe) {
if (_log.shouldLog(Log.WARN)) if (_log.shouldLog(Log.WARN))
@ -63,7 +64,8 @@ class AdminRunner implements Runnable {
} else if (true || command.indexOf("routerConsole.html") > 0) { } else if (true || command.indexOf("routerConsole.html") > 0) {
try { try {
out.write(DataHelper.getASCII("HTTP/1.1 200 OK\nConnection: close\nCache-control: no-cache\nContent-type: text/html\n\n")); out.write(DataHelper.getASCII("HTTP/1.1 200 OK\nConnection: close\nCache-control: no-cache\nContent-type: text/html\n\n"));
_context.router().renderStatusHTML(new OutputStreamWriter(out)); // TODO Not technically the same as router().renderStatusHTML() was
_context.routerAppManager().renderStatusHTML(new OutputStreamWriter(out));
out.close(); out.close();
} catch (IOException ioe) { } catch (IOException ioe) {
if (_log.shouldLog(Log.WARN)) if (_log.shouldLog(Log.WARN))

View File

@ -50,6 +50,10 @@
<pathelement location="../../jetty/jettylib/javax.servlet.jar" /> <pathelement location="../../jetty/jettylib/javax.servlet.jar" />
<!-- jsp-api.jar only present for debian builds --> <!-- jsp-api.jar only present for debian builds -->
<pathelement location="../../jetty/jettylib/jsp-api.jar" /> <pathelement location="../../jetty/jettylib/jsp-api.jar" />
<!-- jetty-i2p.jar only for RunStandalone -->
<pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
<!-- systray.jar only for RunStandalone -->
<pathelement location="../../systray/java/build/systray.jar" />
</classpath> </classpath>
</javac> </javac>
</target> </target>
@ -71,7 +75,7 @@
<target name="jar" depends="builddep, compile, jarUpToDate, listChangedFiles" unless="jar.uptodate" > <target name="jar" depends="builddep, compile, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
<!-- set if unset --> <!-- set if unset -->
<property name="workspace.changes.tr" value="" /> <property name="workspace.changes.tr" value="" />
<jar destfile="./build/i2psnark.jar" basedir="./build/obj" includes="**/*.class" excludes="**/web/* **/messages_*.class"> <jar destfile="./build/i2psnark.jar" basedir="./build/obj" includes="**/*.class" excludes="**/web/* **/messages_*.class, **/standalone/*">
<manifest> <manifest>
<attribute name="Main-Class" value="org.klomp.snark.CommandLine" /> <attribute name="Main-Class" value="org.klomp.snark.CommandLine" />
<attribute name="Class-Path" value="i2p.jar mstreaming.jar streaming.jar" /> <attribute name="Class-Path" value="i2p.jar mstreaming.jar streaming.jar" />
@ -179,29 +183,120 @@
<zipfileset dir="./dist/" prefix="i2psnark/" /> <zipfileset dir="./dist/" prefix="i2psnark/" />
</zip> </zip>
</target> </target>
<target name="standalone_prep" depends="war">
<!-- make a fat jar for standalone -->
<target name="standalone_jar" depends="war">
<!-- set if unset -->
<property name="workspace.changes.tr" value="" />
<jar destfile="build/i2psnark-standalone.jar">
<fileset dir="build/obj" includes="**/standalone/*.class" />
<zipfileset src="build/i2psnark.jar" />
<zipfileset src="../../../core/java/build/i2p.jar" />
<zipfileset src="../../jetty/jettylib/commons-logging.jar" />
<!-- without this we get a warning about 'no JSP support' but that's it
<zipfileset src="../../jetty/jettylib/jasper-runtime.jar" />
-->
<zipfileset src="../../jetty/jettylib/javax.servlet.jar" />
<zipfileset src="../../jetty/jettylib/jetty-continuation.jar" />
<zipfileset src="../../jetty/jettylib/jetty-deploy.jar" />
<zipfileset src="../../jetty/jettylib/jetty-http.jar" />
<zipfileset src="../../jetty/jettylib/jetty-i2p.jar" />
<zipfileset src="../../jetty/jettylib/jetty-io.jar" />
<zipfileset src="../../jetty/jettylib/jetty-security.jar" />
<zipfileset src="../../jetty/jettylib/jetty-servlet.jar" />
<zipfileset src="../../jetty/jettylib/jetty-util.jar" />
<zipfileset src="../../jetty/jettylib/jetty-webapp.jar" />
<zipfileset src="../../jetty/jettylib/jetty-xml.jar" />
<zipfileset src="../../jetty/jettylib/org.mortbay.jetty.jar" />
<zipfileset src="../../ministreaming/java/build/mstreaming.jar" />
<zipfileset src="../../streaming/java/build/streaming.jar" />
<zipfileset src="../../systray/java/build/systray.jar" />
<manifest>
<attribute name="Main-Class" value="org.klomp.snark.standalone.RunStandalone"/>
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
<!-- this is so Jetty will report its version correctly -->
<section name="org/eclipse/jetty/server/" >
<attribute name="Implementation-Vendor" value="Eclipse.org - Jetty" />
<attribute name="Implementation-Version" value="8.1.17.v20150415" />
</section>
</manifest>
</jar>
</target>
<!-- add css, image, and js files for standalone snark to the war -->
<target name="standalone_war" depends="war">
<mkdir dir="build/standalone-resources/.resources/themes/snark" />
<copy todir="build/standalone-resources/.resources/themes/snark" >
<fileset dir="../../../installer/resources/themes/snark/" />
</copy>
<replace dir="build/standalone-resources/.resources/themes/snark"
summary="true"
token="url('/themes/"
value="url('/i2psnark/.resources/themes/" >
<include name="**/*.css" />
</replace>
<replace dir="build/standalone-resources/.resources/themes/snark"
summary="true"
token="url('../../console/images/"
value="url('/i2psnark/.resources/themes/snark/ubergine/images/" >
<include name="**/*.css" />
</replace>
<replace dir="build/standalone-resources/.resources/themes/snark"
summary="true"
token="url('../../console/dark/images/"
value="url('/i2psnark/.resources/themes/snark/ubergine/images/" >
<include name="**/*.css" />
</replace>
<replace dir="build/standalone-resources/.resources/themes/snark"
summary="true"
token="url('../../console/light/images/"
value="url('/i2psnark/.resources/themes/snark/ubergine/images/" >
<include name="**/*.css" />
</replace>
<replace dir="build/standalone-resources/.resources/themes/snark"
summary="true"
token="url('images/"
value="url('/i2psnark/.resources/themes/snark/ubergine/images/" >
<include name="**/*.css" />
</replace>
<copy todir="build/standalone-resources/.resources/themes/snark/ubergine/images" >
<!-- we really don't need all of these -->
<fileset dir="../../../installer/resources/themes/console/images/" />
</copy>
<copy file="../../../installer/resources/themes/console/dark/images/transparent.gif"
todir="build/standalone-resources/.resources/themes/snark/ubergine/images" />
<copy file="../../../installer/resources/themes/console/dark/images/header.png"
todir="build/standalone-resources/.resources/themes/snark/ubergine/images" />
<mkdir dir="build/standalone-resources/.resources/js" />
<copy file="../../routerconsole/jsp/js/ajax.js" todir="build/standalone-resources/.resources/js" />
<zip destfile="../i2psnark.war" update="true" duplicate="preserve" >
<fileset dir="build/standalone-resources" />
</zip>
</target>
<target name="standalone_prep" depends="standalone_jar, standalone_war">
<delete dir="./dist" /> <delete dir="./dist" />
<mkdir dir="./dist" /> <mkdir dir="./dist" />
<copy file="../launch-i2psnark" todir="./dist/" /> <copy file="../launch-i2psnark" todir="./dist/" />
<mkdir dir="./dist/contexts" />
<copy file="../standalone-context.xml" tofile="./dist/contexts/context.xml" />
<mkdir dir="./dist/docroot" />
<copy file="../standalone-index.html" tofile="./dist/docroot/index.html" />
<mkdir dir="./dist/webapps" /> <mkdir dir="./dist/webapps" />
<copy file="../i2psnark.war" tofile="./dist/webapps/i2psnark.war" /> <copy file="../i2psnark.war" tofile="./dist/webapps/i2psnark.war" />
<mkdir dir="./dist/lib" />
<copy file="./build/i2psnark.jar" tofile="./dist/lib/i2psnark.jar" />
<copy file="../../../core/java/build/i2p.jar" tofile="./dist/lib/i2p.jar" />
<copy file="../../jetty/jettylib/commons-el.jar" tofile="./dist/lib/commons-el.jar" />
<copy file="../../jetty/jettylib/commons-logging.jar" tofile="./dist/lib/commons-logging.jar" />
<copy file="../../jetty/jettylib/javax.servlet.jar" tofile="./dist/lib/javax.servlet.jar" />
<copy file="../../jetty/jettylib/org.mortbay.jetty.jar" tofile="./dist/lib/org.mortbay.jetty.jar" />
<copy file="../../jetty/jettylib/jasper-runtime.jar" tofile="./dist/lib/jasper-runtime.jar" />
<copy file="../../ministreaming/java/build/mstreaming.jar" tofile="./dist/lib/mstreaming.jar" />
<copy file="../../streaming/java/build/streaming.jar" tofile="./dist/lib/streaming.jar" />
<copy file="../jetty-i2psnark.xml" tofile="./dist/jetty-i2psnark.xml" /> <copy file="../jetty-i2psnark.xml" tofile="./dist/jetty-i2psnark.xml" />
<copy file="./build/i2psnark-standalone.jar" tofile="./dist/i2psnark.jar" />
<copy file="../readme-standalone.txt" tofile="./dist/readme.txt" /> <copy file="../readme-standalone.txt" tofile="./dist/readme.txt" />
<!-- temp so announces work -->
<copy file="../../../installer/resources/hosts.txt" tofile="./dist/hosts.txt" />
<copy todir="./dist/licenses" >
<fileset dir="../../../licenses" includes="LICENSE-GPLv2.txt, ABOUT-Jetty.html" />
</copy>
<mkdir dir="./dist/logs" /> <mkdir dir="./dist/logs" />
<zip destfile="i2psnark-standalone.zip">
<zipfileset dir="./dist/" prefix="i2psnark/" />
</zip>
</target> </target>
<target name="clean"> <target name="clean">

View File

@ -233,6 +233,8 @@ public class SnarkManager implements CompleteListener {
_configFile = new File(_configDir, CONFIG_FILE); _configFile = new File(_configDir, CONFIG_FILE);
_trackerMap = new ConcurrentHashMap<String, Tracker>(4); _trackerMap = new ConcurrentHashMap<String, Tracker>(4);
loadConfig(null); loadConfig(null);
if (!ctx.isRouterContext())
Runtime.getRuntime().addShutdownHook(new Thread(new TempDeleter(_util.getTempDir()), "Snark Temp Dir Deleter"));
} }
/** Caller _must_ call loadConfig(file) before this if setting new values /** Caller _must_ call loadConfig(file) before this if setting new values
@ -245,7 +247,7 @@ public class SnarkManager implements CompleteListener {
_monitor = new I2PAppThread(new DirMonitor(), "Snark DirMonitor", true); _monitor = new I2PAppThread(new DirMonitor(), "Snark DirMonitor", true);
_monitor.start(); _monitor.start();
// only if default instance // only if default instance
if ("i2psnark".equals(_contextName)) if (_context.isRouterContext() && "i2psnark".equals(_contextName))
// delay until UpdateManager is there // delay until UpdateManager is there
_context.simpleTimer2().addEvent(new Register(), 4*60*1000); _context.simpleTimer2().addEvent(new Register(), 4*60*1000);
// Not required, Jetty has a shutdown hook // Not required, Jetty has a shutdown hook
@ -254,6 +256,16 @@ public class SnarkManager implements CompleteListener {
_idleChecker.schedule(5*60*1000); _idleChecker.schedule(5*60*1000);
} }
/**
* Only used in app context
* @since 0.9.27
*/
private static class TempDeleter implements Runnable {
private final File file;
public TempDeleter(File f) { file = f; }
public void run() { FileUtil.rmdir(file, false); }
}
/** @since 0.9.4 */ /** @since 0.9.4 */
private class Register implements SimpleTimer.TimedEvent { private class Register implements SimpleTimer.TimedEvent {
public void timeReached() { public void timeReached() {
@ -388,6 +400,8 @@ public class SnarkManager implements CompleteListener {
} }
private int getStartupDelayMinutes() { private int getStartupDelayMinutes() {
if (!_context.isRouterContext())
return 0;
try { try {
return Integer.parseInt(_config.getProperty(PROP_STARTUP_DELAY)); return Integer.parseInt(_config.getProperty(PROP_STARTUP_DELAY));
} catch (NumberFormatException nfe) { } catch (NumberFormatException nfe) {
@ -675,7 +689,8 @@ public class SnarkManager implements CompleteListener {
* @return String[] -- Array of all the themes found, non-null, unsorted * @return String[] -- Array of all the themes found, non-null, unsorted
*/ */
public String[] getThemes() { public String[] getThemes() {
String[] themes; String[] themes;
if (_context.isRouterContext()) {
// "docs/themes/snark/" // "docs/themes/snark/"
File dir = new File(_context.getBaseDir(), "docs/themes/snark"); File dir = new File(_context.getBaseDir(), "docs/themes/snark");
FileFilter fileFilter = new FileFilter() { public boolean accept(File file) { return file.isDirectory(); } }; FileFilter fileFilter = new FileFilter() { public boolean accept(File file) { return file.isDirectory(); } };
@ -689,8 +704,10 @@ public class SnarkManager implements CompleteListener {
} else { } else {
themes = new String[0]; themes = new String[0];
} }
// return the map. } else {
return themes; themes = new String[] { "light", "ubergine", "vanilla" };
}
return themes;
} }
@ -815,7 +832,7 @@ public class SnarkManager implements CompleteListener {
} }
} }
if (startDelay != null){ if (startDelay != null && _context.isRouterContext()) {
int minutes = _util.getStartupDelay(); int minutes = _util.getStartupDelay();
try { minutes = Integer.parseInt(startDelay.trim()); } catch (NumberFormatException nfe) {} try { minutes = Integer.parseInt(startDelay.trim()); } catch (NumberFormatException nfe) {}
if ( minutes != _util.getStartupDelay()) { if ( minutes != _util.getStartupDelay()) {

View File

@ -0,0 +1,62 @@
package org.klomp.snark.standalone;
import java.io.File;
import net.i2p.I2PAppContext;
import net.i2p.apps.systray.UrlLauncher;
import net.i2p.jetty.JettyStart;
/**
* @since moved from ../web and fixed in 0.9.27
*/
public class RunStandalone {
private final JettyStart _jettyStart;
private final I2PAppContext _context;
private int _port = 8002;
private String _host = "127.0.0.1";
private RunStandalone(String args[]) throws Exception {
_context = I2PAppContext.getGlobalContext();
File base = _context.getBaseDir();
File xml = new File(base, "jetty-i2psnark.xml");
_jettyStart = new JettyStart(_context, null, new String[] { xml.getAbsolutePath() } );
if (args.length > 1) {
_port = Integer.parseInt(args[1]);
}
if (args.length > 0) {
_host = args[0];
}
}
/**
* Usage: RunStandalone [host [port]] (but must match what's in the jetty-i2psnark.xml file)
*/
public static void main(String args[]) {
try {
RunStandalone runner = new RunStandalone(args);
runner.start();
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
public void start() {
try {
_jettyStart.startup();
String url = "http://" + _host + ':' + _port + "/i2psnark/";
try {
Thread.sleep(1000);
} catch (InterruptedException ie) {}
UrlLauncher launch = new UrlLauncher(_context, null, new String[] { url } );
launch.startup();
} catch (Exception e) {
e.printStackTrace();
}
}
public void stop() {
_jettyStart.shutdown(null);
}
}

View File

@ -4,7 +4,6 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.Serializable; import java.io.Serializable;
import java.text.Collator;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
@ -192,7 +191,10 @@ public class I2PSnarkServlet extends BasicServlet {
return; return;
} }
_themePath = "/themes/snark/" + _manager.getTheme() + '/'; if (_context.isRouterContext())
_themePath = "/themes/snark/" + _manager.getTheme() + '/';
else
_themePath = _contextPath + WARBASE + "themes/snark/" + _manager.getTheme() + '/';
_imgPath = _themePath + "images/"; _imgPath = _themePath + "images/";
req.setCharacterEncoding("UTF-8"); req.setCharacterEncoding("UTF-8");
@ -285,8 +287,9 @@ public class I2PSnarkServlet extends BasicServlet {
if (!isConfigure) { if (!isConfigure) {
delay = _manager.getRefreshDelaySeconds(); delay = _manager.getRefreshDelaySeconds();
if (delay > 0) { if (delay > 0) {
String jsPfx = _context.isRouterContext() ? "" : ".resources";
//out.write("<meta http-equiv=\"refresh\" content=\"" + delay + ";/i2psnark/" + peerString + "\">\n"); //out.write("<meta http-equiv=\"refresh\" content=\"" + delay + ";/i2psnark/" + peerString + "\">\n");
out.write("<script src=\"/js/ajax.js\" type=\"text/javascript\"></script>\n" + out.write("<script src=\"" + jsPfx + "/js/ajax.js\" type=\"text/javascript\"></script>\n" +
"<script type=\"text/javascript\">\n" + "<script type=\"text/javascript\">\n" +
"var failMessage = \"<div class=\\\"routerdown\\\"><b>" + _t("Router is down") + "<\\/b><\\/div>\";\n" + "var failMessage = \"<div class=\\\"routerdown\\\"><b>" + _t("Router is down") + "<\\/b><\\/div>\";\n" +
"function requestAjax1() { ajax(\"" + _contextPath + "/.ajax/xhr1.html" + "function requestAjax1() { ajax(\"" + _contextPath + "/.ajax/xhr1.html" +
@ -324,17 +327,19 @@ public class I2PSnarkServlet extends BasicServlet {
out.write(_t("I2PSnark")); out.write(_t("I2PSnark"));
else else
out.write(_contextName); out.write(_contextName);
out.write("</a> <a href=\"http://forum.i2p/viewforum.php?f=21\" class=\"snarkRefresh\" target=\"_blank\">");
out.write(_t("Forum"));
out.write("</a>\n"); out.write("</a>\n");
sortedTrackers = _manager.getSortedTrackers(); sortedTrackers = _manager.getSortedTrackers();
for (Tracker t : sortedTrackers) { if (_context.isRouterContext()) {
if (t.baseURL == null || !t.baseURL.startsWith("http")) out.write("<a href=\"http://forum.i2p/viewforum.php?f=21\" class=\"snarkRefresh\" target=\"_blank\">");
continue; out.write(_t("Forum"));
if (_manager.util().isKnownOpenTracker(t.announceURL)) out.write("</a>\n");
continue; for (Tracker t : sortedTrackers) {
out.write(" <a href=\"" + t.baseURL + "\" class=\"snarkRefresh\" target=\"_blank\">" + t.name + "</a>"); if (t.baseURL == null || !t.baseURL.startsWith("http"))
continue;
if (_manager.util().isKnownOpenTracker(t.announceURL))
continue;
out.write(" <a href=\"" + t.baseURL + "\" class=\"snarkRefresh\" target=\"_blank\">" + t.name + "</a>");
}
} }
} }
out.write("</div>\n"); out.write("</div>\n");
@ -2229,12 +2234,14 @@ public class I2PSnarkServlet extends BasicServlet {
out.write("</select><br>" + out.write("</select><br>" +
"<tr><td>"); "<tr><td>");
out.write(_t("Startup delay")); if (_context.isRouterContext()) {
out.write(": <td><input name=\"startupDelay\" size=\"4\" class=\"r\" value=\"" + _manager.util().getStartupDelay() + "\"> "); out.write(_t("Startup delay"));
out.write(_t("minutes")); out.write(": <td><input name=\"startupDelay\" size=\"4\" class=\"r\" value=\"" + _manager.util().getStartupDelay() + "\"> ");
out.write("<br>\n" + out.write(_t("minutes"));
out.write("<br>\n" +
"<tr><td>"); "<tr><td>");
}
out.write(_t("Page size")); out.write(_t("Page size"));
out.write(": <td><input name=\"pageSize\" size=\"4\" maxlength=\"6\" class=\"r\" value=\"" + _manager.getPageSize() + "\"> "); out.write(": <td><input name=\"pageSize\" size=\"4\" maxlength=\"6\" class=\"r\" value=\"" + _manager.getPageSize() + "\"> ");
out.write(_t("torrents")); out.write(_t("torrents"));

View File

@ -1,61 +0,0 @@
package org.klomp.snark.web;
import java.io.File;
import net.i2p.I2PAppContext;
import net.i2p.util.FileUtil;
//import org.eclipse.jetty.server.Server;
/**
* @deprecated does not work
*/
@Deprecated
public class RunStandalone {
/****
static {
System.setProperty("org.mortbay.http.Version.paranoid", "true");
System.setProperty("org.mortbay.xml.XmlParser.NotValidating", "true");
}
****/
private RunStandalone(String args[]) {}
public static void main(String args[]) {
RunStandalone runner = new RunStandalone(args);
runner.start();
}
public void start() {
throw new RuntimeException("unsupported");
/****
File workDir = new File(I2PAppContext.getGlobalContext().getTempDir(), "jetty-work");
boolean workDirRemoved = FileUtil.rmdir(workDir, false);
if (!workDirRemoved)
System.err.println("ERROR: Unable to remove Jetty temporary work directory");
boolean workDirCreated = workDir.mkdirs();
if (!workDirCreated)
System.err.println("ERROR: Unable to create Jetty temporary work directory");
try {
_server = new Server("jetty-i2psnark.xml");
// just blow up NPE if we don't have a context
(_server.getContexts()[0]).setTempDirectory(workDir);
_server.start();
} catch (Exception e) {
e.printStackTrace();
}
****/
}
public void stop() {
throw new RuntimeException("unsupported");
/****
try {
_server.stop();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
****/
}
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd"> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<!-- =============================================================== --> <!-- =============================================================== -->
<!-- This is the configuration for a standalone i2psnark and --> <!-- This is the configuration for a standalone i2psnark and -->
@ -11,7 +11,7 @@
<!-- =============================================================== --> <!-- =============================================================== -->
<!-- Configure the Jetty Server --> <!-- Configure the Jetty Server -->
<!-- =============================================================== --> <!-- =============================================================== -->
<Configure class="org.mortbay.jetty.Server"> <Configure id="Server" class="org.eclipse.jetty.server.Server">
<!-- =============================================================== --> <!-- =============================================================== -->
<!-- Configure the Request Listeners --> <!-- Configure the Request Listeners -->
@ -20,23 +20,18 @@
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Add and configure a HTTP listener to port 8002 --> <!-- Add and configure a HTTP listener to port 8002 -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<Call name="addListener"> <Call name="addConnector">
<Arg> <Arg>
<New class="org.mortbay.http.SocketListener"> <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<Arg> <Set name="host">127.0.0.1</Set>
<New class="org.mortbay.util.InetAddrPort"> <Set name="port">8002</Set>
<Set name="host">127.0.0.1</Set> <Set name="maxIdleTime">600000</Set>
<Set name="port">8002</Set> <Set name="Acceptors">1</Set>
</New> <Set name="statsOn">false</Set>
</Arg> <Set name="lowResourcesConnections">5000</Set>
<Set name="MinThreads">1</Set> <Set name="lowResourcesMaxIdleTime">5000</Set>
<Set name="MaxThreads">10</Set> <Set name="useDirectBuffers">false</Set>
<Set name="MaxIdleTimeMs">30000</Set> </New>
<Set name="LowResourcePersistTimeMs">1000</Set>
<Set name="ConfidentialPort">8443</Set>
<Set name="IntegralPort">8443</Set>
<Set name="PoolName">main</Set>
</New>
</Arg> </Arg>
</Call> </Call>
@ -44,41 +39,103 @@
<!-- Configure the Contexts --> <!-- Configure the Contexts -->
<!-- =============================================================== --> <!-- =============================================================== -->
<!-- =========================================================== -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Set handler Collection Structure -->
<!-- Add a all web application within the webapps directory. --> <!-- =========================================================== -->
<!-- + No virtual host specified --> <Set name="handler">
<!-- + Look in the webapps directory relative to jetty.home or . --> <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
<!-- + Use the default webdefault.xml in jetty's install --> <Set name="handlers">
<!-- + Upack the war file --> <Array type="org.eclipse.jetty.server.Handler">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <Item>
<Set name="rootWebApp">i2psnark</Set> <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
<Call name="addWebApplication"> </Item>
<Arg>/</Arg> <Item>
<Arg>webapps/i2psnark.war</Arg> <New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/>
</Call> </Item>
</Array>
<!-- this is so we can find the css --> </Set>
<Call name="addContext">
<Arg>
<New class="org.mortbay.http.HttpContext">
<Set name="contextPath">/themes</Set>
<Set name="resourceBase">./docs/themes</Set>
<Call name="addHandler">
<Arg>
<New class="org.mortbay.http.handler.ResourceHandler">
<Set name="redirectWelcome">FALSE</Set>
</New>
</Arg>
</Call>
</New> </New>
</Arg> </Set>
</Call>
<!-- =============================================================== -->
<!-- =============================================================== --> <!-- Create the deployment manager -->
<!-- Configure the Other Server Options --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- =============================================================== --> <!-- The deplyment manager handles the lifecycle of deploying web -->
<Set name="requestsPerGC">2000</Set> <!-- applications. Apps are provided by instances of the -->
<Set name="statsOn">false</Set> <!-- AppProvider interface. Typically these are provided by -->
<!-- one or more of: -->
<!-- jetty-webapps.xml - monitors webapps for wars and dirs -->
<!-- jetty-contexts.xml - monitors contexts for context xml -->
<!-- jetty-templates.xml - monitors contexts and templates -->
<!-- =============================================================== -->
<Call name="addBean">
<Arg>
<New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">
<Set name="contexts">
<Ref id="Contexts" />
</Set>
<Call name="setContextAttribute">
<Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
<Arg>.*/.*jsp-api-[^/]*\.jar$|.*/.*jsp-[^/]*\.jar$|.*/.*taglibs[^/]*\.jar$</Arg>
</Call>
</New>
</Arg>
</Call>
<!-- =========================================================== -->
<!-- Configure the context deployer -->
<!-- A context deployer will deploy contexts described in -->
<!-- configuration files discovered in a directory. -->
<!-- The configuration directory can be scanned for hot -->
<!-- deployments at the configured scanInterval. -->
<!-- -->
<!-- This deployer is configured to deploy contexts configured -->
<!-- in the $JETTY_HOME/contexts directory -->
<!-- -->
<!-- =========================================================== -->
<Ref id="DeploymentManager">
<Call name="addAppProvider">
<Arg>
<New class="org.eclipse.jetty.deploy.providers.ContextProvider">
<Set name="monitoredDirName">./contexts</Set>
<Set name="scanInterval">0</Set>
</New>
</Arg>
</Call>
</Ref>
<!-- =========================================================== -->
<!-- Configure the webapp deployer. -->
<!-- A webapp deployer will deploy standard webapps discovered -->
<!-- in a directory at startup, without the need for additional -->
<!-- configuration files. It does not support hot deploy or -->
<!-- non standard contexts (see ContextDeployer above). -->
<!-- -->
<!-- This deployer is configured to deploy webapps from the -->
<!-- $JETTY_HOME/webapps directory -->
<!-- -->
<!-- Normally only one type of deployer need be used. -->
<!-- -->
<!-- =========================================================== -->
<Ref id="DeploymentManager">
<Call id="webappprovider" name="addAppProvider">
<Arg>
<New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
<Set name="monitoredDirName">./webapps</Set>
<Set name="parentLoaderPriority">false</Set>
<Set name="extractWars">false</Set>
<Set name="scanInterval">0</Set>
</New>
</Arg>
</Call>
</Ref>
<!-- ===================== -->
<!-- DefaultHandler config -->
<!-- http://stackoverflow.com/questions/4202275/how-to-prevent-jetty-from-showing-context-related-information -->
<!-- ===================== -->
<Ref id="DefaultHandler">
<Set name="showContexts">false</Set>
</Ref>
</Configure> </Configure>

View File

@ -5,4 +5,4 @@
# i2psnark will be accessed at http://127.0.0.1:8002/ # i2psnark will be accessed at http://127.0.0.1:8002/
# #
I2P="." I2P="."
java -cp "$I2P/lib/i2psnark.jar:$I2P/lib/i2p.jar:$I2P/lib/mstreaming.jar:$I2P/lib/streaming.jar:$I2P/lib/commons-el.jar:$I2P/lib/commons-logging.jar:$I2P/lib/jasper-compiler.jar:$I2P/lib/jasper-runtime.jar:$I2P/lib/javax.servlet.jar:$I2P/lib/org.mortbay.jetty.jar" org.klomp.snark.web.RunStandalone "$@" java -jar "$I2P/i2psnark.jar"

View File

@ -1,4 +1,12 @@
i2psnark is packaged as a webapp running in the router console. To run i2psnark's standalone mode make sure you have an i2p router running in the background, then run:
Command line and standalone operation of i2psnark are not currently supported.
See http://trac.i2p2.i2p/ticket/1191 or http://trac.i2p2.de/ticket/1191 java -jar i2psnark.jar
for the status of restoring standalone support.
I2PSnark web ui will be at http://127.0.0.1:8002/i2psnark/
Please note that http://127.0.0.1:8002/ will 404, to be fixed
I2PSnark is GPL'ed software, based on Snark (http://www.klomp.org/) to run on top of I2P
(https://geti2p.net/) within a webserver (such as the bundled Jetty from
https://www.eclipse.org/jetty/). For more information about I2PSnark, get in touch
with the folks at http://forum.i2p2.de/

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<!--
Configure a custom context for the site.
This context contains only a ServletContextHandler with a default servlet
to serve static html files and images.
-->
<Configure class="org.eclipse.jetty.servlet.ServletContextHandler">
<Set name="contextPath">/</Set>
<Set name="resourceBase">./docroot/</Set>
<Call name="setInitParameter">
<Arg>org.eclipse.jetty.servlet.Default.cacheControl</Arg>
<Arg>max-age=3600,public</Arg>
</Call>
<Call name="addServlet">
<Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
<Arg>/</Arg>
</Call>
</Configure>

View File

@ -0,0 +1,15 @@
<html>
<head>
<!--
* Remove the following three lines to stop redirecting to the i2psnark page.
* If it continues to redirect, clear your browser's cache.
-->
<meta http-equiv="refresh" content="1;url=/i2psnark/" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<title>I2PSnark Standalone</title>
</head>
<body>
Redirecting to <a href="/i2psnark/">i2psnark</a>...
</body>
</html>

View File

@ -1338,7 +1338,6 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging {
} }
if (i < args.length) { if (i < args.length) {
host = args[i++]; host = args[i++];
listenHost = host;
} }
if (i < args.length) if (i < args.length)
port = args[i]; port = args[i];

View File

@ -5,6 +5,7 @@ import java.io.InputStreamReader;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.Socket; import java.net.Socket;
import net.i2p.data.DataHelper;
import net.i2p.util.Log; import net.i2p.util.Log;
public class TestCreateSessionDatagram { public class TestCreateSessionDatagram {

View File

@ -5,6 +5,7 @@ import java.io.InputStreamReader;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.Socket; import java.net.Socket;
import net.i2p.data.DataHelper;
import net.i2p.util.Clock; import net.i2p.util.Clock;
import net.i2p.util.Log; import net.i2p.util.Log;

View File

@ -37,11 +37,8 @@ public class TestDatagramTransfer {
line = reader.readLine(); line = reader.readLine();
_log.info("Response from the lookup for ME: " + line); _log.info("Response from the lookup for ME: " + line);
_log.debug("The above should be a NAMING REPLY"); _log.debug("The above should be a NAMING REPLY");
StringTokenizer tok = new StringTokenizer(line); Properties props = SAMUtils.parseParams(line);
String maj = tok.nextToken();
String min = tok.nextToken();
Properties props = SAMUtils.parseParams(tok);
String value = props.getProperty("VALUE"); String value = props.getProperty("VALUE");
if (value == null) { if (value == null) {
_log.error("No value for ME found! [" + line + "]"); _log.error("No value for ME found! [" + line + "]");
@ -53,10 +50,7 @@ public class TestDatagramTransfer {
String send = "DATAGRAM SEND DESTINATION=" + value + " SIZE=3\nYo!"; String send = "DATAGRAM SEND DESTINATION=" + value + " SIZE=3\nYo!";
out.write(DataHelper.getASCII(send)); out.write(DataHelper.getASCII(send));
line = reader.readLine(); line = reader.readLine();
tok = new StringTokenizer(line); props = SAMUtils.parseParams(line);
maj = tok.nextToken();
min = tok.nextToken();
props = SAMUtils.parseParams(tok);
String size = props.getProperty("SIZE"); String size = props.getProperty("SIZE");
String from = props.getProperty("DESTINATION"); String from = props.getProperty("DESTINATION");
if ( (value == null) || (size == null) || if ( (value == null) || (size == null) ||

View File

@ -5,6 +5,7 @@ import java.io.InputStreamReader;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.Socket; import java.net.Socket;
import net.i2p.data.DataHelper;
import net.i2p.util.Log; import net.i2p.util.Log;
public class TestDest { public class TestDest {

View File

@ -5,6 +5,7 @@ import java.io.InputStreamReader;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.Socket; import java.net.Socket;
import net.i2p.data.DataHelper;
import net.i2p.util.Log; import net.i2p.util.Log;
public class TestNaming { public class TestNaming {

View File

@ -7,6 +7,7 @@ import java.net.Socket;
import java.util.Properties; import java.util.Properties;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import net.i2p.data.DataHelper;
import net.i2p.util.Log; import net.i2p.util.Log;
public class TestRawTransfer { public class TestRawTransfer {
@ -36,11 +37,8 @@ public class TestRawTransfer {
line = reader.readLine(); line = reader.readLine();
_log.info("Response from the lookup for ME: " + line); _log.info("Response from the lookup for ME: " + line);
_log.debug("The above should be a NAMING REPLY"); _log.debug("The above should be a NAMING REPLY");
StringTokenizer tok = new StringTokenizer(line); Properties props = SAMUtils.parseParams(line);
String maj = tok.nextToken();
String min = tok.nextToken();
Properties props = SAMUtils.parseParams(tok);
String value = props.getProperty("VALUE"); String value = props.getProperty("VALUE");
if (value == null) { if (value == null) {
_log.error("No value for ME found! [" + line + "]"); _log.error("No value for ME found! [" + line + "]");
@ -53,10 +51,7 @@ public class TestRawTransfer {
out.write(DataHelper.getASCII(send)); out.write(DataHelper.getASCII(send));
line = reader.readLine(); line = reader.readLine();
try { try {
tok = new StringTokenizer(line); props = SAMUtils.parseParams(line);
maj = tok.nextToken();
min = tok.nextToken();
props = SAMUtils.parseParams(tok);
} catch (Exception e) { } catch (Exception e) {
_log.error("Error parsing response line: [" + line + "]", e); _log.error("Error parsing response line: [" + line + "]", e);
return; return;

View File

@ -75,10 +75,7 @@ public class TestStreamTransfer {
req = "NAMING LOOKUP NAME=ME\n"; req = "NAMING LOOKUP NAME=ME\n";
out.write(DataHelper.getASCII(req)); out.write(DataHelper.getASCII(req));
line = reader.readLine(); line = reader.readLine();
StringTokenizer tok = new StringTokenizer(line); Properties props = SAMUtils.parseParams(line);
String maj = tok.nextToken();
String min = tok.nextToken();
Properties props = SAMUtils.parseParams(tok);
String value = props.getProperty("VALUE"); String value = props.getProperty("VALUE");
if (value == null) { if (value == null) {
_log.error("No value for ME found! [" + line + "]"); _log.error("No value for ME found! [" + line + "]");
@ -124,10 +121,9 @@ public class TestStreamTransfer {
private void doRun() throws IOException, SAMException { private void doRun() throws IOException, SAMException {
String line = _reader.readLine(); String line = _reader.readLine();
_log.debug("Read: " + line); _log.debug("Read: " + line);
StringTokenizer tok = new StringTokenizer(line); Properties props = SAMUtils.parseParams(line);
String maj = tok.nextToken(); String maj = props.getProperty(SAMUtils.COMMAND);
String min = tok.nextToken(); String min = props.getProperty(SAMUtils.OPCODE);
Properties props = SAMUtils.parseParams(tok);
if ( ("STREAM".equals(maj)) && ("CONNECTED".equals(min)) ) { if ( ("STREAM".equals(maj)) && ("CONNECTED".equals(min)) ) {
String dest = props.getProperty("DESTINATION"); String dest = props.getProperty("DESTINATION");
String id = props.getProperty("ID"); String id = props.getProperty("ID");
@ -225,10 +221,7 @@ public class TestStreamTransfer {
out.write(DataHelper.getASCII(req)); out.write(DataHelper.getASCII(req));
line = reader.readLine(); line = reader.readLine();
_log.info("Response to the stream connect from "+sessionName+" to Alice: " + line); _log.info("Response to the stream connect from "+sessionName+" to Alice: " + line);
StringTokenizer tok = new StringTokenizer(line); Properties props = SAMUtils.parseParams(line);
String maj = tok.nextToken();
String min = tok.nextToken();
Properties props = SAMUtils.parseParams(tok);
_log.info("props = " + props); _log.info("props = " + props);
String result = props.getProperty("RESULT"); String result = props.getProperty("RESULT");
if (!("OK".equals(result))) { if (!("OK".equals(result))) {

View File

@ -143,15 +143,15 @@ public class TestSwarm {
_samOut.write(DataHelper.getASCII("HELLO VERSION MIN=1.0 MAX=1.0\n")); _samOut.write(DataHelper.getASCII("HELLO VERSION MIN=1.0 MAX=1.0\n"));
_samOut.flush(); _samOut.flush();
_log.debug("Hello sent"); _log.debug("Hello sent");
boolean ok = _eventHandler.waitForHelloReply(); String serverVersion = _eventHandler.waitForHelloReply();
_log.debug("Hello reply found: " + ok); _log.debug("Hello reply found: " + serverVersion);
if (!ok) if (serverVersion == null)
throw new IOException("wtf, hello failed?"); throw new IOException("wtf, hello failed?");
String req = "SESSION CREATE STYLE=STREAM DESTINATION=" + _destFile + " " + _conOptions + "\n"; String req = "SESSION CREATE STYLE=STREAM DESTINATION=" + _destFile + " " + _conOptions + "\n";
_samOut.write(DataHelper.getUTF8(req)); _samOut.write(DataHelper.getUTF8(req));
_samOut.flush(); _samOut.flush();
_log.debug("Session create sent"); _log.debug("Session create sent");
ok = _eventHandler.waitForSessionCreateReply(); boolean ok = _eventHandler.waitForSessionCreateReply();
_log.debug("Session create reply found: " + ok); _log.debug("Session create reply found: " + ok);
req = "NAMING LOOKUP NAME=ME\n"; req = "NAMING LOOKUP NAME=ME\n";

View File

@ -182,6 +182,7 @@
</delete> </delete>
<delete dir="${bin}" /> <delete dir="${bin}" />
<delete dir="${tmp}" /> <delete dir="${tmp}" />
<delete dir="build" />
</target> </target>
<target name="distclean" depends="clean" /> <target name="distclean" depends="clean" />
</project> </project>

View File

@ -150,6 +150,7 @@
<target name="clean"> <target name="clean">
<delete dir="src/WEB-INF/classes"/> <delete dir="src/WEB-INF/classes"/>
<delete file="susimail.war"/> <delete file="susimail.war"/>
<delete dir="build"/>
</target> </target>
<target name="cleandep" depends="clean" /> <target name="cleandep" depends="clean" />
<target name="distclean" depends="clean" /> <target name="distclean" depends="clean" />

View File

@ -320,7 +320,7 @@
<copy file="apps/imagegen/imagegen/build/imagegen.war" todir="build/" /> <copy file="apps/imagegen/imagegen/build/imagegen.war" todir="build/" />
</target> </target>
<target name="buildI2PSnark" depends="buildStreaming, buildJetty" > <target name="buildI2PSnark" depends="buildStreaming, buildJetty, buildSystray" >
<ant dir="apps/i2psnark/java/" target="war" /> <ant dir="apps/i2psnark/java/" target="war" />
<copy file="apps/i2psnark/i2psnark.war" todir="build/" /> <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
<copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" /> <copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" />
@ -344,7 +344,7 @@
<copy file="apps/i2ptunnel/java/build/i2ptunnel-ui.jar" todir="build/" /> <copy file="apps/i2ptunnel/java/build/i2ptunnel-ui.jar" todir="build/" />
</target> </target>
<target name="buildI2PTunnel" depends="buildStreaming, buildJetty" > <target name="buildI2PTunnel" depends="buildStreaming, buildJetty, buildImagegen" >
<ant dir="apps/i2ptunnel/java/" target="build" /> <ant dir="apps/i2ptunnel/java/" target="build" />
<copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" /> <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
<copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" /> <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
@ -1832,10 +1832,13 @@
<ant dir="apps/syndie/java/" target="standalone" /> <ant dir="apps/syndie/java/" target="standalone" />
<copy file="apps/syndie/java/syndie-standalone.zip" todir="." /> <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
</target> --> </target> -->
<target name="i2psnark" depends="buildProperties" >
<!-- standalone i2psnark zip -->
<target name="i2psnark" depends="buildStreaming, buildJetty, buildSystray" >
<ant dir="apps/i2psnark/java" target="standalone" /> <ant dir="apps/i2psnark/java" target="standalone" />
<copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." /> <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
</target> </target>
<target name="slackpkg"> <target name="slackpkg">
<ant dir="Slackware/i2p/" target="slackpkg" /> <ant dir="Slackware/i2p/" target="slackpkg" />
</target> </target>
@ -2220,8 +2223,11 @@
</tar> </tar>
</target> </target>
<!-- same as debian-tarball but with bundled jetty --> <!-- same as debian-release-tarball but with bundled jetty
<target name="precise-tarball" depends="getExtendedVersion"> - We add a 'p' to the release name and tarball since the source package is different;
- Launchpad does not allow different source packages with the same name.
-->
<target name="precise-release-tarball" depends="getExtendedVersion">
<!-- this will use the monotonerc file in the current workspace --> <!-- this will use the monotonerc file in the current workspace -->
<fail message="This target cannot be used without Monotone! Use &quot;fakeroot debian/rules get-orig-source&quot; instead."> <fail message="This target cannot be used without Monotone! Use &quot;fakeroot debian/rules get-orig-source&quot; instead.">
<condition> <condition>
@ -2230,7 +2236,7 @@
</not> </not>
</condition> </condition>
</fail> </fail>
<property name="debian.tarball.name" value="i2p_${Extended.Version}.orig.tar.bz2" /> <property name="debian.tarball.name" value="i2p_${release.number}p.orig.tar.bz2" />
<echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" /> <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
<delete dir="../i2p-${Extended.Version}" /> <delete dir="../i2p-${Extended.Version}" />
<exec executable="mtn" failonerror="true"> <exec executable="mtn" failonerror="true">
@ -2238,6 +2244,8 @@
<!-- w: is the revision of the current workspace --> <!-- w: is the revision of the current workspace -->
<arg value="-r" /> <arg value="-r" />
<arg value="w:" /> <arg value="w:" />
<arg value="-b" />
<arg value="i2p.i2p" />
<arg value="../i2p-${Extended.Version}" /> <arg value="../i2p-${Extended.Version}" />
</exec> </exec>
<delete includeemptydirs="true" quiet="false"> <delete includeemptydirs="true" quiet="false">
@ -2318,6 +2326,8 @@
<!-- w: is the revision of the current workspace --> <!-- w: is the revision of the current workspace -->
<arg value="-r" /> <arg value="-r" />
<arg value="w:" /> <arg value="w:" />
<arg value="-b" />
<arg value="i2p.i2p" />
<arg value="../i2p-${Extended.Version}" /> <arg value="../i2p-${Extended.Version}" />
</exec> </exec>
<delete includeemptydirs="true" quiet="false"> <delete includeemptydirs="true" quiet="false">

View File

@ -1,4 +1,5 @@
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <gmp.h> #include <gmp.h>
#include "jbigi.h" #include "jbigi.h"
@ -15,7 +16,7 @@ void convert_mp2j(JNIEnv* env, mpz_t mvalue, jbyteArray* jvalue);
* 2: (I2P 0.8.7) * 2: (I2P 0.8.7)
* Removed nativeDoubleValue() * Removed nativeDoubleValue()
* *
* 3: (I2P 0.9.18) * 3: (I2P 0.9.26)
* Added: * Added:
* nativeJbigiVersion() * nativeJbigiVersion()
* nativeGMPMajorVersion() * nativeGMPMajorVersion()
@ -26,8 +27,12 @@ void convert_mp2j(JNIEnv* env, mpz_t mvalue, jbyteArray* jvalue);
* Support negative base value in modPow() * Support negative base value in modPow()
* Throw ArithmeticException for bad arguments in modPow() * Throw ArithmeticException for bad arguments in modPow()
* *
* 4: (I2P 0.9.27)
* Fix nativeGMPMajorVersion(), nativeGMPMinorVersion(), and nativeGMPPatchVersion()
* when built as a shared library
*
*/ */
#define JBIGI_VERSION 3 #define JBIGI_VERSION 4
/***************************************** /*****************************************
*****Native method implementations******* *****Native method implementations*******
@ -39,22 +44,31 @@ JNIEXPORT jint JNICALL Java_net_i2p_util_NativeBigInteger_nativeJbigiVersion
return (jint) JBIGI_VERSION; return (jint) JBIGI_VERSION;
} }
/* since version 3 */ /* since version 3, fixed for dynamic builds in version 4 */
JNIEXPORT jint JNICALL Java_net_i2p_util_NativeBigInteger_nativeGMPMajorVersion JNIEXPORT jint JNICALL Java_net_i2p_util_NativeBigInteger_nativeGMPMajorVersion
(JNIEnv* env, jclass cls) { (JNIEnv* env, jclass cls) {
return (jint) __GNU_MP_VERSION; int v = gmp_version[0] - '0';
return (jint) v;
} }
/* since version 3 */ /* since version 3, fixed for dynamic builds in version 4 */
JNIEXPORT jint JNICALL Java_net_i2p_util_NativeBigInteger_nativeGMPMinorVersion JNIEXPORT jint JNICALL Java_net_i2p_util_NativeBigInteger_nativeGMPMinorVersion
(JNIEnv* env, jclass cls) { (JNIEnv* env, jclass cls) {
return (jint) __GNU_MP_VERSION_MINOR; int v = 0;
if (strlen(gmp_version) > 2) {
v = gmp_version[2] - '0';
}
return (jint) v;
} }
/* since version 3 */ /* since version 3, fixed for dynamic builds in version 4 */
JNIEXPORT jint JNICALL Java_net_i2p_util_NativeBigInteger_nativeGMPPatchVersion JNIEXPORT jint JNICALL Java_net_i2p_util_NativeBigInteger_nativeGMPPatchVersion
(JNIEnv* env, jclass cls) { (JNIEnv* env, jclass cls) {
return (jint) __GNU_MP_VERSION_PATCHLEVEL; int v = 0;
if (strlen(gmp_version) > 4) {
v = gmp_version[4] - '0';
}
return (jint) v;
} }
/******** nativeModPow() */ /******** nativeModPow() */

View File

@ -79,34 +79,32 @@ if [ ! -f "$JAVA_HOME/include/jni.h" ]; then
fi fi
if ! command -v m4 > /dev/null; then if ! command -v m4 > /dev/null; then
printf "\aWARNING: \`m4\` not found. If this process fails to complete, install m4 " >&2 printf "\aWARNING: \`m4\` not found. Install m4 " >&2
printf "and re-run this script.\n\n\n\a" >&2 printf "and re-run this script.\n\n\n\a" >&2
exit 1 exit 1
fi fi
if [ -z $BITS ]; then if [ -z $BITS ]; then
UNAME="$(uname -a)" UNAME="$(uname -m)"
if test "${UNAME#*x86_64}" != "x86_&4"; then if test "${UNAME#*x86_64}" != "$UNAME"; then
BITS=64 BITS=64
elif test "${UNAME#*i386}" != "i386"; then elif test "${UNAME#*i386}" != "$UNAME"; then
BITS=32 BITS=32
elif test "${UNAME#*i686}" != "i686"; then elif test "${UNAME#*i686}" != "$UNAME"; then
BITS=32 BITS=32
elif test "${UNAME#*armv6}" != "armv6"; then elif test "${UNAME#*armv6}" != "$UNAME"; then
BITS=32 BITS=32
elif test "${UNAME#*armv7}" != "armv7"; then elif test "${UNAME#*armv7}" != "$UNAME"; then
BITS=32 BITS=32
elif test "${UNAME#*aarch32}" != "aarch32"; then elif test "${UNAME#*aarch32}" != "$UNAME"; then
BITS=32 BITS=32
elif test "${UNAME#*aarch64}" != "aarch64"; then elif test "${UNAME#*aarch64}" != "$UNAME"; then
BITS=64 BITS=64
else else
echo "Unable to detect default setting for BITS variable" echo "Unable to detect default setting for BITS variable"
exit exit 1
fi fi
printf "\aBITS variable not set, $BITS bit system detected\n\a" >&2 printf "\aBITS variable not set, $BITS bit system detected\n\a" >&2
fi fi
@ -116,6 +114,7 @@ if [ -z $CC ]; then
printf "\aCC variable not set, defaulting to $CC\n\a" >&2 printf "\aCC variable not set, defaulting to $CC\n\a" >&2
fi fi
# FIXME -m32 and -m64 are only for x86
if [ $BITS -eq 32 ]; then if [ $BITS -eq 32 ]; then
export ABI=32 export ABI=32
export CFLAGS="-m32" export CFLAGS="-m32"

View File

@ -85,7 +85,12 @@
<!-- the getopt translation files --> <!-- the getopt translation files -->
<fileset dir="src" includes="${translation.includes}" /> <fileset dir="src" includes="${translation.includes}" />
<manifest> <manifest>
<attribute name="Specification-Title" value="I2P Core API" />
<attribute name="Specification-Version" value="${release.number}" />
<attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" />
<attribute name="Implementation-Title" value="I2P Java Core API" />
<attribute name="Implementation-Version" value="${full.version}" /> <attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Implementation-Vendor" value="The I2P Project https://geti2p.net/" />
<attribute name="Built-By" value="${build.built-by}" /> <attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" /> <attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" /> <attribute name="Base-Revision" value="${workspace.version}" />

View File

@ -41,6 +41,7 @@ public interface AMDCPUInfo extends CPUInfo {
public boolean IsAthlon64Compatible(); public boolean IsAthlon64Compatible();
/** /**
* @return true if the CPU present in the machine is at least an 'k10' CPU * @return true if the CPU present in the machine is at least an 'k10' CPU
* @since 0.9.26
*/ */
public boolean IsK10Compatible(); public boolean IsK10Compatible();
/** /**
@ -49,6 +50,7 @@ public interface AMDCPUInfo extends CPUInfo {
public boolean IsBobcatCompatible(); public boolean IsBobcatCompatible();
/** /**
* @return true if the CPU present in the machine is at least an 'jaguar' CPU * @return true if the CPU present in the machine is at least an 'jaguar' CPU
* @since 0.9.26
*/ */
public boolean IsJaguarCompatible(); public boolean IsJaguarCompatible();
/** /**
@ -57,14 +59,17 @@ public interface AMDCPUInfo extends CPUInfo {
public boolean IsBulldozerCompatible(); public boolean IsBulldozerCompatible();
/** /**
* @return true if the CPU present in the machine is at least a 'piledriver' CPU * @return true if the CPU present in the machine is at least a 'piledriver' CPU
* @since 0.9.26
*/ */
public boolean IsPiledriverCompatible(); public boolean IsPiledriverCompatible();
/** /**
* @return true if the CPU present in the machine is at least a 'steamroller' CPU * @return true if the CPU present in the machine is at least a 'steamroller' CPU
* @since 0.9.26
*/ */
public boolean IsSteamrollerCompatible(); public boolean IsSteamrollerCompatible();
/** /**
* @return true if the CPU present in the machine is at least a 'excavator' CPU * @return true if the CPU present in the machine is at least a 'excavator' CPU
* @since 0.9.26
*/ */
public boolean IsExcavatorCompatible(); public boolean IsExcavatorCompatible();

View File

@ -376,27 +376,33 @@ public class CPUID {
System.out.println("CPU has ABM: " + c.hasABM()); System.out.println("CPU has ABM: " + c.hasABM());
if(c instanceof IntelCPUInfo){ if(c instanceof IntelCPUInfo){
System.out.println("\n **Intel-info**"); System.out.println("\n **Intel-info**");
System.out.println("Is PII-compatible: "+((IntelCPUInfo)c).IsPentium2Compatible()); System.out.println("Is PII-compatible: "+((IntelCPUInfo)c).IsPentium2Compatible());
System.out.println("Is PIII-compatible: "+((IntelCPUInfo)c).IsPentium3Compatible()); System.out.println("Is PIII-compatible: "+((IntelCPUInfo)c).IsPentium3Compatible());
System.out.println("Is PIV-compatible: "+((IntelCPUInfo)c).IsPentium4Compatible()); System.out.println("Is PIV-compatible: "+((IntelCPUInfo)c).IsPentium4Compatible());
System.out.println("Is Atom-compatible: "+((IntelCPUInfo)c).IsAtomCompatible()); System.out.println("Is Atom-compatible: "+((IntelCPUInfo)c).IsAtomCompatible());
System.out.println("Is Pentium M compatible: "+((IntelCPUInfo)c).IsPentiumMCompatible()); System.out.println("Is Pentium M compatible: "+((IntelCPUInfo)c).IsPentiumMCompatible());
System.out.println("Is Core2-compatible: "+((IntelCPUInfo)c).IsCore2Compatible()); System.out.println("Is Core2-compatible: "+((IntelCPUInfo)c).IsCore2Compatible());
System.out.println("Is Corei-compatible: "+((IntelCPUInfo)c).IsCoreiCompatible()); System.out.println("Is Corei-compatible: "+((IntelCPUInfo)c).IsCoreiCompatible());
System.out.println("Is Sandy-compatible: "+((IntelCPUInfo)c).IsSandyCompatible()); System.out.println("Is Sandy-compatible: "+((IntelCPUInfo)c).IsSandyCompatible());
System.out.println("Is Ivy-compatible: "+((IntelCPUInfo)c).IsIvyCompatible()); System.out.println("Is Ivy-compatible: "+((IntelCPUInfo)c).IsIvyCompatible());
System.out.println("Is Haswell-compatible: "+((IntelCPUInfo)c).IsHaswellCompatible()); System.out.println("Is Haswell-compatible: "+((IntelCPUInfo)c).IsHaswellCompatible());
System.out.println("Is Broadwell-compatible: "+((IntelCPUInfo)c).IsBroadwellCompatible()); System.out.println("Is Broadwell-compatible: "+((IntelCPUInfo)c).IsBroadwellCompatible());
} }
if(c instanceof AMDCPUInfo){ if(c instanceof AMDCPUInfo){
System.out.println("\n **AMD-info**"); System.out.println("\n **AMD-info**");
System.out.println("Is K6-compatible: "+((AMDCPUInfo)c).IsK6Compatible()); System.out.println("Is K6-compatible: "+((AMDCPUInfo)c).IsK6Compatible());
System.out.println("Is K6_2-compatible: "+((AMDCPUInfo)c).IsK6_2_Compatible()); System.out.println("Is K6_2-compatible: "+((AMDCPUInfo)c).IsK6_2_Compatible());
System.out.println("Is K6_3-compatible: "+((AMDCPUInfo)c).IsK6_3_Compatible()); System.out.println("Is K6_3-compatible: "+((AMDCPUInfo)c).IsK6_3_Compatible());
System.out.println("Is Geode-compatible: "+((AMDCPUInfo)c).IsGeodeCompatible()); System.out.println("Is Geode-compatible: "+((AMDCPUInfo)c).IsGeodeCompatible());
System.out.println("Is Athlon-compatible: "+((AMDCPUInfo)c).IsAthlonCompatible()); System.out.println("Is Athlon-compatible: "+((AMDCPUInfo)c).IsAthlonCompatible());
System.out.println("Is Athlon64-compatible: "+((AMDCPUInfo)c).IsAthlon64Compatible()); System.out.println("Is Athlon64-compatible: "+((AMDCPUInfo)c).IsAthlon64Compatible());
System.out.println("Is Bobcat-compatible: "+((AMDCPUInfo)c).IsBobcatCompatible()); System.out.println("Is Bobcat-compatible: "+((AMDCPUInfo)c).IsBobcatCompatible());
System.out.println("Is K10-compatible: "+((AMDCPUInfo)c).IsK10Compatible());
System.out.println("Is Jaguar-compatible: "+((AMDCPUInfo)c).IsJaguarCompatible());
System.out.println("Is Bulldozer-compatible: "+((AMDCPUInfo)c).IsBulldozerCompatible());
System.out.println("Is Piledriver-compatible: "+((AMDCPUInfo)c).IsPiledriverCompatible());
System.out.println("Is Steamroller-compatible: "+((AMDCPUInfo)c).IsSteamrollerCompatible());
System.out.println("Is Excavator-compatible: "+((AMDCPUInfo)c).IsExcavatorCompatible());
} }
} }

View File

@ -1492,7 +1492,7 @@ public class BlockfileNamingService extends DummyNamingService {
rv = lookupAll2(hostname, lookupOptions, storedOptions); rv = lookupAll2(hostname, lookupOptions, storedOptions);
} }
} }
// we sort the destinations in addDestionation(), // we sort the destinations in addDestination(),
// which is a lot easier than sorting them here // which is a lot easier than sorting them here
return rv; return rv;
} }

View File

@ -15,6 +15,7 @@ import java.security.InvalidKeyException;
import java.security.KeyFactory; import java.security.KeyFactory;
import java.security.KeyPair; import java.security.KeyPair;
import java.security.KeyPairGenerator; import java.security.KeyPairGenerator;
import java.security.MessageDigest;
import java.security.ProviderException; import java.security.ProviderException;
import java.security.interfaces.ECPrivateKey; import java.security.interfaces.ECPrivateKey;
import java.security.interfaces.ECPublicKey; import java.security.interfaces.ECPublicKey;
@ -416,19 +417,30 @@ public final class KeyGenerator {
else else
System.out.println(type + " private-to-public test FAILED"); System.out.println(type + " private-to-public test FAILED");
//System.out.println("privkey " + keys[1]); //System.out.println("privkey " + keys[1]);
MessageDigest md = type.getDigestInstance();
for (int i = 0; i < runs; i++) { for (int i = 0; i < runs; i++) {
RandomSource.getInstance().nextBytes(src); RandomSource.getInstance().nextBytes(src);
md.update(src);
byte[] sha = md.digest();
SimpleDataStructure hash = type.getHashInstance();
hash.setData(sha);
long start = System.nanoTime(); long start = System.nanoTime();
Signature sig = DSAEngine.getInstance().sign(src, privkey); Signature sig = DSAEngine.getInstance().sign(src, privkey);
Signature sig2 = DSAEngine.getInstance().sign(hash, privkey);
if (sig == null) if (sig == null)
throw new GeneralSecurityException("signature generation failed"); throw new GeneralSecurityException("signature generation failed");
if (sig2 == null)
throw new GeneralSecurityException("signature generation (H) failed");
long mid = System.nanoTime(); long mid = System.nanoTime();
boolean ok = DSAEngine.getInstance().verifySignature(sig, src, pubkey); boolean ok = DSAEngine.getInstance().verifySignature(sig, src, pubkey);
boolean ok2 = DSAEngine.getInstance().verifySignature(sig2, hash, pubkey);
long end = System.nanoTime(); long end = System.nanoTime();
stime += mid - start; stime += mid - start;
vtime += end - mid; vtime += end - mid;
if (!ok) if (!ok)
throw new GeneralSecurityException(type + " V(S(data)) fail"); throw new GeneralSecurityException(type + " V(S(data)) fail");
if (!ok2)
throw new GeneralSecurityException(type + " V(S(H(data))) fail");
} }
stime /= 1000*1000; stime /= 1000*1000;
vtime /= 1000*1000; vtime /= 1000*1000;

View File

@ -17,7 +17,7 @@ cd i2p_0.9.xx-x-xxxxxxxx/
ant debchange ant debchange
vi debian/changelog vi debian/changelog
change i2p_0.9.xx-x-xxxxxxxx-1 to i2p_0.9.xx-1 change i2p_0.9.xx-x-xxxxxxxx-1 to i2p_0.9.xx-1
change UNRELEASED to unstable change UNRELEASED to stable
change comment to "New upstream version 0.9.xx" change comment to "New upstream version 0.9.xx"
fix your name and email fix your name and email
# fix up the control and rules files as necessary # fix up the control and rules files as necessary
@ -57,16 +57,22 @@ This will make the following files in ..:
ssh to reprepro server ssh to reprepro server
sudo su kytv (he owns the reprepro directories) sudo su kytv (he owns the reprepro directories)
reprepro includedeb unstable i2p-doc_0.9.xx-1_all.deb reprepro includedeb stable i2p-doc_0.9.xx-1_all.deb
reprepro includedeb unstable i2p-router_0.9.xx-1_all.deb reprepro includedeb stable i2p-router_0.9.xx-1_all.deb
reprepro includedeb unstable i2p_0.9.xx-1_all.deb reprepro includedeb stable libjbigi-jni_0.9.xx-1_amd64.deb
reprepro includedeb unstable libjbigi-jni_0.9.xx-1_amd64.deb reprepro includedeb stable i2p_0.9.xx-1_all.deb
# if you already got the source from launchpad # if you already got the source from launchpad
# with reprepro update, skip this? # with reprepro update, skip this?
reprepro includedsc unstable i2p_0.9.XX-1.dsc reprepro includedsc stable i2p_0.9.XX-1.dsc
# copy built packages from launchpad
reprepro -v update precise
reprepro -v update trusty
reprepro -v update vivid
reprepro -v update wily
reprepro -v update xenial
# To copy precise to wheezy if you build precise on launchpad # To copy precise to wheezy:
# and then did a reprepro update:
# Note that syntax is reprepro copysrc TO FROM package! # Note that syntax is reprepro copysrc TO FROM package!
reprepro copysrc wheezy precise i2p reprepro -v copysrc wheezy precise i2p

View File

@ -49,7 +49,7 @@ Generate files to upload
(or add -kkeyid argument to debuild, which you must do (or add -kkeyid argument to debuild, which you must do
if you want to sign with a subkey) if you want to sign with a subkey)
run gpg -K to list your private keys run gpg -K to list your private keys
- ant debian-release-tarball - ant debian-release-tarball (ant precise-release-tarball for precise)
this will make a directory ../i2p-0.9.XX-0-xxxxxxxx/ this will make a directory ../i2p-0.9.XX-0-xxxxxxxx/
and a tarball ../i2p_0.9.XX.orig.tar.bz2 and a tarball ../i2p_0.9.XX.orig.tar.bz2
- cp debian/changelog ../i2p-0.9.XX-0-xxxxxxxx/debian/ - cp debian/changelog ../i2p-0.9.XX-0-xxxxxxxx/debian/
@ -134,6 +134,9 @@ Creating milestone, release, and uploading files
You must first create a milestone, then create a release You must first create a milestone, then create a release
and attach it to the milestone. and attach it to the milestone.
(Enable referer sending in your browser if necessary)
Go to https://launchpad.net/i2p/trunk Go to https://launchpad.net/i2p/trunk
Down at bottom, click 'create milestone' Down at bottom, click 'create milestone'
Name: 0.9.xx (NOT i2p 0.9.xx) Name: 0.9.xx (NOT i2p 0.9.xx)
@ -160,7 +163,7 @@ For each of the four files
Sig: i2pinstall_0.9.xx_windows.exe.sig Sig: i2pinstall_0.9.xx_windows.exe.sig
File Content Type: Installer File File Content Type: Installer File
i2pinstall_0.9.xx.jar i2pinstall_0.9.xx.jar
Description: I2P 0.9.xx Installer (Linux / OSX / FreeBSD / Solaris) Description: I2P 0.9.xx Installer (Linux / OSX / FreeBSD / Solaris / Mac)
Sig: i2pinstall_0.9.xx.jar.sig Sig: i2pinstall_0.9.xx.jar.sig
File Content Type: Installer File File Content Type: Installer File
i2pupdate_0.9.xx.zip i2pupdate_0.9.xx.zip

View File

@ -1,3 +1,9 @@
i2p (0.9.26p-1~precise+1) precise; urgency=medium
* Backport to Precise
-- zzz on i2p <zzz@i2pmail.org> Tue, 07 Jun 2016 12:12:12 +0000
i2p (0.9.25-1~precise+1) precise; urgency=medium i2p (0.9.25-1~precise+1) precise; urgency=medium
* Backport to Precise * Backport to Precise

View File

@ -1,3 +1,9 @@
i2p (0.9.26-1ubuntu1) trusty; urgency=medium
* New upstream version 0.9.26
-- zzz on i2p (key signing) <zzz@i2pmail.org> Tue, 07 Jun 2016 12:12:12 +0000
i2p (0.9.25-1ubuntu1) trusty; urgency=medium i2p (0.9.25-1ubuntu1) trusty; urgency=medium
* New upstream version 0.9.25 * New upstream version 0.9.25

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
i2p (0.9.26-1~deb8u+1) stable; urgency=medium
* Backport to Jessie
-- zzz on i2p <zzz@i2pmail.org> Tue, 08 Jun 2016 12:12:12 +0000
i2p (0.9.25-1~deb8u+1) stable; urgency=medium i2p (0.9.25-1~deb8u+1) stable; urgency=medium
* Backport to Jessie * Backport to Jessie

View File

@ -19,8 +19,9 @@ Debian wrapper.config to try to prevent confusion.
@@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
-I2P="%INSTALL_PATH" -I2P="%INSTALL_PATH"
-java -cp "$I2P/lib/i2p.jar" net.i2p.util.EepGet "$@"
+I2P="/usr/share/i2p" +I2P="/usr/share/i2p"
java -cp "$I2P/lib/i2p.jar" net.i2p.util.EepGet "$@" +java -cp "$I2P/lib/i2p.jar:/usr/share/java/gnu-getopt.jar" net.i2p.util.EepGet "$@"
--- a/installer/resources/i2prouter --- a/installer/resources/i2prouter
+++ b/installer/resources/i2prouter +++ b/installer/resources/i2prouter
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@

View File

@ -1,3 +1,22 @@
2016-06-11 zzz
Prop from i2p.i2p.zzz.test2:
* CPUID: Add CLI output for new AMD tests
* i2psnark standalone:
- Cherry-pick fixes from psi's github i2psnark_rpc branch
- Fix up Jetty XML file for Jetty 8
- Start with JettyStart
- Add UrlLauncher to launch browser
- Fix up paths in CSS files during build
- Force startup delay to 0
- Fix theme selection
- Adjust CSS and image paths
- Add shutdown hook to delete temp dir
* i2ptunnel CLI: Don't set the listen host to the I2CP host
* jbigi:
- Fix GMP version reporting for shared library (ticket #1800)
- mbuild-all script fixes
* NetDB: Improve handling of deferred search result jobs
* 2016-06-07 0.9.26 released * 2016-06-07 0.9.26 released
2016-06-03 zzz 2016-06-03 zzz

View File

@ -2,6 +2,10 @@
## One week before ## One week before
- Announce string freeze on #i2p-dev
- Update local English po files: `ant poupdate`
- Revert non-English changes if any
- Push to Transifex: `tx push -s`
- Make announcement on Transifex with checkin deadline - Make announcement on Transifex with checkin deadline
@ -52,7 +56,8 @@
mtn -d i2p.mtn co --branch=i2p.i2p /path/to/releasedir mtn -d i2p.mtn co --branch=i2p.i2p /path/to/releasedir
``` ```
- You may build with Java 7 or higher, but ensure you have the Java 6 JRE installed for the bootclasspath - You must build with Java 7 or higher, but ensure you also have the Java 6 JRE installed for the bootclasspath.
If you build with Java 8 or higher, you must also have the Java 7 JRE installed for the bootclasspath.
4. Create override.properties with (adjust as necessary): 4. Create override.properties with (adjust as necessary):
@ -165,21 +170,21 @@
- Reconnect ethernet / turn wifi back on - Reconnect ethernet / turn wifi back on
- Load torrents in i2psnark on your production router, verify infohashes - Load torrents in i2psnark on your production router, verify infohashes
3. If all goes well, tag and sync the release: 3. If all goes well, tag and push the release:
``` ```
mtn tag h: i2p-0.x.xx mtn tag h: i2p-0.x.xx
mtn cert t:i2p-0.x.xx branch i2p.i2p.release mtn cert t:i2p-0.x.xx branch i2p.i2p.release
mtn sync (with e.g. mtn.killyourtv.i2p) mtn push
``` ```
### Distribute updates ### Distribute updates
1. Update news with new version: 1. Update news with new version:
- Add magnet links, change release dates and release number in to old-format - Add magnet links, change release dates and release number in to old-format
news.xml, and distribute to news hosts news.xml, and distribute to news hosts (no longer necessary)
- In the i2p.newsxml branch, edit magnet links, release dates and release - In the i2p.newsxml branch, edit magnet links, release dates and release
number in data/releases.json, and check in number in data/releases.json, check in and push
2. Add i2pupdate-0.9.xx.su3 torrent to tracker2.postman.i2p and start seeding 2. Add i2pupdate-0.9.xx.su3 torrent to tracker2.postman.i2p and start seeding
@ -198,22 +203,37 @@
6. Tell news hosts to flip the switch 6. Tell news hosts to flip the switch
7. Monitor torrent for activity to verify that the new news is now live
### Notify release ### Notify release
1. Wait for files to be updated on download server 1. Upload files to launchpad release (download mirror)
(see debian-alt/doc/launchpad.txt for instructions)
2. Website files to change: 2. Wait for files to be updated on download server
Verify at http://download.i2p2.no/releases/
3. Website files to change:
- Sync with mtn.i2p-projekt.i2p - Sync with mtn.i2p-projekt.i2p
- `i2p2www/static/hosts.txt` if it changed (copy from i2p.i2p mtn branch) - `i2p2www/static/hosts.txt` if it changed (copy from i2p.i2p mtn branch)
- `i2p2www/__init__.py` (release number) - `i2p2www/__init__.py` (release number)
- `i2p2www/pages/downloads/list.html` (release signer) - `i2p2www/pages/downloads/list.html` (release signer, if changed)
- `i2p2www/pages/downloads/macros` (checksums) - `i2p2www/pages/downloads/macros` (checksums)
- `i2p2www/static/news/news.xml` - `i2p2www/static/news/news.xml` (no longer necessary)
- Sync with mtn.i2p-projekt.i2p - Sync with mtn.i2p-projekt.i2p
3. Wait for debian packages to be ready
4. Announce on: 4. Announce on:
- #i2p, #i2p-dev (also on Freenode side) - #i2p, #i2p-dev (also on Freenode side)
- forum.i2p - forum.i2p
- Twitter - Twitter
5. Launchpad builds
(see debian-alt/doc/launchpad.txt for instructions)
6. Debian builds
(see debian-alt/doc/debian-build.txt for instructions)
7. Announce Launchpad and Debian builds on Twitter
8. Notify Tails that new Debian builds are available

View File

@ -37,10 +37,6 @@ to serve static html files and images.
<Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg> <Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
<Arg>/</Arg> <Arg>/</Arg>
</Call> </Call>
<Call name="addServlet">
<Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
<Arg>/</Arg>
</Call>
<Call name="addFilter"> <Call name="addFilter">
<!-- Add a filter to gzip on-the fly, since if we don't do it, I2P will. <!-- Add a filter to gzip on-the fly, since if we don't do it, I2P will.
- This lowers the resource usage in the Java process on the client side, - This lowers the resource usage in the Java process on the client side,

View File

@ -29,7 +29,7 @@ body.iframed {
font-weight: bold; font-weight: bold;
font-size: 9pt; font-size: 9pt;
color: #559; color: #559;
background: #fff url("../../console/light/images/header.png") repeat-x scroll center center; background: #fff url('../../console/light/images/header.png') repeat-x scroll center center;
-moz-border-radius: 0px; -moz-border-radius: 0px;
-khtml-border-radius: 3px; -khtml-border-radius: 3px;
border-radius: 0px; border-radius: 0px;
@ -167,7 +167,7 @@ th {
border-bottom: 1px solid #66f; border-bottom: 1px solid #66f;
color: #001; color: #001;
whitespace: nowrap; whitespace: nowrap;
background: #fff url("../../console/light/images/header.png") repeat-x scroll center center; background: #fff url('../../console/light/images/header.png') repeat-x scroll center center;
} }
th:first-child { th:first-child {
@ -414,7 +414,7 @@ td:first-child {
border-radius: 0 0 5px 5px; border-radius: 0 0 5px 5px;
border-top: 0; border-top: 0;
text-shadow: 0 1px 0 #aaa; text-shadow: 0 1px 0 #aaa;
background: #fff url("../../console/light/images/header.png") repeat-x scroll center center; background: #fff url('../../console/light/images/header.png') repeat-x scroll center center;
font-variant: small-caps !important; font-variant: small-caps !important;
box-shadow: 0 1px 3px #999; box-shadow: 0 1px 3px #999;
} }

View File

@ -166,7 +166,7 @@ tr {
} }
thead, tfoot { thead, tfoot {
background: url("images/bling2.png") repeat-x scroll center center #867; background: url('images/bling2.png') repeat-x scroll center center #867;
font-weight: bold; font-weight: bold;
color: #503; color: #503;
} }

View File

@ -67,7 +67,12 @@
<manifest> <manifest>
<!-- so people with very old wrapper.config files will still work with Jetty 6 --> <!-- so people with very old wrapper.config files will still work with Jetty 6 -->
<attribute name="Class-Path" value="i2p.jar jetty-i2p.jar jetty-java5-threadpool.jar jetty-rewrite-handler.jar jetty-sslengine.jar jetty-start.jar jetty-util.jar" /> <attribute name="Class-Path" value="i2p.jar jetty-i2p.jar jetty-java5-threadpool.jar jetty-rewrite-handler.jar jetty-sslengine.jar jetty-start.jar jetty-util.jar" />
<attribute name="Specification-Title" value="I2P Router" />
<attribute name="Specification-Version" value="${release.number}" />
<attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" />
<attribute name="Implementation-Title" value="I2P Java Router" />
<attribute name="Implementation-Version" value="${full.version}" /> <attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Implementation-Vendor" value="The I2P Project https://geti2p.net/" />
<attribute name="Built-By" value="${build.built-by}" /> <attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" /> <attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" /> <attribute name="Base-Revision" value="${workspace.version}" />

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 0; public final static long BUILD = 1;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";

View File

@ -71,9 +71,8 @@ public class StatisticsManager {
public Properties publishStatistics(Hash h) { public Properties publishStatistics(Hash h) {
Properties stats = new Properties(); Properties stats = new Properties();
stats.setProperty("router.version", RouterVersion.VERSION); stats.setProperty("router.version", RouterVersion.VERSION);
// scheduled for removal, never used // never used
if (CoreVersion.VERSION.equals("0.9.23")) //stats.setProperty("coreVersion", CoreVersion.VERSION);
stats.setProperty("coreVersion", CoreVersion.VERSION);
stats.setProperty(RouterInfo.PROP_NETWORK_ID, _networkID); stats.setProperty(RouterInfo.PROP_NETWORK_ID, _networkID);
stats.setProperty(RouterInfo.PROP_CAPABILITIES, _context.router().getCapabilities()); stats.setProperty(RouterInfo.PROP_CAPABILITIES, _context.router().getCapabilities());
@ -168,9 +167,7 @@ public class StatisticsManager {
} }
// So that we will still get build requests - not required since 0.7.9 2010-01-12 // So that we will still get build requests - not required since 0.7.9 2010-01-12
// scheduled for removal //stats.setProperty("stat_uptime", "90m");
if (CoreVersion.VERSION.equals("0.9.23"))
stats.setProperty("stat_uptime", "90m");
if (FloodfillNetworkDatabaseFacade.isFloodfill(_context.router().getRouterInfo())) { if (FloodfillNetworkDatabaseFacade.isFloodfill(_context.router().getRouterInfo())) {
int ri = _context.router().getUptime() > 30*60*1000 ? int ri = _context.router().getUptime() > 30*60*1000 ?
_context.netDb().getKnownRouters() : _context.netDb().getKnownRouters() :

View File

@ -232,6 +232,7 @@ class FloodOnlySearchJob extends FloodSearchJob {
synchronized (this) { synchronized (this) {
if (_dead) return; if (_dead) return;
_dead = true; _dead = true;
super.success();
} }
if (_log.shouldLog(Log.INFO)) if (_log.shouldLog(Log.INFO))
_log.info(getJobId() + ": Floodfill search for " + _key + " successful"); _log.info(getJobId() + ": Floodfill search for " + _key + " successful");

View File

@ -33,6 +33,7 @@ public class FloodSearchJob extends JobImpl {
protected final AtomicInteger _lookupsRemaining = new AtomicInteger(); protected final AtomicInteger _lookupsRemaining = new AtomicInteger();
protected volatile boolean _dead; protected volatile boolean _dead;
protected final long _created; protected final long _created;
protected boolean _success;
/** /**
* @param onFind may be null * @param onFind may be null
@ -69,6 +70,7 @@ public class FloodSearchJob extends JobImpl {
* @param isLease ignored * @param isLease ignored
*/ */
void addDeferred(Job onFind, Job onFailed, long timeoutMs, boolean isLease) { void addDeferred(Job onFind, Job onFailed, long timeoutMs, boolean isLease) {
boolean success;
synchronized (this) { synchronized (this) {
if (!_dead) { if (!_dead) {
if (onFind != null) if (onFind != null)
@ -77,9 +79,13 @@ public class FloodSearchJob extends JobImpl {
_onFailed.add(onFailed); _onFailed.add(onFailed);
return; return;
} }
success = _success;
} }
// outside synch to avoid deadlock with job queue // outside synch to avoid deadlock with job queue
getContext().jobQueue().addJob(onFailed); if (success && onFind != null)
getContext().jobQueue().addJob(onFind);
else if (!success && onFailed != null)
getContext().jobQueue().addJob(onFailed);
} }
/** using context clock */ /** using context clock */
@ -193,8 +199,11 @@ public class FloodSearchJob extends JobImpl {
* Deprecated, unused, see FOSJ override * Deprecated, unused, see FOSJ override
*/ */
void success() { void success() {
throw new UnsupportedOperationException("use override"); synchronized(this) {
_success = true;
}
/**** /****
throw new UnsupportedOperationException("use override");
if (_dead) return; if (_dead) return;
if (_log.shouldLog(Log.INFO)) if (_log.shouldLog(Log.INFO))
_log.info(getJobId() + ": Floodfill search for " + _key.toBase64() + " successful"); _log.info(getJobId() + ": Floodfill search for " + _key.toBase64() + " successful");

View File

@ -587,6 +587,7 @@ class IterativeSearchJob extends FloodSearchJob {
synchronized(this) { synchronized(this) {
if (_dead) return; if (_dead) return;
_dead = true; _dead = true;
_success = true;
tries = _unheardFrom.size() + _failedPeers.size(); tries = _unheardFrom.size() + _failedPeers.size();
if (_unheardFrom.size() == 1) { if (_unheardFrom.size() == 1) {
peer = _unheardFrom.iterator().next(); peer = _unheardFrom.iterator().next();