diff --git a/apps/i2pcontrol/java/net/i2p/i2pcontrol/servlets/JSONRPC2Servlet.java b/apps/i2pcontrol/java/net/i2p/i2pcontrol/servlets/JSONRPC2Servlet.java index 145e181c12b078976181b81033c965b23c7815f4..a9f77f44d4fa9b98b3352b7c9596fe0da88c9f1b 100644 --- a/apps/i2pcontrol/java/net/i2p/i2pcontrol/servlets/JSONRPC2Servlet.java +++ b/apps/i2pcontrol/java/net/i2p/i2pcontrol/servlets/JSONRPC2Servlet.java @@ -156,11 +156,11 @@ public class JSONRPC2Servlet extends HttpServlet { } else { out.println("<p>Current API password:<input name=\"password\" type=\"password\">"); } - out.println("<p>New API password (twice):<input name=\"password2\" type=\"password\">" + - "<input name=\"password3\" type=\"password\">" + + out.println("<p>New API password (twice): <input name=\"password2\" type=\"password\"> " + + "<input name=\"password3\" type=\"password\"> " + "<input name=\"save\" type=\"submit\" value=\"Change API Password\">" + - "<p>If you forget the API password, stop i2pcontrol, delete the file <tt>" + _conf.getConfFile() + - "</tt>, and restart i2pcontrol."); + "<p>If you forget the API password, <a href=\"/configwebapps\">stop jsonrpc</a>, delete the file <tt>" + _conf.getConfFile() + + "</tt>, and <a href=\"/configwebapps\">restart jsonrpc</a>."); out.println("</form>"); } else { out.println("<p><a href=\"password\">Change API Password</a>"); diff --git a/apps/i2pcontrol/java/net/i2p/i2pcontrol/servlets/jsonrpc2handlers/RouterInfoHandler.java b/apps/i2pcontrol/java/net/i2p/i2pcontrol/servlets/jsonrpc2handlers/RouterInfoHandler.java index 8df58c81da90fd5d350521b96194980005b3455d..910ee1a51ad66445412ec9de3136a1dd5176caa6 100644 --- a/apps/i2pcontrol/java/net/i2p/i2pcontrol/servlets/jsonrpc2handlers/RouterInfoHandler.java +++ b/apps/i2pcontrol/java/net/i2p/i2pcontrol/servlets/jsonrpc2handlers/RouterInfoHandler.java @@ -179,25 +179,44 @@ public class RouterInfoHandler implements RequestHandler { int status = _context.commSystem().getStatus().getCode(); switch (status) { - case CommSystemFacade.STATUS_OK: - RouterAddress ra = _context.router().getRouterInfo().getTargetAddress("NTCP"); + + case CommSystemFacade.STATUS_OK: + case CommSystemFacade.STATUS_IPV4_OK_IPV6_UNKNOWN: + case CommSystemFacade.STATUS_IPV4_OK_IPV6_FIREWALLED: + case CommSystemFacade.STATUS_IPV4_FIREWALLED_IPV6_OK: + case CommSystemFacade.STATUS_IPV4_DISABLED_IPV6_OK: + RouterAddress ra = _context.router().getRouterInfo().getTargetAddress("NTCP2"); if (ra == null || TransportUtil.isPubliclyRoutable(ra.getIP(), true)) return NETWORK_STATUS.OK; return NETWORK_STATUS.ERROR_PRIVATE_TCP_ADDRESS; - case CommSystemFacade.STATUS_DIFFERENT: + + case CommSystemFacade.STATUS_DIFFERENT: + case CommSystemFacade.STATUS_IPV4_SNAT_IPV6_OK: + case CommSystemFacade.STATUS_IPV4_SNAT_IPV6_UNKNOWN: return NETWORK_STATUS.ERROR_SYMMETRIC_NAT; - case CommSystemFacade.STATUS_REJECT_UNSOLICITED: - if (_context.router().getRouterInfo().getTargetAddress("NTCP") != null) + + case CommSystemFacade.STATUS_REJECT_UNSOLICITED: + case CommSystemFacade.STATUS_IPV4_FIREWALLED_IPV6_UNKNOWN: + case CommSystemFacade.STATUS_IPV4_DISABLED_IPV6_FIREWALLED: + if (_context.router().getRouterInfo().getTargetAddress("NTCP2") != null) return NETWORK_STATUS.WARN_FIREWALLED_WITH_INBOUND_TCP; if (((FloodfillNetworkDatabaseFacade) _context.netDb()).floodfillEnabled()) return NETWORK_STATUS.WARN_FIREWALLED_AND_FLOODFILL; if (_context.router().getRouterInfo().getCapabilities().indexOf('O') >= 0) return NETWORK_STATUS.WARN_FIREWALLED_AND_FAST; return NETWORK_STATUS.FIREWALLED; - case CommSystemFacade.STATUS_HOSED: + + case CommSystemFacade.STATUS_HOSED: return NETWORK_STATUS.ERROR_UDP_PORT_IN_USE; - case CommSystemFacade.STATUS_UNKNOWN: // fallthrough - default: + + case CommSystemFacade.STATUS_DISCONNECTED: + return NETWORK_STATUS.ERROR_NO_ACTIVE_PEERS_CHECK_CONNECTION_AND_FIREWALL; + + case CommSystemFacade.STATUS_UNKNOWN: // fallthrough + case CommSystemFacade.STATUS_IPV4_UNKNOWN_IPV6_OK: + case CommSystemFacade.STATUS_IPV4_UNKNOWN_IPV6_FIREWALLED: + case CommSystemFacade.STATUS_IPV4_DISABLED_IPV6_UNKNOWN: + default: ra = _context.router().getRouterInfo().getTargetAddress("SSU"); if (ra == null && _context.router().getUptime() > 5 * 60 * 1000) { if (_context.commSystem().countActivePeers() <= 0)