forked from I2P_Developers/i2p.i2p
merge of 'a3d362477b328c80ac2cd052f635d3ddd3b39c81'
and 'c21005b174cec3b4ae419318758f1a9c2071cf64'
This commit is contained in:
@ -55,6 +55,7 @@
|
|||||||
<property name="workspace.changes" value="" />
|
<property name="workspace.changes" value="" />
|
||||||
<manifest>
|
<manifest>
|
||||||
<attribute name="Main-Class" value="addressbook.Daemon"/>
|
<attribute name="Main-Class" value="addressbook.Daemon"/>
|
||||||
|
<attribute name="Implementation-Version" value="${full.version}" />
|
||||||
<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}" />
|
||||||
<attribute name="Workspace-Changes" value="${workspace.changes}" />
|
<attribute name="Workspace-Changes" value="${workspace.changes}" />
|
||||||
@ -73,6 +74,7 @@
|
|||||||
<property name="workspace.changes.tr" value="" />
|
<property name="workspace.changes.tr" value="" />
|
||||||
<war basedir="${dist}/tmp" webxml="web.xml" destfile="${dist}/${war}">
|
<war basedir="${dist}/tmp" webxml="web.xml" destfile="${dist}/${war}">
|
||||||
<manifest>
|
<manifest>
|
||||||
|
<attribute name="Implementation-Version" value="${full.version}" />
|
||||||
<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}" />
|
||||||
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
||||||
|
@ -60,6 +60,7 @@
|
|||||||
<manifest>
|
<manifest>
|
||||||
<attribute name="Main-Class" value="org.klomp.snark.Snark" />
|
<attribute name="Main-Class" value="org.klomp.snark.Snark" />
|
||||||
<attribute name="Class-Path" value="i2p.jar mstreaming.jar streaming.jar" />
|
<attribute name="Class-Path" value="i2p.jar mstreaming.jar streaming.jar" />
|
||||||
|
<attribute name="Implementation-Version" value="${full.version}" />
|
||||||
<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}" />
|
||||||
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
||||||
@ -98,6 +99,7 @@
|
|||||||
<!-- include only the web stuff, as of 0.7.12 the router will add i2psnark.jar to the classpath for the war -->
|
<!-- include only the web stuff, as of 0.7.12 the router will add i2psnark.jar to the classpath for the war -->
|
||||||
<classes dir="./build/obj" includes="**/web/*.class" />
|
<classes dir="./build/obj" includes="**/web/*.class" />
|
||||||
<manifest>
|
<manifest>
|
||||||
|
<attribute name="Implementation-Version" value="${full.version}" />
|
||||||
<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}" />
|
||||||
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
||||||
|
@ -62,6 +62,7 @@
|
|||||||
<manifest>
|
<manifest>
|
||||||
<attribute name="Main-Class" value="net.i2p.i2ptunnel.I2PTunnel" />
|
<attribute name="Main-Class" value="net.i2p.i2ptunnel.I2PTunnel" />
|
||||||
<attribute name="Class-Path" value="i2p.jar mstreaming.jar" />
|
<attribute name="Class-Path" value="i2p.jar mstreaming.jar" />
|
||||||
|
<attribute name="Implementation-Version" value="${full.version}" />
|
||||||
<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}" />
|
||||||
<attribute name="Workspace-Changes" value="${workspace.changes.j.tr}" />
|
<attribute name="Workspace-Changes" value="${workspace.changes.j.tr}" />
|
||||||
@ -134,6 +135,7 @@
|
|||||||
<war destfile="build/i2ptunnel.war" webxml="../jsp/web-out.xml"
|
<war destfile="build/i2ptunnel.war" webxml="../jsp/web-out.xml"
|
||||||
basedir="../jsp/" excludes="web.xml, web-fragment.xml, web-out.xml, **/*.java, *.jsp">
|
basedir="../jsp/" excludes="web.xml, web-fragment.xml, web-out.xml, **/*.java, *.jsp">
|
||||||
<manifest>
|
<manifest>
|
||||||
|
<attribute name="Implementation-Version" value="${full.version}" />
|
||||||
<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}" />
|
||||||
<attribute name="Workspace-Changes" value="${workspace.changes.w.tr}" />
|
<attribute name="Workspace-Changes" value="${workspace.changes.w.tr}" />
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
<property name="workspace.changes.tr" value="" />
|
<property name="workspace.changes.tr" value="" />
|
||||||
<jar destfile="./build/mstreaming.jar" basedir="./build/obj" includes="**/*.class" >
|
<jar destfile="./build/mstreaming.jar" basedir="./build/obj" includes="**/*.class" >
|
||||||
<manifest>
|
<manifest>
|
||||||
|
<attribute name="Implementation-Version" value="${full.version}" />
|
||||||
<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}" />
|
||||||
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
<dependset>
|
<dependset>
|
||||||
<srcfilelist dir="." files="../../../router/java/build/obj/net/i2p/router/RouterVersion.class" />
|
<srcfilelist dir="." files="../../../router/java/build/obj/net/i2p/router/RouterVersion.class" />
|
||||||
<targetfilelist dir="." files="build/obj/net/i2p/router/web/NewsFetcher.class" />
|
<targetfilelist dir="." files="build/obj/net/i2p/router/web/NewsFetcher.class" />
|
||||||
|
<targetfilelist dir="." files="build/obj/net/i2p/router/web/PluginStarter.class" />
|
||||||
<targetfilelist dir="." files="build/obj/net/i2p/router/web/SummaryHelper.class" />
|
<targetfilelist dir="." files="build/obj/net/i2p/router/web/SummaryHelper.class" />
|
||||||
<targetfilelist dir="." files="build/obj/net/i2p/router/web/UpdateHandler.class" />
|
<targetfilelist dir="." files="build/obj/net/i2p/router/web/UpdateHandler.class" />
|
||||||
</dependset>
|
</dependset>
|
||||||
@ -90,6 +91,7 @@
|
|||||||
<!-- top level installer will rename to jrobin.jar -->
|
<!-- top level installer will rename to jrobin.jar -->
|
||||||
<!-- DTG added in 0.8.4, not in the classpath for very old installs, before we changed wrapper.config to specify * -->
|
<!-- DTG added in 0.8.4, not in the classpath for very old installs, before we changed wrapper.config to specify * -->
|
||||||
<attribute name="Class-Path" value="i2p.jar router.jar jrobin.jar desktopgui.jar" />
|
<attribute name="Class-Path" value="i2p.jar router.jar jrobin.jar desktopgui.jar" />
|
||||||
|
<attribute name="Implementation-Version" value="${full.version}" />
|
||||||
<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}" />
|
||||||
<attribute name="Workspace-Changes" value="${workspace.changes.j.tr}" />
|
<attribute name="Workspace-Changes" value="${workspace.changes.j.tr}" />
|
||||||
@ -169,6 +171,7 @@
|
|||||||
<war destfile="build/routerconsole.war" webxml="../jsp/web-out.xml"
|
<war destfile="build/routerconsole.war" webxml="../jsp/web-out.xml"
|
||||||
basedir="../jsp/" excludes="web.xml, *.css, **/*.java, *.jsp, *.jsi, web-fragment.xml, web-out.xml">
|
basedir="../jsp/" excludes="web.xml, *.css, **/*.java, *.jsp, *.jsi, web-fragment.xml, web-out.xml">
|
||||||
<manifest>
|
<manifest>
|
||||||
|
<attribute name="Implementation-Version" value="${full.version}" />
|
||||||
<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}" />
|
||||||
<attribute name="Workspace-Changes" value="${workspace.changes.w.tr}" />
|
<attribute name="Workspace-Changes" value="${workspace.changes.w.tr}" />
|
||||||
@ -292,6 +295,8 @@
|
|||||||
|
|
||||||
<uptodate property="precompilejsp.uptodate" targetfile="../jsp/web-out.xml">
|
<uptodate property="precompilejsp.uptodate" targetfile="../jsp/web-out.xml">
|
||||||
<srcfiles dir= "../jsp" includes="**/*.jsp, *.jsi, **/*.html, *.css, susimail/susimail, web.xml"/>
|
<srcfiles dir= "../jsp" includes="**/*.jsp, *.jsi, **/*.html, *.css, susimail/susimail, web.xml"/>
|
||||||
|
<!-- so the version is right on logs.jsp -->
|
||||||
|
<srcfiles dir= "../../../router/java/src/net/i2p/router" includes="RouterVersion.java"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
|
|
||||||
<target name="javadoc">
|
<target name="javadoc">
|
||||||
|
@ -54,6 +54,10 @@ public class ConfigClientsHandler extends FormHandler {
|
|||||||
installPlugin();
|
installPlugin();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (_action.equals(_("Update All Installed Plugins"))) {
|
||||||
|
updateAllPlugins();
|
||||||
|
return;
|
||||||
|
}
|
||||||
// value
|
// value
|
||||||
if (_action.startsWith("Start ")) {
|
if (_action.startsWith("Start ")) {
|
||||||
String app = _action.substring(6);
|
String app = _action.substring(6);
|
||||||
@ -322,6 +326,16 @@ public class ConfigClientsHandler extends FormHandler {
|
|||||||
installPlugin(url);
|
installPlugin(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @since 0.8.13 */
|
||||||
|
private void updateAllPlugins() {
|
||||||
|
addFormNotice(_("Updating all plugins"));
|
||||||
|
PluginStarter.updateAll(_context);
|
||||||
|
// So that update() will post a status to the summary bar before we reload
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch (InterruptedException ie) {}
|
||||||
|
}
|
||||||
|
|
||||||
private void installPlugin(String url) {
|
private void installPlugin(String url) {
|
||||||
if ("true".equals(System.getProperty(UpdateHandler.PROP_UPDATE_IN_PROGRESS))) {
|
if ("true".equals(System.getProperty(UpdateHandler.PROP_UPDATE_IN_PROGRESS))) {
|
||||||
addFormError(_("Plugin or update download already in progress."));
|
addFormError(_("Plugin or update download already in progress."));
|
||||||
|
@ -113,17 +113,18 @@ public class FileDumpHelper extends HelperBase {
|
|||||||
if (att == null)
|
if (att == null)
|
||||||
att = new Attributes();
|
att = new Attributes();
|
||||||
buf.append("<td align=\"center\">");
|
buf.append("<td align=\"center\">");
|
||||||
|
String iv = getAtt(att, "Implementation-Version");
|
||||||
|
if (iv != null)
|
||||||
|
buf.append("<b>").append(iv).append("</b>");
|
||||||
String s = getAtt(att, "Base-Revision");
|
String s = getAtt(att, "Base-Revision");
|
||||||
if (s != null && s.length() > 20) {
|
if (s != null && s.length() > 20) {
|
||||||
|
if (iv != null)
|
||||||
|
buf.append("<br>");
|
||||||
buf.append("<a href=\"http://stats.i2p/cgi-bin/viewmtn/revision/info/").append(s)
|
buf.append("<a href=\"http://stats.i2p/cgi-bin/viewmtn/revision/info/").append(s)
|
||||||
.append("\">" +
|
.append("\">" +
|
||||||
"<tt>").append(s.substring(0, 20)).append("</tt>" +
|
"<tt>").append(s.substring(0, 20)).append("</tt>" +
|
||||||
"<br>" +
|
"<br>" +
|
||||||
"<tt>").append(s.substring(20)).append("</tt></a>");
|
"<tt>").append(s.substring(20)).append("</tt></a>");
|
||||||
} else {
|
|
||||||
s = getAtt(att, "Implementation-Version");
|
|
||||||
if (s != null)
|
|
||||||
buf.append("<b>").append(s).append("</b>");
|
|
||||||
}
|
}
|
||||||
buf.append("</td><td>");
|
buf.append("</td><td>");
|
||||||
s = getAtt(att, "Created-By");
|
s = getAtt(att, "Created-By");
|
||||||
|
@ -22,10 +22,12 @@ import net.i2p.I2PAppContext;
|
|||||||
import net.i2p.data.DataHelper;
|
import net.i2p.data.DataHelper;
|
||||||
import net.i2p.router.Job;
|
import net.i2p.router.Job;
|
||||||
import net.i2p.router.RouterContext;
|
import net.i2p.router.RouterContext;
|
||||||
|
import net.i2p.router.RouterVersion;
|
||||||
import net.i2p.router.startup.ClientAppConfig;
|
import net.i2p.router.startup.ClientAppConfig;
|
||||||
import net.i2p.router.startup.LoadClientAppsJob;
|
import net.i2p.router.startup.LoadClientAppsJob;
|
||||||
import net.i2p.util.ConcurrentHashSet;
|
import net.i2p.util.ConcurrentHashSet;
|
||||||
import net.i2p.util.FileUtil;
|
import net.i2p.util.FileUtil;
|
||||||
|
import net.i2p.util.I2PAppThread;
|
||||||
import net.i2p.util.Log;
|
import net.i2p.util.Log;
|
||||||
import net.i2p.util.Translate;
|
import net.i2p.util.Translate;
|
||||||
import net.i2p.util.VersionComparator;
|
import net.i2p.util.VersionComparator;
|
||||||
@ -63,9 +65,96 @@ public class PluginStarter implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
|
if (_context.getBooleanPropertyDefaultTrue("plugins.autoUpdate") &&
|
||||||
|
(!Boolean.valueOf(System.getProperty(UpdateHandler.PROP_UPDATE_IN_PROGRESS)).booleanValue()) &&
|
||||||
|
(!RouterVersion.VERSION.equals(_context.getProperty("router.previousVersion"))))
|
||||||
|
updateAll(_context, true);
|
||||||
startPlugins(_context);
|
startPlugins(_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* threaded
|
||||||
|
* @since 0.8.13
|
||||||
|
*/
|
||||||
|
static void updateAll(RouterContext ctx) {
|
||||||
|
Thread t = new I2PAppThread(new PluginUpdater(ctx), "PluginUpdater", true);
|
||||||
|
t.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* thread
|
||||||
|
* @since 0.8.13
|
||||||
|
*/
|
||||||
|
private static class PluginUpdater implements Runnable {
|
||||||
|
private final RouterContext _ctx;
|
||||||
|
|
||||||
|
public PluginUpdater(RouterContext ctx) {
|
||||||
|
_ctx = ctx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run() {
|
||||||
|
updateAll(_ctx, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* inline
|
||||||
|
* @since 0.8.13
|
||||||
|
*/
|
||||||
|
private static void updateAll(RouterContext ctx, boolean delay) {
|
||||||
|
List<String> plugins = getPlugins();
|
||||||
|
Map<String, String> toUpdate = new HashMap();
|
||||||
|
for (String appName : plugins) {
|
||||||
|
Properties props = pluginProperties(ctx, appName);
|
||||||
|
String url = props.getProperty("updateURL");
|
||||||
|
if (url != null)
|
||||||
|
toUpdate.put(appName, url);
|
||||||
|
}
|
||||||
|
if (toUpdate.isEmpty())
|
||||||
|
return;
|
||||||
|
PluginUpdateChecker puc = PluginUpdateChecker.getInstance(ctx);
|
||||||
|
if (puc.isRunning())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (delay) {
|
||||||
|
// wait for proxy
|
||||||
|
System.setProperty(UpdateHandler.PROP_UPDATE_IN_PROGRESS, "true");
|
||||||
|
puc.setAppStatus(Messages.getString("Checking for plugin updates", ctx));
|
||||||
|
try {
|
||||||
|
Thread.sleep(3*60*1000);
|
||||||
|
} catch (InterruptedException ie) {}
|
||||||
|
System.setProperty(UpdateHandler.PROP_UPDATE_IN_PROGRESS, "false");
|
||||||
|
}
|
||||||
|
|
||||||
|
Log log = ctx.logManager().getLog(PluginStarter.class);
|
||||||
|
for (Map.Entry<String, String> entry : toUpdate.entrySet()) {
|
||||||
|
String appName = entry.getKey();
|
||||||
|
if (log.shouldLog(Log.WARN))
|
||||||
|
log.warn("Checking for update plugin: " + appName);
|
||||||
|
puc.update(appName);
|
||||||
|
do {
|
||||||
|
try {
|
||||||
|
Thread.sleep(5*1000);
|
||||||
|
} catch (InterruptedException ie) {}
|
||||||
|
} while (puc.isRunning());
|
||||||
|
if (!puc.isNewerAvailable()) {
|
||||||
|
if (log.shouldLog(Log.WARN))
|
||||||
|
log.warn("No update available for plugin: " + appName);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
PluginUpdateHandler puh = PluginUpdateHandler.getInstance(ctx);
|
||||||
|
String url = entry.getValue();
|
||||||
|
if (log.shouldLog(Log.WARN))
|
||||||
|
log.warn("Updating plugin: " + appName);
|
||||||
|
puh.update(url);
|
||||||
|
do {
|
||||||
|
try {
|
||||||
|
Thread.sleep(5*1000);
|
||||||
|
} catch (InterruptedException ie) {}
|
||||||
|
} while (puh.isRunning());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** this shouldn't throw anything */
|
/** this shouldn't throw anything */
|
||||||
static void startPlugins(RouterContext ctx) {
|
static void startPlugins(RouterContext ctx) {
|
||||||
Log log = ctx.logManager().getLog(PluginStarter.class);
|
Log log = ctx.logManager().getLog(PluginStarter.class);
|
||||||
@ -75,6 +164,9 @@ public class PluginStarter implements Runnable {
|
|||||||
if (name.startsWith(PREFIX) && name.endsWith(ENABLED)) {
|
if (name.startsWith(PREFIX) && name.endsWith(ENABLED)) {
|
||||||
if (Boolean.valueOf(props.getProperty(name)).booleanValue()) {
|
if (Boolean.valueOf(props.getProperty(name)).booleanValue()) {
|
||||||
String app = name.substring(PREFIX.length(), name.lastIndexOf(ENABLED));
|
String app = name.substring(PREFIX.length(), name.lastIndexOf(ENABLED));
|
||||||
|
// plugins could have been started after update
|
||||||
|
if (isPluginRunning(app, ctx))
|
||||||
|
continue;
|
||||||
try {
|
try {
|
||||||
if (!startPlugin(ctx, app))
|
if (!startPlugin(ctx, app))
|
||||||
log.error("Failed to start plugin: " + app);
|
log.error("Failed to start plugin: " + app);
|
||||||
@ -95,6 +187,7 @@ public class PluginStarter implements Runnable {
|
|||||||
File pluginDir = new File(ctx.getConfigDir(), PluginUpdateHandler.PLUGIN_DIR + '/' + appName);
|
File pluginDir = new File(ctx.getConfigDir(), PluginUpdateHandler.PLUGIN_DIR + '/' + appName);
|
||||||
if ((!pluginDir.exists()) || (!pluginDir.isDirectory())) {
|
if ((!pluginDir.exists()) || (!pluginDir.isDirectory())) {
|
||||||
log.error("Cannot start nonexistent plugin: " + appName);
|
log.error("Cannot start nonexistent plugin: " + appName);
|
||||||
|
disablePlugin(appName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,6 +197,7 @@ public class PluginStarter implements Runnable {
|
|||||||
(new VersionComparator()).compare(CoreVersion.VERSION, minVersion) < 0) {
|
(new VersionComparator()).compare(CoreVersion.VERSION, minVersion) < 0) {
|
||||||
String foo = "Plugin " + appName + " requires I2P version " + minVersion + " or higher";
|
String foo = "Plugin " + appName + " requires I2P version " + minVersion + " or higher";
|
||||||
log.error(foo);
|
log.error(foo);
|
||||||
|
disablePlugin(appName);
|
||||||
throw new Exception(foo);
|
throw new Exception(foo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,6 +206,7 @@ public class PluginStarter implements Runnable {
|
|||||||
(new VersionComparator()).compare(System.getProperty("java.version"), minVersion) < 0) {
|
(new VersionComparator()).compare(System.getProperty("java.version"), minVersion) < 0) {
|
||||||
String foo = "Plugin " + appName + " requires Java version " + minVersion + " or higher";
|
String foo = "Plugin " + appName + " requires Java version " + minVersion + " or higher";
|
||||||
log.error(foo);
|
log.error(foo);
|
||||||
|
disablePlugin(appName);
|
||||||
throw new Exception(foo);
|
throw new Exception(foo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,6 +216,7 @@ public class PluginStarter implements Runnable {
|
|||||||
(new VersionComparator()).compare(minVersion, jVersion) > 0) {
|
(new VersionComparator()).compare(minVersion, jVersion) > 0) {
|
||||||
String foo = "Plugin " + appName + " requires Jetty version " + minVersion + " or higher";
|
String foo = "Plugin " + appName + " requires Jetty version " + minVersion + " or higher";
|
||||||
log.error(foo);
|
log.error(foo);
|
||||||
|
disablePlugin(appName);
|
||||||
throw new Exception(foo);
|
throw new Exception(foo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,6 +225,7 @@ public class PluginStarter implements Runnable {
|
|||||||
(new VersionComparator()).compare(maxVersion, jVersion) < 0) {
|
(new VersionComparator()).compare(maxVersion, jVersion) < 0) {
|
||||||
String foo = "Plugin " + appName + " requires Jetty version " + maxVersion + " or lower";
|
String foo = "Plugin " + appName + " requires Jetty version " + maxVersion + " or lower";
|
||||||
log.error(foo);
|
log.error(foo);
|
||||||
|
disablePlugin(appName);
|
||||||
throw new Exception(foo);
|
throw new Exception(foo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,7 +431,7 @@ public class PluginStarter implements Runnable {
|
|||||||
Properties props = pluginProperties();
|
Properties props = pluginProperties();
|
||||||
for (Iterator iter = props.keySet().iterator(); iter.hasNext(); ) {
|
for (Iterator iter = props.keySet().iterator(); iter.hasNext(); ) {
|
||||||
String name = (String)iter.next();
|
String name = (String)iter.next();
|
||||||
if (name.startsWith(PREFIX + appName))
|
if (name.startsWith(PREFIX + appName + '.'))
|
||||||
iter.remove();
|
iter.remove();
|
||||||
}
|
}
|
||||||
storePluginProperties(props);
|
storePluginProperties(props);
|
||||||
@ -373,6 +470,32 @@ public class PluginStarter implements Runnable {
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the plugin enabled in plugins.config?
|
||||||
|
* Default true
|
||||||
|
*
|
||||||
|
* @since 0.8.13
|
||||||
|
*/
|
||||||
|
public static boolean isPluginEnabled(String appName) {
|
||||||
|
Properties props = pluginProperties();
|
||||||
|
String prop = PREFIX + appName + ENABLED;
|
||||||
|
return Boolean.valueOf(props.getProperty(prop, "true")).booleanValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable in plugins.config
|
||||||
|
*
|
||||||
|
* @since 0.8.13
|
||||||
|
*/
|
||||||
|
public static void disablePlugin(String appName) {
|
||||||
|
Properties props = pluginProperties();
|
||||||
|
String prop = PREFIX + appName + ENABLED;
|
||||||
|
if (Boolean.valueOf(props.getProperty(prop, "true")).booleanValue()) {
|
||||||
|
props.setProperty(prop, "false");
|
||||||
|
storePluginProperties(props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* all installed plugins whether enabled or not
|
* all installed plugins whether enabled or not
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@ import net.i2p.router.RouterContext;
|
|||||||
import net.i2p.util.Log;
|
import net.i2p.util.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop all plugins that are installed
|
* Stop all plugins that are installed and running
|
||||||
*
|
*
|
||||||
* @since 0.7.13
|
* @since 0.7.13
|
||||||
* @author zzz
|
* @author zzz
|
||||||
@ -21,14 +21,14 @@ public class PluginStopper extends PluginStarter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop all plugins
|
* Stop all running plugins
|
||||||
* (whether or not they were ever started)
|
|
||||||
*
|
*
|
||||||
* this shouldn't throw anything
|
* this shouldn't throw anything
|
||||||
*/
|
*/
|
||||||
static void stopPlugins(RouterContext ctx) {
|
private static void stopPlugins(RouterContext ctx) {
|
||||||
Log log = ctx.logManager().getLog(PluginStopper.class);
|
Log log = ctx.logManager().getLog(PluginStopper.class);
|
||||||
for (String app : getPlugins()) {
|
for (String app : getPlugins()) {
|
||||||
|
if (isPluginRunning(app, ctx)) {
|
||||||
try {
|
try {
|
||||||
stopPlugin(ctx, app);
|
stopPlugin(ctx, app);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
@ -38,3 +38,4 @@ public class PluginStopper extends PluginStarter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -36,6 +36,7 @@ public class PluginUpdateChecker extends UpdateHandler {
|
|||||||
private String _appName;
|
private String _appName;
|
||||||
private String _oldVersion;
|
private String _oldVersion;
|
||||||
private String _xpi2pURL;
|
private String _xpi2pURL;
|
||||||
|
private volatile boolean _isNewerAvailable;
|
||||||
|
|
||||||
private static PluginUpdateChecker _instance;
|
private static PluginUpdateChecker _instance;
|
||||||
public static final synchronized PluginUpdateChecker getInstance(RouterContext ctx) {
|
public static final synchronized PluginUpdateChecker getInstance(RouterContext ctx) {
|
||||||
@ -49,12 +50,19 @@ public class PluginUpdateChecker extends UpdateHandler {
|
|||||||
super(ctx);
|
super(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** check all plugins */
|
/**
|
||||||
|
* check all plugins
|
||||||
|
* @deprecated not finished
|
||||||
|
*/
|
||||||
public void update() {
|
public void update() {
|
||||||
Thread t = new I2PAppThread(new AllCheckerRunner(), "AllAppChecker", true);
|
Thread t = new I2PAppThread(new AllCheckerRunner(), "AllAppChecker", true);
|
||||||
t.start();
|
t.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check all plugins
|
||||||
|
* @deprecated not finished
|
||||||
|
*/
|
||||||
public class AllCheckerRunner implements Runnable {
|
public class AllCheckerRunner implements Runnable {
|
||||||
public void run() {
|
public void run() {
|
||||||
List<String> plugins = PluginStarter.getPlugins();
|
List<String> plugins = PluginStarter.getPlugins();
|
||||||
@ -85,12 +93,18 @@ public class PluginUpdateChecker extends UpdateHandler {
|
|||||||
_xpi2pURL = xpi2pURL;
|
_xpi2pURL = xpi2pURL;
|
||||||
_appName = appName;
|
_appName = appName;
|
||||||
_oldVersion = oldVersion;
|
_oldVersion = oldVersion;
|
||||||
|
_isNewerAvailable = false;
|
||||||
System.setProperty(PROP_UPDATE_IN_PROGRESS, "true");
|
System.setProperty(PROP_UPDATE_IN_PROGRESS, "true");
|
||||||
I2PAppThread update = new I2PAppThread(_pluginUpdateCheckerRunner, "AppChecker", true);
|
I2PAppThread update = new I2PAppThread(_pluginUpdateCheckerRunner, "AppChecker", true);
|
||||||
update.start();
|
update.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @since 0.8.13 */
|
||||||
|
public void setAppStatus(String status) {
|
||||||
|
updateStatus(status);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isRunning() {
|
public boolean isRunning() {
|
||||||
return _pluginUpdateCheckerRunner != null && _pluginUpdateCheckerRunner.isRunning();
|
return _pluginUpdateCheckerRunner != null && _pluginUpdateCheckerRunner.isRunning();
|
||||||
}
|
}
|
||||||
@ -101,12 +115,17 @@ public class PluginUpdateChecker extends UpdateHandler {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @since 0.8.13 */
|
||||||
|
public boolean isNewerAvailable() {
|
||||||
|
return _isNewerAvailable;
|
||||||
|
}
|
||||||
|
|
||||||
private void scheduleStatusClean(String msg) {
|
private void scheduleStatusClean(String msg) {
|
||||||
SimpleScheduler.getInstance().addEvent(new Cleaner(msg), 60*60*1000);
|
SimpleScheduler.getInstance().addEvent(new Cleaner(msg), 20*60*1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class Cleaner implements SimpleTimer.TimedEvent {
|
private class Cleaner implements SimpleTimer.TimedEvent {
|
||||||
private String _msg;
|
private final String _msg;
|
||||||
public Cleaner(String msg) {
|
public Cleaner(String msg) {
|
||||||
_msg = msg;
|
_msg = msg;
|
||||||
}
|
}
|
||||||
@ -126,6 +145,7 @@ public class PluginUpdateChecker extends UpdateHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void update() {
|
protected void update() {
|
||||||
|
_isNewerAvailable = false;
|
||||||
updateStatus("<b>" + _("Checking for update of plugin {0}", _appName) + "</b>");
|
updateStatus("<b>" + _("Checking for update of plugin {0}", _appName) + "</b>");
|
||||||
// use the same settings as for updater
|
// use the same settings as for updater
|
||||||
// always proxy, or else FIXME
|
// always proxy, or else FIXME
|
||||||
@ -142,6 +162,10 @@ public class PluginUpdateChecker extends UpdateHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isNewerAvailable() {
|
||||||
|
return _isNewerAvailable;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bytesTransferred(long alreadyTransferred, int currentWrite, long bytesTransferred, long bytesRemaining, String url) {
|
public void bytesTransferred(long alreadyTransferred, int currentWrite, long bytesTransferred, long bytesRemaining, String url) {
|
||||||
}
|
}
|
||||||
@ -151,10 +175,12 @@ public class PluginUpdateChecker extends UpdateHandler {
|
|||||||
String newVersion = TrustedUpdate.getVersionString(new ByteArrayInputStream(_baos.toByteArray()));
|
String newVersion = TrustedUpdate.getVersionString(new ByteArrayInputStream(_baos.toByteArray()));
|
||||||
boolean newer = (new VersionComparator()).compare(newVersion, _oldVersion) > 0;
|
boolean newer = (new VersionComparator()).compare(newVersion, _oldVersion) > 0;
|
||||||
String msg;
|
String msg;
|
||||||
if (newer)
|
if (newer) {
|
||||||
msg = "<b>" + _("New plugin version {0} is available", newVersion) + "</b>";
|
msg = "<b>" + _("New plugin version {0} is available", newVersion) + "</b>";
|
||||||
else
|
_isNewerAvailable = true;
|
||||||
|
} else {
|
||||||
msg = "<b>" + _("No new version is available for plugin {0}", _appName) + "</b>";
|
msg = "<b>" + _("No new version is available for plugin {0}", _appName) + "</b>";
|
||||||
|
}
|
||||||
updateStatus(msg);
|
updateStatus(msg);
|
||||||
scheduleStatusClean(msg);
|
scheduleStatusClean(msg);
|
||||||
}
|
}
|
||||||
|
@ -93,11 +93,11 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void scheduleStatusClean(String msg) {
|
private void scheduleStatusClean(String msg) {
|
||||||
SimpleScheduler.getInstance().addEvent(new Cleaner(msg), 60*60*1000);
|
SimpleScheduler.getInstance().addEvent(new Cleaner(msg), 20*60*1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class Cleaner implements SimpleTimer.TimedEvent {
|
private class Cleaner implements SimpleTimer.TimedEvent {
|
||||||
private String _msg;
|
private final String _msg;
|
||||||
public Cleaner(String msg) {
|
public Cleaner(String msg) {
|
||||||
_msg = msg;
|
_msg = msg;
|
||||||
}
|
}
|
||||||
@ -286,6 +286,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean wasRunning = false;
|
||||||
File destDir = new SecureDirectory(appDir, appName);
|
File destDir = new SecureDirectory(appDir, appName);
|
||||||
if (destDir.exists()) {
|
if (destDir.exists()) {
|
||||||
if (Boolean.valueOf(props.getProperty("install-only")).booleanValue()) {
|
if (Boolean.valueOf(props.getProperty("install-only")).booleanValue()) {
|
||||||
@ -350,7 +351,8 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if it is running first?
|
if (PluginStarter.isPluginRunning(appName, _context)) {
|
||||||
|
wasRunning = true;
|
||||||
try {
|
try {
|
||||||
if (!PluginStarter.stopPlugin(_context, appName)) {
|
if (!PluginStarter.stopPlugin(_context, appName)) {
|
||||||
// failed, ignore
|
// failed, ignore
|
||||||
@ -359,6 +361,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
// no updateStatus() for this one
|
// no updateStatus() for this one
|
||||||
_log.error("Error stopping plugin " + appName, e);
|
_log.error("Error stopping plugin " + appName, e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (Boolean.valueOf(props.getProperty("update-only")).booleanValue()) {
|
if (Boolean.valueOf(props.getProperty("update-only")).booleanValue()) {
|
||||||
@ -390,8 +393,8 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
pluginProps.setProperty(PluginStarter.PREFIX + appName + PluginStarter.ENABLED, "false");
|
pluginProps.setProperty(PluginStarter.PREFIX + appName + PluginStarter.ENABLED, "false");
|
||||||
PluginStarter.storePluginProperties(pluginProps);
|
PluginStarter.storePluginProperties(pluginProps);
|
||||||
}
|
}
|
||||||
} else {
|
} else if (wasRunning || PluginStarter.isPluginEnabled(appName)) {
|
||||||
// start everything
|
// start everything unless it was disabled and not running before
|
||||||
try {
|
try {
|
||||||
if (PluginStarter.startPlugin(_context, appName)) {
|
if (PluginStarter.startPlugin(_context, appName)) {
|
||||||
String linkName = ConfigClientsHelper.stripHTML(props, "consoleLinkName_" + Messages.getLanguage(_context));
|
String linkName = ConfigClientsHelper.stripHTML(props, "consoleLinkName_" + Messages.getLanguage(_context));
|
||||||
@ -411,6 +414,8 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
statusDone("<b>" + _("Plugin {0} installed but failed to start", appName) + ": " + e + "</b>");
|
statusDone("<b>" + _("Plugin {0} installed but failed to start", appName) + ": " + e + "</b>");
|
||||||
_log.error("Error starting plugin " + appName, e);
|
_log.error("Error starting plugin " + appName, e);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
statusDone("<b>" + _("Plugin {0} installed", appName) + "</b>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ public class UpdateHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class UpdateRunner implements Runnable, EepGet.StatusListener {
|
public class UpdateRunner implements Runnable, EepGet.StatusListener {
|
||||||
protected boolean _isRunning;
|
protected volatile boolean _isRunning;
|
||||||
protected boolean done;
|
protected boolean done;
|
||||||
protected EepGet _get;
|
protected EepGet _get;
|
||||||
protected final DecimalFormat _pct = new DecimalFormat("0.0%");
|
protected final DecimalFormat _pct = new DecimalFormat("0.0%");
|
||||||
|
@ -103,6 +103,7 @@ button span.hide{
|
|||||||
<jsp:getProperty name="clientshelper" property="form2" />
|
<jsp:getProperty name="clientshelper" property="form2" />
|
||||||
<p><i><%=intl._("All changes require restart to take effect.")%></i>
|
<p><i><%=intl._("All changes require restart to take effect.")%></i>
|
||||||
</p><hr><div class="formaction">
|
</p><hr><div class="formaction">
|
||||||
|
<input type="submit" class="cancel" name="foo" value="<%=intl._("Cancel")%>" />
|
||||||
<input type="submit" name="action" class="accept" value="<%=intl._("Save WebApp Configuration")%>" />
|
<input type="submit" name="action" class="accept" value="<%=intl._("Save WebApp Configuration")%>" />
|
||||||
</div></form></div>
|
</div></form></div>
|
||||||
|
|
||||||
@ -114,6 +115,7 @@ button span.hide{
|
|||||||
<input type="hidden" name="nonce" value="<%=pageNonce%>" >
|
<input type="hidden" name="nonce" value="<%=pageNonce%>" >
|
||||||
<jsp:getProperty name="clientshelper" property="form3" />
|
<jsp:getProperty name="clientshelper" property="form3" />
|
||||||
<hr><div class="formaction">
|
<hr><div class="formaction">
|
||||||
|
<input type="submit" class="cancel" name="foo" value="<%=intl._("Cancel")%>" />
|
||||||
<input type="submit" name="action" class="accept" value="<%=intl._("Save Plugin Configuration")%>" />
|
<input type="submit" name="action" class="accept" value="<%=intl._("Save Plugin Configuration")%>" />
|
||||||
</div></form></div>
|
</div></form></div>
|
||||||
|
|
||||||
@ -125,7 +127,9 @@ button span.hide{
|
|||||||
<p>
|
<p>
|
||||||
<input type="text" size="60" name="pluginURL" >
|
<input type="text" size="60" name="pluginURL" >
|
||||||
</p><hr><div class="formaction">
|
</p><hr><div class="formaction">
|
||||||
|
<input type="submit" class="cancel" name="foo" value="<%=intl._("Cancel")%>" />
|
||||||
<input type="submit" name="action" class="download" value="<%=intl._("Install Plugin")%>" />
|
<input type="submit" name="action" class="download" value="<%=intl._("Install Plugin")%>" />
|
||||||
|
<input type="submit" name="action" class="reload" value="<%=intl._("Update All Installed Plugins")%>" />
|
||||||
</div></form></div>
|
</div></form></div>
|
||||||
<% } %>
|
<% } %>
|
||||||
</div></div></body></html>
|
</div></div></body></html>
|
||||||
|
@ -66,6 +66,7 @@
|
|||||||
<manifest>
|
<manifest>
|
||||||
<attribute name="Main-Class" value="net.i2p.sam.SAMBridge" />
|
<attribute name="Main-Class" value="net.i2p.sam.SAMBridge" />
|
||||||
<attribute name="Class-Path" value="i2p.jar mstreaming.jar streaming.jar" />
|
<attribute name="Class-Path" value="i2p.jar mstreaming.jar streaming.jar" />
|
||||||
|
<attribute name="Implementation-Version" value="${full.version}" />
|
||||||
<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}" />
|
||||||
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
||||||
|
@ -63,6 +63,7 @@
|
|||||||
<property name="workspace.changes.tr" value="" />
|
<property name="workspace.changes.tr" value="" />
|
||||||
<jar destfile="./build/streaming.jar" basedir="./build/obj" includes="**/*.class" >
|
<jar destfile="./build/streaming.jar" basedir="./build/obj" includes="**/*.class" >
|
||||||
<manifest>
|
<manifest>
|
||||||
|
<attribute name="Implementation-Version" value="${full.version}" />
|
||||||
<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}" />
|
||||||
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
||||||
|
@ -97,6 +97,7 @@
|
|||||||
<include name="WEB-INF/classes/${project}.properties"/>
|
<include name="WEB-INF/classes/${project}.properties"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<manifest>
|
<manifest>
|
||||||
|
<attribute name="Implementation-Version" value="${full.version}" />
|
||||||
<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}" />
|
||||||
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
<war destfile="susimail.war" webxml="src/WEB-INF/web.xml"
|
<war destfile="susimail.war" webxml="src/WEB-INF/web.xml"
|
||||||
basedir="src/" excludes="WEB-INF/web.xml LICENSE src/**/*">
|
basedir="src/" excludes="WEB-INF/web.xml LICENSE src/**/*">
|
||||||
<manifest>
|
<manifest>
|
||||||
|
<attribute name="Implementation-Version" value="${full.version}" />
|
||||||
<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}" />
|
||||||
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
<manifest>
|
<manifest>
|
||||||
<attribute name="Main-Class" value="net.i2p.apps.systray.SysTray" />
|
<attribute name="Main-Class" value="net.i2p.apps.systray.SysTray" />
|
||||||
<attribute name="Class-Path" value="systray4j.jar" />
|
<attribute name="Class-Path" value="systray4j.jar" />
|
||||||
|
<attribute name="Implementation-Version" value="${full.version}" />
|
||||||
<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}" />
|
||||||
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
||||||
|
@ -182,12 +182,14 @@
|
|||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="buildProperties" depends="getMtnRev" >
|
<target name="buildProperties" depends="getMtnRev, getReleaseNumber, getBuildNumber" >
|
||||||
<!-- default if not set above -->
|
<!-- default if not set above -->
|
||||||
<property name="workspace.version" value="unknown" />
|
<property name="workspace.version" value="unknown" />
|
||||||
<tstamp>
|
<tstamp>
|
||||||
<format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
|
<format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
|
||||||
</tstamp>
|
</tstamp>
|
||||||
|
<property name="full.version" value="${release.number}-${build.number}${build.extra}" />
|
||||||
|
<echo message="Building version ${full.version} (mtn rev ${workspace.version})" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<!-- end of sub-build.xml targets -->
|
<!-- end of sub-build.xml targets -->
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
<property name="workspace.changes.tr" value="" />
|
<property name="workspace.changes.tr" value="" />
|
||||||
<jar destfile="./build/i2p.jar" basedir="./build/obj" includes="**/*.class" >
|
<jar destfile="./build/i2p.jar" basedir="./build/obj" includes="**/*.class" >
|
||||||
<manifest>
|
<manifest>
|
||||||
|
<attribute name="Implementation-Version" value="${full.version}" />
|
||||||
<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}" />
|
||||||
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
||||||
|
16
history.txt
16
history.txt
@ -1,3 +1,19 @@
|
|||||||
|
2012-01-16 zzz
|
||||||
|
* Build: Put Implementation-Version in manifests
|
||||||
|
* NetDB: Hopefully fix rare NPE (ticket #589)
|
||||||
|
* Plugins:
|
||||||
|
- Only stop a plugin before update if it was running
|
||||||
|
- Only stop a plugin at shutdown if it was running
|
||||||
|
- Don't start a plugin after update if it was disabled
|
||||||
|
- Disable plugin if it fails version checks at startup
|
||||||
|
- Auto-update plugins after a router update
|
||||||
|
- Add update-all button and more cancel buttons
|
||||||
|
* Router:
|
||||||
|
- Add synchronized change-and-save-config methods to avoid races
|
||||||
|
- Save previous version in config so we know when we updated
|
||||||
|
* Transport: Revert change from -2, put addresses back in RouterInfo
|
||||||
|
when hidden, broke inbound tunnel building
|
||||||
|
|
||||||
2012-01-14 zzz
|
2012-01-14 zzz
|
||||||
* i2ptunnel: Partial fix for dest formatting (ticket #581)
|
* i2ptunnel: Partial fix for dest formatting (ticket #581)
|
||||||
* jars.jsp: New debug page
|
* jars.jsp: New debug page
|
||||||
|
@ -72,6 +72,7 @@
|
|||||||
<property name="workspace.changes.tr" value="" />
|
<property name="workspace.changes.tr" value="" />
|
||||||
<jar destfile="./build/router.jar" basedir="./build/obj" includes="**/*.class" >
|
<jar destfile="./build/router.jar" basedir="./build/obj" includes="**/*.class" >
|
||||||
<manifest>
|
<manifest>
|
||||||
|
<attribute name="Implementation-Version" value="${full.version}" />
|
||||||
<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}" />
|
||||||
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
||||||
|
@ -15,6 +15,7 @@ import java.io.FileOutputStream;
|
|||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -241,6 +242,8 @@ public class Router implements RouterClock.ClockShiftListener {
|
|||||||
String now = Long.toString(System.currentTimeMillis());
|
String now = Long.toString(System.currentTimeMillis());
|
||||||
_config.put("router.firstInstalled", now);
|
_config.put("router.firstInstalled", now);
|
||||||
_config.put("router.updateLastInstalled", now);
|
_config.put("router.updateLastInstalled", now);
|
||||||
|
// First added in 0.8.13
|
||||||
|
_config.put("router.previousVersion", RouterVersion.VERSION);
|
||||||
saveConfig();
|
saveConfig();
|
||||||
}
|
}
|
||||||
// ********* Start no threads before here ********* //
|
// ********* Start no threads before here ********* //
|
||||||
@ -324,9 +327,23 @@ public class Router implements RouterClock.ClockShiftListener {
|
|||||||
public String getConfigSetting(String name) {
|
public String getConfigSetting(String name) {
|
||||||
return _config.get(name);
|
return _config.get(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Warning, race between here and saveConfig(),
|
||||||
|
* saveConfig(String name, String value) or saveConfig(Map toAdd, Set toRemove) is recommended.
|
||||||
|
*
|
||||||
|
* @since 0.8.13
|
||||||
|
*/
|
||||||
public void setConfigSetting(String name, String value) {
|
public void setConfigSetting(String name, String value) {
|
||||||
_config.put(name, value);
|
_config.put(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Warning, race between here and saveConfig(),
|
||||||
|
* saveConfig(String name, String value) or saveConfig(Map toAdd, Set toRemove) is recommended.
|
||||||
|
*
|
||||||
|
* @since 0.8.13
|
||||||
|
*/
|
||||||
public void removeConfigSetting(String name) {
|
public void removeConfigSetting(String name) {
|
||||||
_config.remove(name);
|
_config.remove(name);
|
||||||
}
|
}
|
||||||
@ -1041,6 +1058,13 @@ public class Router implements RouterClock.ClockShiftListener {
|
|||||||
_log.log(Log.CRIT, "Error running shutdown task", t);
|
_log.log(Log.CRIT, "Error running shutdown task", t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set the last version to the current version, since 0.8.13
|
||||||
|
if (!RouterVersion.VERSION.equals(_config.get("router.previousVersion"))) {
|
||||||
|
_config.put("router.previousVersion", RouterVersion.VERSION);
|
||||||
|
saveConfig();
|
||||||
|
}
|
||||||
|
|
||||||
_context.removeShutdownTasks();
|
_context.removeShutdownTasks();
|
||||||
try { _context.clientManager().shutdown(); } catch (Throwable t) { _log.error("Error shutting down the client manager", t); }
|
try { _context.clientManager().shutdown(); } catch (Throwable t) { _log.error("Error shutting down the client manager", t); }
|
||||||
try { _context.namingService().shutdown(); } catch (Throwable t) { _log.error("Error shutting down the naming service", t); }
|
try { _context.namingService().shutdown(); } catch (Throwable t) { _log.error("Error shutting down the naming service", t); }
|
||||||
@ -1244,6 +1268,45 @@ public class Router implements RouterClock.ClockShiftListener {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the current config and then saves it.
|
||||||
|
* Prevents a race in the interval between setConfigSetting() / removeConfigSetting() and saveConfig(),
|
||||||
|
* Synchronized with getConfig() / saveConfig()
|
||||||
|
*
|
||||||
|
* @param name setting to add/change/remove before saving
|
||||||
|
* @param value if non-null, updated value; if null, setting will be removed
|
||||||
|
* @return success
|
||||||
|
* @since 0.8.13
|
||||||
|
*/
|
||||||
|
public synchronized boolean saveConfig(String name, String value) {
|
||||||
|
if (value != null)
|
||||||
|
_config.put(name, value);
|
||||||
|
else
|
||||||
|
_config.remove(name);
|
||||||
|
return saveConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the current config and then saves it.
|
||||||
|
* Prevents a race in the interval between setConfigSetting() / removeConfigSetting() and saveConfig(),
|
||||||
|
* Synchronized with getConfig() / saveConfig()
|
||||||
|
*
|
||||||
|
* @param toAdd settings to add/change before saving, may be null or empty
|
||||||
|
* @param toRemove settings to remove before saving, may be null or empty
|
||||||
|
* @return success
|
||||||
|
* @since 0.8.13
|
||||||
|
*/
|
||||||
|
public synchronized boolean saveConfig(Map toAdd, Collection<String> toRemove) {
|
||||||
|
if (toAdd != null)
|
||||||
|
_config.putAll(toAdd);
|
||||||
|
if (toRemove != null) {
|
||||||
|
for (String s : toRemove) {
|
||||||
|
_config.remove(toRemove);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return saveConfig();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The clock shift listener.
|
* The clock shift listener.
|
||||||
* Restart the router if we should.
|
* Restart the router if we should.
|
||||||
@ -1345,6 +1408,8 @@ public class Router implements RouterClock.ClockShiftListener {
|
|||||||
// This may be useful someday. First added in 0.8.2
|
// This may be useful someday. First added in 0.8.2
|
||||||
// Moved above the extract so we don't NCDFE
|
// Moved above the extract so we don't NCDFE
|
||||||
_config.put("router.updateLastInstalled", "" + System.currentTimeMillis());
|
_config.put("router.updateLastInstalled", "" + System.currentTimeMillis());
|
||||||
|
// Set the last version to the current version, since 0.8.13
|
||||||
|
_config.put("router.previousVersion", RouterVersion.VERSION);
|
||||||
saveConfig();
|
saveConfig();
|
||||||
ok = FileUtil.extractZip(updateFile, _context.getBaseDir());
|
ok = FileUtil.extractZip(updateFile, _context.getBaseDir());
|
||||||
}
|
}
|
||||||
|
@ -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 = 3;
|
public final static long BUILD = 4;
|
||||||
|
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "";
|
public final static String EXTRA = "";
|
||||||
|
@ -25,10 +25,10 @@ import net.i2p.util.Log;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class KBucketSet {
|
class KBucketSet {
|
||||||
private Log _log;
|
private final Log _log;
|
||||||
private I2PAppContext _context;
|
private final I2PAppContext _context;
|
||||||
private LocalHash _us;
|
private final LocalHash _us;
|
||||||
private KBucket _buckets[];
|
private final KBucket _buckets[];
|
||||||
private volatile int _size;
|
private volatile int _size;
|
||||||
|
|
||||||
public final static int BASE = 8; // must go into KEYSIZE_BITS evenly
|
public final static int BASE = 8; // must go into KEYSIZE_BITS evenly
|
||||||
@ -41,7 +41,7 @@ class KBucketSet {
|
|||||||
_us = new LocalHash(us);
|
_us = new LocalHash(us);
|
||||||
_context = context;
|
_context = context;
|
||||||
_log = context.logManager().getLog(KBucketSet.class);
|
_log = context.logManager().getLog(KBucketSet.class);
|
||||||
createBuckets();
|
_buckets = createBuckets();
|
||||||
context.statManager().createRateStat("netDb.KBSGetAllTime", "Time to add all Hashes to the Collector", "NetworkDatabase", new long[] { 60*60*1000 });
|
context.statManager().createRateStat("netDb.KBSGetAllTime", "Time to add all Hashes to the Collector", "NetworkDatabase", new long[] { 60*60*1000 });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,12 +132,13 @@ class KBucketSet {
|
|||||||
|
|
||||||
public KBucket getBucket(int bucket) { return _buckets[bucket]; }
|
public KBucket getBucket(int bucket) { return _buckets[bucket]; }
|
||||||
|
|
||||||
protected void createBuckets() {
|
protected KBucket[] createBuckets() {
|
||||||
_buckets = new KBucket[NUM_BUCKETS];
|
KBucket[] buckets = new KBucket[NUM_BUCKETS];
|
||||||
for (int i = 0; i < NUM_BUCKETS-1; i++) {
|
for (int i = 0; i < NUM_BUCKETS-1; i++) {
|
||||||
_buckets[i] = createBucket(i*BASE, (i+1)*BASE);
|
buckets[i] = createBucket(i*BASE, (i+1)*BASE);
|
||||||
}
|
}
|
||||||
_buckets[NUM_BUCKETS-1] = createBucket(BASE*(NUM_BUCKETS-1), BASE*(NUM_BUCKETS) + 1);
|
buckets[NUM_BUCKETS-1] = createBucket(BASE*(NUM_BUCKETS-1), BASE*(NUM_BUCKETS) + 1);
|
||||||
|
return buckets;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected KBucket createBucket(int start, int end) {
|
protected KBucket createBucket(int start, int end) {
|
||||||
|
@ -179,8 +179,9 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
|
|||||||
/** @return non-null, possibly empty */
|
/** @return non-null, possibly empty */
|
||||||
@Override
|
@Override
|
||||||
public Set<RouterAddress> createAddresses() {
|
public Set<RouterAddress> createAddresses() {
|
||||||
if (_context.router().isHidden())
|
// No, don't do this, it makes it almost impossible to build inbound tunnels
|
||||||
return Collections.EMPTY_SET;
|
//if (_context.router().isHidden())
|
||||||
|
// return Collections.EMPTY_SET;
|
||||||
Map<String, RouterAddress> addresses = null;
|
Map<String, RouterAddress> addresses = null;
|
||||||
boolean newCreated = false;
|
boolean newCreated = false;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user