forked from I2P_Developers/i2p.i2p
Console: Show SAM cert on /certs
Stub for jetty cert
This commit is contained in:
@ -20,6 +20,8 @@ public class CertHelper extends HelperBase {
|
||||
private static final String I2CP = "i2cp/i2cp.local.crt";
|
||||
private static final String CONSOLE = "console/console.local.crt";
|
||||
private static final String I2PTUNNEL_DIR = "i2ptunnel";
|
||||
private static final String SAM_DIR = "sam";
|
||||
private static final String EEPSITE = "eepsite/etc/keystore.ks";
|
||||
|
||||
public String getSummary() {
|
||||
File dir = new File(_context.getConfigDir(), DIR);
|
||||
@ -31,6 +33,7 @@ public class CertHelper extends HelperBase {
|
||||
output("Console", new File(dir, CONSOLE));
|
||||
// I2CP
|
||||
output("I2CP", new File(dir, I2CP));
|
||||
|
||||
// i2ptunnel clients
|
||||
File tunnelDir = new File(_context.getConfigDir(), I2PTUNNEL_DIR);
|
||||
boolean hasTunnels = false;
|
||||
@ -53,6 +56,28 @@ public class CertHelper extends HelperBase {
|
||||
if (!hasTunnels)
|
||||
output(_t("I2PTunnel"), null);
|
||||
|
||||
// SAM
|
||||
tunnelDir = new File(dir, SAM_DIR);
|
||||
hasTunnels = false;
|
||||
tunnels = tunnelDir.listFiles();
|
||||
if (tunnels != null) {
|
||||
for (int i = 0; i < tunnels.length; i++) {
|
||||
File f = tunnels[i];
|
||||
if (!f.isFile())
|
||||
continue;
|
||||
String name = f.getName();
|
||||
if (!name.endsWith(".local.crt"))
|
||||
continue;
|
||||
if (!name.startsWith("sam-"))
|
||||
continue;
|
||||
output("SAM", f);
|
||||
hasTunnels = true;
|
||||
}
|
||||
}
|
||||
if (!hasTunnels)
|
||||
output(_t("SAM"), null);
|
||||
|
||||
// Family
|
||||
_out.write("<h3>");
|
||||
_out.write(_t("Local Router Family Certificate"));
|
||||
_out.write("</h3>\n");
|
||||
@ -67,6 +92,19 @@ public class CertHelper extends HelperBase {
|
||||
_out.write("</p>\n");
|
||||
}
|
||||
|
||||
// Eepsite
|
||||
_out.write("<h3>");
|
||||
_out.write(_t("Website"));
|
||||
_out.write("</h3>\n");
|
||||
File ks = new File(_context.getConfigDir(), EEPSITE);
|
||||
if (ks.exists()) {
|
||||
// TODO
|
||||
} else {
|
||||
_out.write("<p>");
|
||||
_out.write(_t("none"));
|
||||
_out.write("</p>\n");
|
||||
}
|
||||
|
||||
// anything else? plugins?
|
||||
|
||||
} catch (IOException ioe) {
|
||||
|
Reference in New Issue
Block a user