2009-08-20 22:22:07 +00:00
<%
2011-03-21 14:27:46 +00:00
// NOTE: Do the header carefully so there is no whitespace before the <?xml... line
2009-08-20 22:22:07 +00:00
// http://www.crazysquirrel.com/computing/general/form-encoding.jspx
if (request.getCharacterEncoding() == null)
request.setCharacterEncoding("UTF-8");
2011-03-21 14:27:46 +00:00
2012-05-13 13:05:17 +00:00
response.setHeader("X-Frame-Options", "SAMEORIGIN");
2014-07-26 11:01:16 +00:00
response.setHeader("Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'");
2014-07-26 09:32:26 +00:00
response.setHeader("X-XSS-Protection", "1; mode=block");
2016-02-25 14:56:06 +00:00
response.setHeader("X-Content-Type-Options", "nosniff");
2016-12-23 12:35:41 +00:00
response.setHeader("Referrer-Policy", "no-referrer");
2012-05-13 13:05:17 +00:00
2011-03-21 14:27:46 +00:00
%><%@page pageEncoding="UTF-8"
2012-01-10 13:21:35 +00:00
%><%@page trimDirectiveWhitespaces="true"
2011-03-21 14:27:46 +00:00
%><%@page contentType="text/html" import="net.i2p.i2ptunnel.web.IndexBean"
%><?xml version="1.0" encoding="UTF-8"?>
2009-07-17 12:26:29 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<jsp:useBean class="net.i2p.i2ptunnel.web.IndexBean" id="indexBean" scope="request" />
<jsp:setProperty name="indexBean" property="*" />
2009-12-10 01:06:55 +00:00
<jsp:useBean class="net.i2p.i2ptunnel.web.Messages" id="intl" scope="request" />
2009-07-17 12:26:29 +00:00
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
2015-09-25 19:55:36 +00:00
<title><%=intl._t("Hidden Services Manager")%></title>
2009-07-17 22:56:06 +00:00
2009-08-20 22:22:07 +00:00
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
2009-07-17 22:56:06 +00:00
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
2009-08-20 22:22:07 +00:00
<link href="/themes/console/images/favicon.ico" type="image/x-icon" rel="shortcut icon" />
2009-07-17 22:56:06 +00:00
<% if (indexBean.allowCSS()) {
2012-07-30 13:15:58 +00:00
%><link rel="icon" href="<%=indexBean.getTheme()%>images/favicon.ico" />
2016-12-02 17:23:02 +00:00
<link href="<%=indexBean.getTheme()%>default.css?<%=net.i2p.CoreVersion.VERSION%>" rel="stylesheet" type="text/css" />
<link href="<%=indexBean.getTheme()%>i2ptunnel.css?<%=net.i2p.CoreVersion.VERSION%>" rel="stylesheet" type="text/css" />
2009-07-17 22:56:06 +00:00
<% }
2009-07-17 12:26:29 +00:00
%>
</head>
<body id="tunnelListPage">
2009-07-17 22:56:06 +00:00
<div id="pageHeader">
</div>
<div id="statusMessagePanel" class="panel">
<div class="header">
2015-09-25 19:55:36 +00:00
<h4><%=intl._t("Status Messages")%></h4>
2009-07-17 22:56:06 +00:00
</div>
<div class="separator">
2009-08-17 20:17:30 +00:00
<hr />
2009-07-17 22:56:06 +00:00
</div>
<textarea id="statusMessages" rows="4" cols="60" readonly="readonly"><jsp:getProperty name="indexBean" property="messages" /></textarea>
<div class="separator">
2009-08-17 20:17:30 +00:00
<hr />
2009-07-17 22:56:06 +00:00
</div>
<div class="footer">
<div class="toolbox">
2015-09-25 19:55:36 +00:00
<a class="control" href="list"><%=intl._t("Refresh")%></a>
2009-07-17 22:56:06 +00:00
</div>
</div>
</div>
2012-10-27 18:51:50 +00:00
<%
if (indexBean.isInitialized()) {
2015-10-17 17:38:57 +00:00
String nextNonce = net.i2p.i2ptunnel.web.IndexBean.getNextNonce();
2009-07-17 22:56:06 +00:00
2012-10-27 18:51:50 +00:00
%>
2009-07-17 22:56:06 +00:00
<div id="globalOperationsPanel" class="panel">
<div class="header"></div>
<div class="footer">
<div class="toolbox">
2015-09-25 19:55:36 +00:00
<a class="control" href="wizard"><%=intl._t("Tunnel Wizard")%></a>
2015-10-17 17:38:57 +00:00
<a class="control" href="list?nonce=<%=nextNonce%>&action=Stop%20all"><%=intl._t("Stop All")%></a>
<a class="control" href="list?nonce=<%=nextNonce%>&action=Start%20all"><%=intl._t("Start All")%></a>
<a class="control" href="list?nonce=<%=nextNonce%>&action=Restart%20all"><%=intl._t("Restart All")%></a>
2012-10-27 18:51:50 +00:00
<%--
//this is really bad because it stops and restarts all tunnels, which is probably not what you want
2015-10-17 17:38:57 +00:00
<a class="control" href="list?nonce=<%=nextNonce%>&action=Reload%20configuration"><%=intl._t("Reload Config")%></a>
2012-10-27 18:51:50 +00:00
--%>
2009-07-17 22:56:06 +00:00
</div>
</div>
</div>
<div id="localServerTunnelList" class="panel">
<div class="header">
2015-09-25 19:55:36 +00:00
<h4><%=intl._t("I2P Hidden Services")%></h4>
2009-07-17 22:56:06 +00:00
</div>
2009-07-17 12:26:29 +00:00
<div class="separator"> </div>
2009-07-17 22:56:06 +00:00
<div class="nameHeaderField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Name")%>:</label>
2009-07-17 22:56:06 +00:00
</div>
<div class="previewHeaderField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Points at")%>:</label>
2009-07-17 22:56:06 +00:00
</div>
<div class="targetHeaderField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Preview")%>:</label>
2009-07-17 22:56:06 +00:00
</div>
<div class="statusHeaderField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Status")%>:</label>
2009-08-17 20:17:30 +00:00
<hr /> </div>
2009-07-17 22:56:06 +00:00
<%
2009-07-17 12:26:29 +00:00
for (int curServer = 0; curServer < indexBean.getTunnelCount(); curServer++) {
if (indexBean.isClient(curServer)) continue;
%>
2009-07-17 22:56:06 +00:00
<div class="nameField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Name")%>:</label>
2013-05-29 12:48:11 +00:00
<span class="text"><a href="edit?tunnel=<%=curServer%>" title="Edit Server Tunnel Settings for <%=indexBean.getTunnelName(curServer)%>"><%=indexBean.getTunnelName(curServer)%></a></span>
2009-07-17 22:56:06 +00:00
</div>
<div class="previewField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Points at")%>:</label>
2009-07-17 22:56:06 +00:00
<span class="text">
<%
2010-12-30 00:36:41 +00:00
if (indexBean.isServerTargetLinkValid(curServer)) {
2013-10-17 13:22:17 +00:00
if (indexBean.isSSLEnabled(curServer)) { %>
<a href="https://<%=indexBean.getServerTarget(curServer)%>/" title="Test HTTPS server, bypassing I2P" target="_top"><%=indexBean.getServerTarget(curServer)%> SSL</a>
<% } else { %>
<a href="http://<%=indexBean.getServerTarget(curServer)%>/" title="Test HTTP server, bypassing I2P" target="_top"><%=indexBean.getServerTarget(curServer)%></a>
2009-07-17 22:56:06 +00:00
<%
2013-10-17 13:22:17 +00:00
}
2009-07-17 12:26:29 +00:00
} else {
2009-07-17 22:56:06 +00:00
%><%=indexBean.getServerTarget(curServer)%>
<%
2013-10-17 13:22:17 +00:00
if (indexBean.isSSLEnabled(curServer)) { %>
SSL
<%
}
2009-07-17 12:26:29 +00:00
}
2009-07-17 22:56:06 +00:00
%></span>
</div>
<div class="targetField rowItem">
<%
2010-01-14 05:45:01 +00:00
if (("httpserver".equals(indexBean.getInternalType(curServer)) || ("httpbidirserver".equals(indexBean.getInternalType(curServer)))) && indexBean.getTunnelStatus(curServer) == IndexBean.RUNNING) {
2015-09-25 19:55:36 +00:00
%><label><%=intl._t("Preview")%>:</label>
<a class="control" title="Test HTTP server through I2P" href="http://<%=indexBean.getDestHashBase32(curServer)%>" target="_top"><%=intl._t("Preview")%></a>
2009-07-17 22:56:06 +00:00
<%
2009-07-17 12:26:29 +00:00
} else if (indexBean.getTunnelStatus(curServer) == IndexBean.RUNNING) {
2015-09-25 19:55:36 +00:00
%><span class="text"><%=intl._t("Base32 Address")%>:<br /><%=indexBean.getDestHashBase32(curServer)%></span>
2009-07-17 22:56:06 +00:00
<%
2009-07-17 12:26:29 +00:00
} else {
2015-09-25 19:55:36 +00:00
%><span class="comment"><%=intl._t("No Preview")%></span>
2009-07-17 22:56:06 +00:00
<%
2009-07-17 12:26:29 +00:00
}
2009-07-17 22:56:06 +00:00
%></div>
<div class="statusField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Status")%>:</label>
2009-07-17 22:56:06 +00:00
<%
2009-07-17 12:26:29 +00:00
switch (indexBean.getTunnelStatus(curServer)) {
case IndexBean.STARTING:
2015-09-25 19:55:36 +00:00
%><div class="statusStarting text"><%=intl._t("Starting...")%></div>
2015-10-17 17:38:57 +00:00
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=nextNonce%>&action=stop&tunnel=<%=curServer%>"><%=intl._t("Stop")%></a>
2009-07-17 22:56:06 +00:00
<%
2009-07-17 12:26:29 +00:00
break;
case IndexBean.RUNNING:
2015-09-25 19:55:36 +00:00
%><div class="statusRunning text"><%=intl._t("Running")%></div>
2015-10-17 17:38:57 +00:00
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=nextNonce%>&action=stop&tunnel=<%=curServer%>"><%=intl._t("Stop")%></a>
2009-07-17 22:56:06 +00:00
<%
2009-07-17 12:26:29 +00:00
break;
case IndexBean.NOT_RUNNING:
2015-09-25 19:55:36 +00:00
%><div class="statusNotRunning text"><%=intl._t("Stopped")%></div>
2015-10-17 17:38:57 +00:00
<a class="control" title="Start this Tunnel" href="list?nonce=<%=nextNonce%>&action=start&tunnel=<%=curServer%>"><%=intl._t("Start")%></a>
2009-07-17 22:56:06 +00:00
<%
2009-07-17 12:26:29 +00:00
break;
}
2009-07-17 22:56:06 +00:00
%></div>
<div class="descriptionField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Description")%>:</label>
2009-07-17 22:56:06 +00:00
<div class="text"><%=indexBean.getTunnelDescription(curServer)%></div>
</div>
<div class="subdivider">
2009-08-17 20:17:30 +00:00
<hr />
2009-07-17 22:56:06 +00:00
</div>
<%
2009-07-17 12:26:29 +00:00
}
%>
2009-07-17 22:56:06 +00:00
<div class="separator">
2009-08-17 20:17:30 +00:00
<hr />
2009-07-17 22:56:06 +00:00
</div>
<div class="footer">
2010-11-19 16:14:14 +00:00
<form id="addNewServerTunnelForm" action="edit">
2009-07-17 22:56:06 +00:00
<div class="toolbox">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("New hidden service")%>:</label>
2009-07-17 22:56:06 +00:00
<select name="type">
<option value="httpserver">HTTP</option>
2015-09-25 19:55:36 +00:00
<option value="server"><%=intl._t("Standard")%></option>
2010-01-14 05:45:01 +00:00
<option value="httpbidirserver">HTTP bidir</option>
2009-07-17 22:56:06 +00:00
<option value="ircserver">IRC</option>
<option value="streamrserver">Streamr</option>
</select>
2015-09-25 19:55:36 +00:00
<input class="control" type="submit" value="<%=intl._t("Create")%>" />
2009-07-17 22:56:06 +00:00
</div>
</form>
</div>
</div>
<div id="localClientTunnelList" class="panel">
<div class="header">
2015-09-25 19:55:36 +00:00
<h4><%=intl._t("I2P Client Tunnels")%></h4>
2009-07-17 22:56:06 +00:00
</div>
2009-07-17 22:21:01 +00:00
<div class="separator"> </div>
2009-07-17 22:56:06 +00:00
<div class="nameHeaderField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Name")%>:</label>
2009-07-17 22:56:06 +00:00
</div>
<div class="portHeaderField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Port")%>:</label>
2009-07-17 22:56:06 +00:00
</div>
<div class="typeHeaderField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Type")%>:</label>
2009-07-17 22:56:06 +00:00
</div>
<div class="interfaceHeaderField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Interface")%>:</label>
2009-07-17 22:56:06 +00:00
</div>
<div class="statusHeaderField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Status")%>:</label>
2009-07-17 22:56:06 +00:00
</div>
<div class="separator">
2009-08-17 20:17:30 +00:00
<hr />
2009-07-17 22:56:06 +00:00
</div>
<%
2009-07-17 12:26:29 +00:00
for (int curClient = 0; curClient < indexBean.getTunnelCount(); curClient++) {
if (!indexBean.isClient(curClient)) continue;
%>
2009-07-17 22:56:06 +00:00
<div class="nameField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Name")%>:</label>
2010-11-19 16:14:14 +00:00
<span class="text"><a href="edit?tunnel=<%=curClient%>" title="Edit Tunnel Settings for <%=indexBean.getTunnelName(curClient)%>"><%=indexBean.getTunnelName(curClient)%></a></span>
2009-07-17 22:56:06 +00:00
</div>
<div class="portField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Port")%>:</label>
2010-12-30 00:36:41 +00:00
<span class="text">
<%
2012-09-26 20:00:59 +00:00
String cPort= indexBean.getClientPort2(curClient);
out.write(cPort);
2014-08-21 12:21:29 +00:00
if (indexBean.isSSLEnabled(curClient))
out.write(" SSL");
2010-12-30 00:36:41 +00:00
%>
</span>
2009-07-17 22:56:06 +00:00
</div>
<div class="typeField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Type")%>:</label>
2009-07-17 22:56:06 +00:00
<span class="text"><%=indexBean.getTunnelType(curClient)%></span>
</div>
<div class="interfaceField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Interface")%>:</label>
2010-12-30 00:36:41 +00:00
<span class="text">
<%
/* should only happen for streamr client */
String cHost= indexBean.getClientInterface(curClient);
2011-02-03 15:45:26 +00:00
if (cHost == null || "".equals(cHost)) {
2010-12-30 00:36:41 +00:00
out.write("<font color=\"red\">");
2015-09-25 19:55:36 +00:00
out.write(intl._t("Host not set"));
2010-12-30 00:36:41 +00:00
out.write("</font>");
} else {
out.write(cHost);
}
%>
</span>
2009-07-17 22:56:06 +00:00
</div>
<div class="statusField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Status")%>:</label>
2009-07-17 22:56:06 +00:00
<%
2009-07-17 12:26:29 +00:00
switch (indexBean.getTunnelStatus(curClient)) {
case IndexBean.STARTING:
2015-09-25 19:55:36 +00:00
%><div class="statusStarting text"><%=intl._t("Starting...")%></div>
2015-10-17 17:38:57 +00:00
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=nextNonce%>&action=stop&tunnel=<%=curClient%>"><%=intl._t("Stop")%></a>
2009-07-17 22:56:06 +00:00
<%
2009-07-17 12:26:29 +00:00
break;
case IndexBean.STANDBY:
2015-09-25 19:55:36 +00:00
%><div class="statusStarting text"><%=intl._t("Standby")%></div>
2015-10-17 17:38:57 +00:00
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=nextNonce%>&action=stop&tunnel=<%=curClient%>"><%=intl._t("Stop")%></a>
2009-07-17 22:56:06 +00:00
<%
2009-07-17 12:26:29 +00:00
break;
case IndexBean.RUNNING:
2015-09-25 19:55:36 +00:00
%><div class="statusRunning text"><%=intl._t("Running")%></div>
2015-10-17 17:38:57 +00:00
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=nextNonce%>&action=stop&tunnel=<%=curClient%>"><%=intl._t("Stop")%></a>
2009-07-17 22:56:06 +00:00
<%
2009-07-17 12:26:29 +00:00
break;
case IndexBean.NOT_RUNNING:
2015-09-25 19:55:36 +00:00
%><div class="statusNotRunning text"><%=intl._t("Stopped")%></div>
2015-10-17 17:38:57 +00:00
<a class="control" title="Start this Tunnel" href="list?nonce=<%=nextNonce%>&action=start&tunnel=<%=curClient%>"><%=intl._t("Start")%></a>
2009-07-17 22:56:06 +00:00
<%
2009-07-17 12:26:29 +00:00
break;
}
2009-07-17 22:56:06 +00:00
%></div>
<div class="destinationField rowItem">
<label>
2010-11-17 15:47:00 +00:00
<% if ("httpclient".equals(indexBean.getInternalType(curClient)) || "connectclient".equals(indexBean.getInternalType(curClient)) ||
"sockstunnel".equals(indexBean.getInternalType(curClient)) || "socksirctunnel".equals(indexBean.getInternalType(curClient))) { %>
2015-09-25 19:55:36 +00:00
<%=intl._t("Outproxy")%>:
2009-07-17 22:56:06 +00:00
<% } else { %>
2015-09-25 19:55:36 +00:00
<%=intl._t("Destination")%>:
2009-07-17 22:56:06 +00:00
<% } %>
</label>
2010-11-17 15:47:00 +00:00
<div class="text">
2014-01-25 17:56:35 +00:00
<%
if (indexBean.getIsUsingOutproxyPlugin(curClient)) {
2015-09-25 19:55:36 +00:00
%><%=intl._t("internal plugin")%><%
2010-11-17 15:47:00 +00:00
} else {
2014-01-25 17:56:35 +00:00
String cdest = indexBean.getClientDestination(curClient);
if (cdest.length() > 70) { // Probably a B64 (a B32 is 60 chars) so truncate
%><%=cdest.substring(0, 45)%>…<%=cdest.substring(cdest.length() - 15, cdest.length())%><%
} else if (cdest.length() > 0) {
%><%=cdest%><%
} else {
2015-09-25 19:55:36 +00:00
%><i><%=intl._t("none")%></i><%
2014-01-25 17:56:35 +00:00
}
2010-11-17 15:47:00 +00:00
} %>
</div>
2009-07-17 22:56:06 +00:00
</div>
2014-01-25 17:56:35 +00:00
<% /* TODO SSL outproxy for httpclient if plugin not present */ %>
2009-07-17 22:56:06 +00:00
<div class="descriptionField rowItem">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("Description")%>:</label>
2009-07-17 22:56:06 +00:00
<div class="text"><%=indexBean.getTunnelDescription(curClient)%></div>
</div>
<div class="subdivider">
2009-08-17 20:17:30 +00:00
<hr />
2009-07-17 22:56:06 +00:00
</div>
<%
2009-07-17 12:26:29 +00:00
}
2009-07-17 22:56:06 +00:00
%>
<div class="separator">
2009-08-17 20:17:30 +00:00
<hr />
2009-07-17 22:56:06 +00:00
</div>
<div class="footer">
2010-11-19 16:14:14 +00:00
<form id="addNewClientTunnelForm" action="edit">
2009-07-17 22:56:06 +00:00
<div class="toolbox">
2015-09-25 19:55:36 +00:00
<label><%=intl._t("New client tunnel")%>:</label>
2009-07-17 22:56:06 +00:00
<select name="type">
2015-09-25 19:55:36 +00:00
<option value="client"><%=intl._t("Standard")%></option>
2014-01-25 17:56:35 +00:00
<option value="httpclient">HTTP/CONNECT</option>
2009-07-17 22:56:06 +00:00
<option value="ircclient">IRC</option>
<option value="sockstunnel">SOCKS 4/4a/5</option>
2010-03-05 14:04:32 +00:00
<option value="socksirctunnel">SOCKS IRC</option>
2009-07-17 22:56:06 +00:00
<option value="connectclient">CONNECT</option>
<option value="streamrclient">Streamr</option>
</select>
2015-09-25 19:55:36 +00:00
<input class="control" type="submit" value="<%=intl._t("Create")%>" />
2009-07-17 22:56:06 +00:00
</div>
</form>
2009-07-17 22:21:01 +00:00
</div>
2009-07-17 12:26:29 +00:00
</div>
2012-10-27 18:51:50 +00:00
<%
} // isInitialized()
%>
2009-07-17 22:56:06 +00:00
<div id="pageFooter">
</div>
2009-07-17 12:26:29 +00:00
</body>
</html>