diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/HomeHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/HomeHelper.java index 1274b00166..d952da75d9 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/HomeHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/HomeHelper.java @@ -63,7 +63,7 @@ public class HomeHelper extends HelperBase { _x("I2P Forum") + S + _x("Community forum") + S + "http://i2pforum.i2p/" + S + I + "group.png" + S + //"git.repo.i2p" + S + _x("A public anonymous Git hosting site - supports pulling via Git and HTTP and pushing via SSH") + S + "http://git.repo.i2p/" + S + I + "git-logo.png" + S + //"hiddengate [ru]" + S + _x("Russian I2P-related wiki") + S + "http://hiddengate.i2p/" + S + I + "hglogo32.png" + S + - _x("I2P Wiki") + S + _x("Anonymous wiki - share the knowledge") + S + "http://i2pwiki.i2p/" + S + I + "i2pwiki_logo.png" + S + + //_x("I2P Wiki") + S + _x("Anonymous wiki - share the knowledge") + S + "http://i2pwiki.i2p/" + S + I + "i2pwiki_logo.png" + S + //"Ident " + _x("Microblog") + S + _x("Your premier microblogging service on I2P") + S + "http://id3nt.i2p/" + S + I + "ident_icon_blue.png" + S + //_x("Javadocs") + S + _x("Technical documentation") + S + "http://i2p-javadocs.i2p/" + S + I + "education.png" + S + //"jisko.i2p" + S + _x("Simple and fast microblogging website") + S + "http://jisko.i2p/" + S + I + "jisko_console_icon.png" + S + @@ -196,18 +196,10 @@ public class HomeHelper extends HelperBase { for (App app : apps) { String url; if (app.name.equals(website) && app.url.equals("http://127.0.0.1:7658/")) { - int port = pm.getPort(PortMapper.SVC_EEPSITE); - int sslPort = pm.getPort(PortMapper.SVC_HTTPS_EEPSITE); - if (port <= 0 && sslPort <= 0) - continue; // fixup eepsite link - if (sslPort > 0) { - url = "https://" + pm.getActualHost(PortMapper.SVC_HTTPS_EEPSITE, "127.0.0.1") + - ':' + sslPort + '/'; - } else { - url = "http://" + pm.getActualHost(PortMapper.SVC_EEPSITE, "127.0.0.1") + - ':' + port + '/'; - } + url = SummaryBarRenderer.getEepsiteURL(pm); + if (url == null) + continue; } else { url = app.url; // check for disabled webapps and other things diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/SummaryBarRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/SummaryBarRenderer.java index cc33b705e6..ce5bfc4b7a 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/SummaryBarRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/SummaryBarRenderer.java @@ -231,26 +231,15 @@ class SummaryBarRenderer { .append("\n"); } - int port = pm.getPort(PortMapper.SVC_EEPSITE); - int sslPort = pm.getPort(PortMapper.SVC_HTTPS_EEPSITE); - if (sslPort > 0 || port > 0) { - String svc; - if (sslPort > 0) { - buf.append("") - .append(nbsp(_t("Web Server"))) - .append("\n"); + String url = getEepsiteURL(pm); + if (url != null) { + buf.append("") + .append(nbsp(_t("Web Server"))) + .append("\n"); } buf.append(NavHelper.getClientAppLinks(_context)) @@ -259,6 +248,37 @@ class SummaryBarRenderer { return buf.toString(); } + /** + * @return null if none + * @since 0.9.43 split out from above, used by HomeHelper, fixed for IPv6 + */ + static String getEepsiteURL(PortMapper pm) { + int port = pm.getPort(PortMapper.SVC_EEPSITE); + int sslPort = pm.getPort(PortMapper.SVC_HTTPS_EEPSITE); + if (port <= 0 && sslPort <= 0) + return null; + String svc; + StringBuilder buf = new StringBuilder(32); + if (sslPort > 0) { + buf.append("https://"); + svc = PortMapper.SVC_HTTPS_EEPSITE; + port = sslPort; + } else { + buf.append("http://"); + svc = PortMapper.SVC_EEPSITE; + } + String host = pm.getActualHost(svc, "127.0.0.1"); + if (host.contains(":")) + buf.append('['); + buf.append(host); + if (host.contains(":")) + buf.append(']'); + buf.append(':') + .append(port) + .append('/'); + return buf.toString(); + } + public String renderI2PInternalsHTML() { StringBuilder buf = new StringBuilder(512); buf.append("

0 && httpHost.equals(unset) && !httpsHost.equals(unset); - if (httpsOnly) + if (httpsOnly) { + if (httpsHost.contains(":")) + return "https://[" + httpsHost + "]:" + httpsPort + '/'; return "https://" + httpsHost + ':' + httpsPort + '/'; + } if (httpHost.equals(unset)) httpHost = DEFAULT_HOST; + if (httpHost.contains(":")) + return "http://[" + httpHost + "]:" + httpPort + '/'; return "http://" + httpHost + ':' + httpPort + '/'; } @@ -298,10 +303,15 @@ public class PortMapper { int httpPort = getPort(SVC_CONSOLE); int httpsPort = getPort(SVC_HTTPS_CONSOLE, DEFAULT_HTTPS_CONSOLE_PORT); boolean httpOnly = httpPort > 0 && httpsHost.equals(unset) && !httpHost.equals(unset); - if (httpOnly) + if (httpOnly) { + if (httpHost.contains(":")) + return "http://[" + httpHost + "]:" + httpPort + '/'; return "http://" + httpHost + ':' + httpPort + '/'; + } if (httpsHost.equals(unset)) return "http://" + DEFAULT_HOST + ':' + DEFAULT_CONSOLE_PORT + '/'; + if (httpsHost.contains(":")) + return "https://[" + httpsHost + "]:" + httpsPort + '/'; return "https://" + httpsHost + ':' + httpsPort + '/'; } diff --git a/history.txt b/history.txt index eef381abec..fc6ec42b75 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,13 @@ +2019-10-01 zzz + * Console: Remove i2pwiki.i2p (ticket #2626) + * PortMapper: Fix URL generation for IPv6 hosts + +2019-09-21 zzz + * Tomcat 8.5.46 + +2019-09-19 zzz + * i2ptunnel: Support quoting for custom options (ticket #2603) + 2019-09-18 zzz * I2CP: - More BlindingInfo serialization fixes diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index a6204817e3..f2522cd4ed 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 8; + public final static long BUILD = 9; /** for example "-test" */ public final static String EXTRA = "";