propagate from branch 'i2p.i2p' (head e606c473eb1e461a477e45419f6295b6430a7353)

to branch 'i2p.i2p.zzz.test2' (head 6212892778308db10a86e58f9f275c838f604973)
This commit is contained in:
zzz
2014-09-09 19:27:10 +00:00
83 changed files with 1081 additions and 236 deletions

View File

@@ -158,6 +158,8 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
// right at instantiation if the news is already indicating a new version
Checker c = new NewsHandler(_context, this);
register(c, NEWS, HTTP, 0);
// TODO
//register(c, NEWS_SU3, HTTP, 0);
register(c, ROUTER_SIGNED, HTTP, 0); // news is an update checker for the router
Updater u = new UpdateHandler(_context, this);
register(u, ROUTER_SIGNED, HTTP, 0);
@@ -734,9 +736,9 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
UpdateType type, String id,
Map<UpdateMethod, List<URI>> sourceMap,
String newVersion, String minVersion) {
if (type == NEWS) {
if (type == NEWS || type == NEWS_SU3) {
// shortcut
notifyInstalled(NEWS, "", newVersion);
notifyInstalled(type, "", newVersion);
return true;
}
UpdateItem ui = new UpdateItem(type, id);
@@ -806,6 +808,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
String msg = null;
switch (type) {
case NEWS:
case NEWS_SU3:
break;
case ROUTER_UNSIGNED:
@@ -900,6 +903,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
String msg = null;
switch (task.getType()) {
case NEWS:
case NEWS_SU3:
case ROUTER_SIGNED:
case ROUTER_SIGNED_SU3:
case ROUTER_UNSIGNED:
@@ -1009,6 +1013,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
switch (task.getType()) {
case TYPE_DUMMY:
case NEWS:
case NEWS_SU3:
rv = true;
break;
@@ -1132,6 +1137,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
switch (type) {
case NEWS:
case NEWS_SU3:
// handled in NewsHandler
break;

View File

@@ -124,6 +124,7 @@ class NewsFetcher extends UpdateRunner {
* Parse the installed (not the temp) news file for the latest version.
* TODO: Real XML parsing
* TODO: Check minVersion, use backup URLs specified
* TODO: SU3
*/
void checkForUpdates() {
FileInputStream in = null;

View File

@@ -29,6 +29,7 @@ class NewsHandler extends UpdateHandler implements Checker {
* @since 0.7.14 not configurable
*/
private static final String BACKUP_NEWS_URL = "http://avviiexdngd32ccoy4kuckvc3mkf53ycvzbz6vz75vzhv4tbpk5a.b32.i2p/news.xml";
private static final String BACKUP_NEWS_URL_SU3 = "http://avviiexdngd32ccoy4kuckvc3mkf53ycvzbz6vz75vzhv4tbpk5a.b32.i2p/news.su3";
public NewsHandler(RouterContext ctx, ConsoleUpdateManager mgr) {
super(ctx, mgr);
@@ -41,14 +42,17 @@ class NewsHandler extends UpdateHandler implements Checker {
*/
public UpdateTask check(UpdateType type, UpdateMethod method,
String id, String currentVersion, long maxTime) {
if ((type != ROUTER_SIGNED && type != NEWS) ||
if ((type != ROUTER_SIGNED && type != NEWS && type != NEWS_SU3) ||
method != HTTP)
return null;
List<URI> updateSources = new ArrayList<URI>(2);
try {
// TODO SU3
updateSources.add(new URI(ConfigUpdateHelper.getNewsURL(_context)));
} catch (URISyntaxException use) {}
try {
// TODO
//updateSources.add(new URI(BACKUP_NEWS_URL_SU3));
updateSources.add(new URI(BACKUP_NEWS_URL));
} catch (URISyntaxException use) {}
UpdateRunner update = new NewsFetcher(_context, _mgr, updateSources);

View File

@@ -59,7 +59,7 @@ public class ConfigClientsHandler extends FormHandler {
}
if (_action.equals(_("Install Plugin"))) {
if (pluginsEnabled &&
(_context.getBooleanProperty(ConfigClientsHelper.PROP_ENABLE_PLUGIN_INSTALL) ||
(_context.getBooleanPropertyDefaultTrue(ConfigClientsHelper.PROP_ENABLE_PLUGIN_INSTALL) ||
isAdvanced()))
installPlugin();
else

View File

@@ -39,7 +39,12 @@ public class ConfigClientsHelper extends HelperBase {
/** @since 0.9.14.1 */
public boolean isPluginInstallEnabled() {
return PluginStarter.pluginsEnabled(_context) &&
(_context.getBooleanProperty(PROP_ENABLE_PLUGIN_INSTALL) || isAdvanced());
(_context.getBooleanPropertyDefaultTrue(PROP_ENABLE_PLUGIN_INSTALL) || isAdvanced());
}
/** @since 0.9.15 */
public boolean isPluginUpdateEnabled() {
return !PluginStarter.getPlugins().isEmpty();
}
/** @since 0.8.3 */

View File

@@ -32,6 +32,7 @@ public class ConfigUpdateHandler extends FormHandler {
// public static final String DEFAULT_NEWS_URL = "http://dev.i2p.net/cgi-bin/cvsweb.cgi/i2p/news.xml?rev=HEAD";
public static final String OLD_DEFAULT_NEWS_URL = "http://complication.i2p/news.xml";
public static final String DEFAULT_NEWS_URL = "http://echelon.i2p/i2p/news.xml";
public static final String DEFAULT_NEWS_URL_SU3 = "http://echelon.i2p/i2p/news.su3";
public static final String PROP_REFRESH_FREQUENCY = "router.newsRefreshFrequency";
public static final long DEFAULT_REFRESH_FREQ = 36*60*60*1000l;
public static final String DEFAULT_REFRESH_FREQUENCY = Long.toString(DEFAULT_REFRESH_FREQ);

View File

@@ -32,6 +32,7 @@ public class ConfigUpdateHelper extends HelperBase {
/** hack to replace the old news location with the new one, even if they have saved
the update page at some point */
public static String getNewsURL(I2PAppContext ctx) {
// TODO SU3
String url = ctx.getProperty(ConfigUpdateHandler.PROP_NEWS_URL);
if (url != null && !url.equals(ConfigUpdateHandler.OLD_DEFAULT_NEWS_URL))
return url;

View File

@@ -9,6 +9,7 @@ import java.util.ArrayList;
import java.util.List;
import net.i2p.I2PAppContext;
import net.i2p.crypto.SigType;
import net.i2p.util.FileUtil;
import net.i2p.util.VersionComparator;
@@ -29,6 +30,17 @@ public class LogsHelper extends HelperBase {
return Server.getVersion();
}
/** @since 0.9.15 */
public String getUnavailableCrypto() {
StringBuilder buf = new StringBuilder(128);
for (SigType t : SigType.values()) {
if (!t.isAvailable()) {
buf.append("<b>Crypto:</b> ").append(t.toString()).append(" unavailable<br>");
}
}
return buf.toString();
}
/**
* Does not call logManager.flush(); call getCriticalLogs() first to flush
*/

View File

@@ -105,7 +105,10 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
<input type="submit" name="action" class="accept" value="<%=intl._("Save WebApp Configuration")%>" />
</div></form></div>
<% if (clientshelper.showPlugins()) { %>
<%
if (clientshelper.showPlugins()) {
if (clientshelper.isPluginUpdateEnabled()) {
%>
<h3><a name="pconfig"></a><%=intl._("Plugin Configuration")%></h3><p>
<%=intl._("The plugins listed below are started by the webConsole client.")%>
</p><div class="wideload">
@@ -116,25 +119,47 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
<input type="submit" class="cancel" name="foo" value="<%=intl._("Cancel")%>" />
<input type="submit" name="action" class="accept" value="<%=intl._("Save Plugin Configuration")%>" />
</div></form></div>
<% if (clientshelper.isPluginInstallEnabled()) { %>
<%
} // pluginUpdateEnabled
if (clientshelper.isPluginInstallEnabled()) {
%>
<h3><a name="plugin"></a><%=intl._("Plugin Installation")%></h3><p>
<%=intl._("Look for available plugins on {0}.", "<a href=\"http://plugins.i2p\">plugins.i2p</a>")%>
<%=intl._("To install a plugin, enter the download URL:")%>
</p><div class="wideload">
</p>
<%
} // pluginInstallEnabled
if (clientshelper.isPluginInstallEnabled() || clientshelper.isPluginUpdateEnabled()) {
%>
<div class="wideload">
<form action="configclients" method="POST">
<input type="hidden" name="nonce" value="<%=pageNonce%>" >
<%
if (clientshelper.isPluginInstallEnabled()) {
%>
<p>
<input type="text" size="60" name="pluginURL" >
</p><hr><div class="formaction">
<input type="submit" name="action" class="default" value="<%=intl._("Install Plugin")%>" />
<input type="submit" class="cancel" name="foo" value="<%=intl._("Cancel")%>" />
<input type="submit" name="action" class="download" value="<%=intl._("Install Plugin")%>" />
</div><hr><div class="formaction">
<input type="submit" name="action" class="reload" value="<%=intl._("Update All Installed Plugins")%>" />
</div></form></div>
</div>
<%
} // pluginInstallEnabled
} // showPlugins
} // pluginInstallEnabled
%>
</div>
<%
if (clientshelper.isPluginUpdateEnabled()) {
%>
<hr><div class="formaction">
<input type="submit" name="action" class="reload" value="<%=intl._("Update All Installed Plugins")%>" />
</div>
<%
} // pluginUpdateEnabled
%>
</form></div>
<%
} // pluginInstallEnabled || pluginUpdateEnabled
} // showPlugins
%>
</div></div></body></html>

View File

@@ -60,9 +60,10 @@
<p>
<b>I2P version:</b> <%=net.i2p.router.RouterVersion.FULL_VERSION%><br>
<b>Java version:</b> <%=System.getProperty("java.vendor")%> <%=System.getProperty("java.version")%> (<%=System.getProperty("java.runtime.name")%> <%=System.getProperty("java.runtime.version")%>)<br>
<b>Wrapper version:</b> <%=System.getProperty("wrapper.version", "none")%><br>
<jsp:useBean class="net.i2p.router.web.LogsHelper" id="logsHelper" scope="request" />
<jsp:setProperty name="logsHelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
<jsp:getProperty name="logsHelper" property="unavailableCrypto" />
<b>Wrapper version:</b> <%=System.getProperty("wrapper.version", "none")%><br>
<b>Server version:</b> <jsp:getProperty name="logsHelper" property="jettyVersion" /><br>
<b>Servlet version:</b> <%=getServletInfo()%><br>
<b>Platform:</b> <%=System.getProperty("os.name")%> <%=System.getProperty("os.arch")%> <%=System.getProperty("os.version")%><br>

View File

@@ -24,16 +24,18 @@
<p>
<b>I2P version:</b> <%=net.i2p.router.RouterVersion.FULL_VERSION%><br>
<b>Java version:</b> <%=System.getProperty("java.vendor")%> <%=System.getProperty("java.version")%> (<%=System.getProperty("java.runtime.name")%> <%=System.getProperty("java.runtime.version")%>)<br>
<b>Wrapper version:</b> <%=System.getProperty("wrapper.version", "none")%><br>
<jsp:useBean class="net.i2p.router.web.LogsHelper" id="logsHelper" scope="request" />
<jsp:setProperty name="logsHelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
<jsp:getProperty name="logsHelper" property="unavailableCrypto" />
<b>Wrapper version:</b> <%=System.getProperty("wrapper.version", "none")%><br>
<b>Server version:</b> <jsp:getProperty name="logsHelper" property="jettyVersion" /><br>
<b>Servlet version:</b> <%=getServletInfo()%><br>
<b>Platform:</b> <%=System.getProperty("os.name")%> <%=System.getProperty("os.arch")%> <%=System.getProperty("os.version")%><br>
<b>Processor:</b> <%=net.i2p.util.NativeBigInteger.cpuModel()%> (<%=net.i2p.util.NativeBigInteger.cpuType()%>)<br>
<b>Jbigi:</b> <%=net.i2p.util.NativeBigInteger.loadStatus()%><br>
<b>Encoding:</b> <%=System.getProperty("file.encoding")%><br>
<b>Charset:</b> <%=java.nio.charset.Charset.defaultCharset().name()%></p>
<b>Charset:</b> <%=java.nio.charset.Charset.defaultCharset().name()%><br>
</p>
<p><%=intl._("Note that system information, log timestamps, and log messages may provide clues to your location; please review everything you include in a bug report.")%></p>
<h3><%=intl._("Critical Logs")%></h3><a name="criticallogs"> </a>
<jsp:getProperty name="logsHelper" property="criticalLogs" />