2009-08-23 16:12:09 +00:00
|
|
|
<%@page contentType="text/html"%>
|
2012-01-10 13:21:35 +00:00
|
|
|
<%@page trimDirectiveWhitespaces="true"%>
|
2009-08-23 16:12:09 +00:00
|
|
|
<%@page pageEncoding="UTF-8"%>
|
2023-09-23 16:11:37 -04:00
|
|
|
<!DOCTYPE html>
|
2009-10-26 21:48:46 +00:00
|
|
|
<%
|
|
|
|
/*
|
|
|
|
* Do not tag this file for translation.
|
|
|
|
*/
|
|
|
|
%>
|
2009-08-28 03:12:23 +00:00
|
|
|
<html><head><title>I2P Router Console - Debug</title>
|
2009-11-21 13:33:57 +00:00
|
|
|
<%@include file="css.jsi" %>
|
2012-07-17 00:47:08 +00:00
|
|
|
<%@include file="summaryajax.jsi" %>
|
2019-12-25 12:18:00 +00:00
|
|
|
</head><body>
|
2009-11-21 13:33:57 +00:00
|
|
|
<%@include file="summary.jsi" %>
|
2012-10-22 17:13:23 +00:00
|
|
|
<h1>Router Debug</h1>
|
2016-05-23 05:41:24 +00:00
|
|
|
<div class="main" id="debug">
|
2017-07-26 23:14:30 +00:00
|
|
|
|
|
|
|
<div class="confignav">
|
2023-01-27 08:01:43 -05:00
|
|
|
<span class="tab"><a href="/debug">Port Mapper</a></span>
|
|
|
|
<span class="tab"><a href="/debug?d=1">App Manager</a></span>
|
|
|
|
<span class="tab"><a href="/debug?d=2">Update Manager</a></span>
|
|
|
|
<span class="tab"><a href="/debug?d=3">Router Session Key Manager</a></span>
|
|
|
|
<span class="tab"><a href="/debug?d=4">Client Session Key Managers</a></span>
|
|
|
|
<span class="tab"><a href="/debug?d=5">Router DHT</a></span>
|
2024-07-25 11:35:36 +00:00
|
|
|
<span class="tab"><a href="/debug?d=6">Translation Status</a></span>
|
2024-11-26 09:42:36 -05:00
|
|
|
<span class="tab"><a href="/debug?d=7">Jars</a></span>
|
2017-07-26 23:14:30 +00:00
|
|
|
</div>
|
|
|
|
|
2009-08-23 16:12:09 +00:00
|
|
|
<%
|
|
|
|
/*
|
|
|
|
* Quick and easy place to put debugging stuff
|
|
|
|
*/
|
|
|
|
net.i2p.router.RouterContext ctx = (net.i2p.router.RouterContext) net.i2p.I2PAppContext.getGlobalContext();
|
|
|
|
|
2023-01-27 08:01:43 -05:00
|
|
|
String dd = request.getParameter("d");
|
|
|
|
if (dd == null || dd.equals("0")) {
|
|
|
|
|
2017-07-26 23:14:30 +00:00
|
|
|
/*
|
|
|
|
* Print out the status for the PortMapper
|
|
|
|
*/
|
|
|
|
ctx.portMapper().renderStatusHTML(out);
|
|
|
|
|
2017-12-13 16:06:13 +00:00
|
|
|
/*
|
|
|
|
* Print out the status for the InternalServerSockets
|
|
|
|
*/
|
|
|
|
net.i2p.util.InternalServerSocket.renderStatusHTML(out);
|
|
|
|
|
2023-01-27 08:01:43 -05:00
|
|
|
} else if (dd.equals("1")) {
|
|
|
|
|
2017-07-26 23:14:30 +00:00
|
|
|
/*
|
|
|
|
* Print out the status for the AppManager
|
|
|
|
*/
|
|
|
|
|
|
|
|
out.print("<div class=\"debug_section\" id=\"appmanager\">");
|
|
|
|
ctx.routerAppManager().renderStatusHTML(out);
|
|
|
|
out.print("</div>");
|
|
|
|
|
2023-01-27 08:01:43 -05:00
|
|
|
} else if (dd.equals("2")) {
|
2017-07-26 23:14:30 +00:00
|
|
|
|
2009-08-23 16:12:09 +00:00
|
|
|
/*
|
2012-10-22 17:13:23 +00:00
|
|
|
* Print out the status for the UpdateManager
|
2009-08-23 16:12:09 +00:00
|
|
|
*/
|
2017-07-26 23:14:30 +00:00
|
|
|
out.print("<div class=\"debug_section\" id=\"updatemanager\">");
|
2014-02-07 15:40:23 +00:00
|
|
|
net.i2p.app.ClientAppManager cmgr = ctx.clientAppManager();
|
|
|
|
if (cmgr != null) {
|
|
|
|
net.i2p.router.update.ConsoleUpdateManager umgr =
|
|
|
|
(net.i2p.router.update.ConsoleUpdateManager) cmgr.getRegisteredApp(net.i2p.update.UpdateManager.APP_NAME);
|
|
|
|
if (umgr != null) {
|
|
|
|
umgr.renderStatusHTML(out);
|
|
|
|
}
|
2017-07-26 23:14:30 +00:00
|
|
|
out.print("</div>");
|
2014-02-07 15:40:23 +00:00
|
|
|
}
|
2009-08-28 03:12:23 +00:00
|
|
|
|
2023-01-27 08:01:43 -05:00
|
|
|
} else if (dd.equals("3")) {
|
|
|
|
|
2012-10-22 17:13:23 +00:00
|
|
|
/*
|
|
|
|
* Print out the status for all the SessionKeyManagers
|
|
|
|
*/
|
2017-07-26 23:14:30 +00:00
|
|
|
out.print("<div class=\"debug_section\" id=\"skm\">");
|
|
|
|
out.print("<h2>Router Session Key Manager</h2>");
|
2009-08-23 16:12:09 +00:00
|
|
|
ctx.sessionKeyManager().renderStatusHTML(out);
|
2017-07-26 23:14:30 +00:00
|
|
|
out.print("</div>");
|
2023-01-27 08:01:43 -05:00
|
|
|
|
|
|
|
} else if (dd.equals("4")) {
|
|
|
|
|
|
|
|
out.print("<h2>Client Session Key Managers</h2>");
|
|
|
|
java.util.Set<net.i2p.data.Destination> clients = ctx.clientManager().listClients();
|
2023-02-01 08:01:35 -05:00
|
|
|
java.util.Set<net.i2p.crypto.SessionKeyManager> skms = new java.util.HashSet<net.i2p.crypto.SessionKeyManager>(clients.size());
|
2020-04-19 11:11:24 +00:00
|
|
|
int i = 0;
|
2009-08-23 16:12:09 +00:00
|
|
|
for (net.i2p.data.Destination dest : clients) {
|
|
|
|
net.i2p.data.Hash h = dest.calculateHash();
|
|
|
|
net.i2p.crypto.SessionKeyManager skm = ctx.clientManager().getClientSessionKeyManager(h);
|
|
|
|
if (skm != null) {
|
2020-12-29 16:29:53 -05:00
|
|
|
out.print("<div class=\"debug_section\" id=\"cskm" + (i++) + "\"><h2>");
|
|
|
|
net.i2p.router.TunnelPoolSettings tps = ctx.tunnelManager().getInboundSettings(h);
|
|
|
|
if (tps != null) {
|
|
|
|
String nick = tps.getDestinationNickname();
|
|
|
|
if (nick != null)
|
|
|
|
out.print(net.i2p.data.DataHelper.escapeHTML(nick));
|
|
|
|
else
|
|
|
|
out.print("<font size=\"-2\">" + dest.toBase32() + "</font>");
|
|
|
|
} else {
|
|
|
|
out.print("<font size=\"-2\">" + dest.toBase32() + "</font>");
|
|
|
|
}
|
|
|
|
out.print(" Session Key Manager</h2>");
|
2023-02-01 08:01:35 -05:00
|
|
|
if (skms.add(skm))
|
|
|
|
skm.renderStatusHTML(out);
|
|
|
|
else
|
|
|
|
out.print("<p>See Session Key Manager for alternate destination above</p>");
|
2017-07-26 23:14:30 +00:00
|
|
|
out.print("</div>");
|
2009-08-23 16:12:09 +00:00
|
|
|
}
|
|
|
|
}
|
2023-01-27 08:01:43 -05:00
|
|
|
} else if (dd.equals("5")) {
|
2014-10-29 15:34:52 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Print out the status for the NetDB
|
|
|
|
*/
|
2017-07-26 23:14:30 +00:00
|
|
|
out.print("<h2 id=\"dht\">Router DHT</h2>");
|
2014-10-29 15:34:52 +00:00
|
|
|
ctx.netDb().renderStatusHTML(out);
|
|
|
|
|
2024-07-25 11:35:36 +00:00
|
|
|
} else if (dd.equals("6")) {
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Print out the status of the translations
|
|
|
|
*/
|
|
|
|
java.io.InputStream is = this.getClass().getResourceAsStream("/net/i2p/router/web/resources/translationstatus.html");
|
|
|
|
if (is == null) {
|
|
|
|
out.println("Translation status not available");
|
|
|
|
} else {
|
|
|
|
java.io.Reader br = null;
|
|
|
|
try {
|
|
|
|
br = new java.io.InputStreamReader(is, "UTF-8");
|
|
|
|
char[] buf = new char[4096];
|
|
|
|
int read;
|
|
|
|
while ( (read = br.read(buf)) >= 0) {
|
|
|
|
out.write(buf, 0, read);
|
|
|
|
}
|
|
|
|
} finally {
|
|
|
|
if (br != null) try { br.close(); } catch (java.io.IOException ioe) {}
|
|
|
|
}
|
|
|
|
}
|
2024-11-26 09:42:36 -05:00
|
|
|
} else if (dd.equals("7")) {
|
|
|
|
%>
|
|
|
|
<h2>Jar File Dump</h2>
|
|
|
|
<jsp:useBean class="net.i2p.router.web.helpers.FileDumpHelper" id="dumpHelper" scope="request" />
|
|
|
|
<jsp:setProperty name="dumpHelper" property="contextId" value="<%=i2pcontextId%>" />
|
|
|
|
<jsp:getProperty name="dumpHelper" property="fileSummary" />
|
|
|
|
<%
|
2023-01-27 08:01:43 -05:00
|
|
|
}
|
|
|
|
|
2009-08-23 16:12:09 +00:00
|
|
|
%>
|
|
|
|
</div></body></html>
|