2019-04-11 14:00:42 +00:00
<%
2014-10-13 16:46:58 +00:00
String tunnelTypeName;
String tunnelType;
2005-11-12 02:38:55 +00:00
if (curTunnel >= 0) {
tunnelTypeName = editBean.getTunnelType(curTunnel);
tunnelType = editBean.getInternalType(curTunnel);
2016-07-11 06:54:26 +00:00
%><h2><%=intl._t("Edit Server Settings")%> (<%=editBean.getTunnelName(curTunnel)%>)</h2><%
2005-11-12 02:38:55 +00:00
} else {
tunnelTypeName = editBean.getTypeName(request.getParameter("type"));
2014-07-26 09:32:26 +00:00
tunnelType = net.i2p.data.DataHelper.stripHTML(request.getParameter("type"));
2016-07-11 06:54:26 +00:00
%><h2><%=intl._t("New Server Settings")%></h2><%
2005-11-12 02:38:55 +00:00
} %>
2014-07-26 09:32:26 +00:00
<input type="hidden" name="tunnel" value="<%=curTunnel%>" />
2015-10-17 17:38:57 +00:00
<input type="hidden" name="nonce" value="<%=net.i2p.i2ptunnel.web.IndexBean.getNextNonce()%>" />
2005-11-12 02:38:55 +00:00
<input type="hidden" name="type" value="<%=tunnelType%>" />
2019-04-11 14:00:42 +00:00
<%
2015-01-03 13:32:24 +00:00
// these are four keys that are generated automatically on first save,
// and we want to persist in i2ptunnel.config, but don't want to
// show clogging up the custom options form.
String key = editBean.getKey1(curTunnel);
if (key != null && key.length() > 0) { %>
<input type="hidden" name="key1" value="<%=key%>" />
2019-04-11 14:00:42 +00:00
<% }
2015-01-03 13:32:24 +00:00
key = editBean.getKey2(curTunnel);
if (key != null && key.length() > 0) { %>
<input type="hidden" name="key2" value="<%=key%>" />
2019-04-11 14:00:42 +00:00
<% }
2015-01-03 13:32:24 +00:00
key = editBean.getKey3(curTunnel);
if (key != null && key.length() > 0) { %>
<input type="hidden" name="key3" value="<%=key%>" />
2019-04-11 14:00:42 +00:00
<% }
2015-01-03 13:32:24 +00:00
key = editBean.getKey4(curTunnel);
if (key != null && key.length() > 0) { %>
<input type="hidden" name="key4" value="<%=key%>" />
2019-04-11 14:00:42 +00:00
<% } %>
2013-04-17 17:04:34 +00:00
<input type="submit" class="default" name="action" value="Save changes" />
2016-07-11 06:54:26 +00:00
<table id="serverTunnelEdit" class="tunnelConfig">
<tr>
<th>
<%=intl._t("Name")%>
2019-04-11 14:00:42 +00:00
</th><th>
2016-07-11 06:54:26 +00:00
<%=intl._t("Type")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td>
2017-06-03 14:10:08 +00:00
<input type="text" size="30" maxlength="50" name="name" title="<%=intl._t("Name of tunnel to be displayed on Tunnel Manager home page and the router console sidebar")%>" value="<%=editBean.getTunnelName(curTunnel)%>" class="freetext tunnelName" />
2019-04-11 14:00:42 +00:00
</td><td>
2016-07-11 06:54:26 +00:00
<%=tunnelTypeName%>
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<th>
<%=intl._t("Description")%>
2019-04-11 14:00:42 +00:00
</th><th>
2016-07-11 06:54:26 +00:00
<%=intl._t("Auto Start Tunnel")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td>
2017-10-25 09:47:34 +00:00
<input type="text" size="60" maxlength="80" name="nofilter_description" title="<%=intl._t("Description of tunnel to be displayed on Tunnel Manager home page")%>" value="<%=editBean.getTunnelDescription(curTunnel)%>" class="freetext tunnelDescriptionText" />
2019-04-11 14:00:42 +00:00
</td><td>
2017-06-03 14:10:08 +00:00
<label title="<%=intl._t("Enable this option to ensure this service is available when the router starts")%>"><input value="1" type="checkbox" name="startOnLoad"<%=(editBean.startAutomatically(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
2017-05-14 05:30:13 +00:00
<%=intl._t("Automatically start tunnel when router starts")%></label>
2016-07-11 06:54:26 +00:00
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<th colspan="2">
2009-02-23 05:09:44 +00:00
<% if ("streamrserver".equals(tunnelType)) { %>
2016-07-11 06:54:26 +00:00
<%=intl._t("Access Point")%>
2009-02-23 05:09:44 +00:00
<% } else { %>
2016-07-11 06:54:26 +00:00
<%=intl._t("Target")%>
2009-02-23 05:09:44 +00:00
<% } %>
2016-07-11 06:54:26 +00:00
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2010-12-30 00:36:41 +00:00
<% if (!"streamrserver".equals(tunnelType)) { %>
2016-07-11 06:54:26 +00:00
<td>
<b><%=intl._t("Host")%>:</b>
2017-06-03 14:10:08 +00:00
<input type="text" size="20" name="targetHost" title="<%=intl._t("Hostname or IP address of the target server")%>" value="<%=editBean.getTargetHost(curTunnel)%>" class="freetext host" />
2016-07-11 06:54:26 +00:00
</td>
2019-04-11 14:00:42 +00:00
<% } /* !streamrserver */ %>
2016-07-11 06:54:26 +00:00
<td>
<b><%=intl._t("Port")%>:</b>
2008-11-15 19:00:08 +00:00
<% String value = editBean.getTargetPort(curTunnel);
2010-01-01 17:33:55 +00:00
if (value == null || "".equals(value.trim())) {
2016-07-11 06:54:26 +00:00
out.write(" <span class=\"required\"><font color=\"red\">(");
2015-09-25 19:55:36 +00:00
out.write(intl._t("required"));
2016-07-11 06:54:26 +00:00
out.write(")</font></span>");
2017-02-10 16:41:49 +00:00
}
2019-04-11 14:00:42 +00:00
%>
2017-06-03 14:10:08 +00:00
<input type="text" size="6" maxlength="5" id="targetPort" name="targetPort" title="<%=intl._t("Specify the port the server is running on")%>" value="<%=editBean.getTargetPort(curTunnel)%>" class="freetext port" placeholder="required" />
2019-04-11 14:00:42 +00:00
<% if (!"streamrserver".equals(tunnelType)) { %>
2017-06-03 14:10:08 +00:00
<label title="<%=intl._t("To avoid traffic sniffing if connecting to a remote server, you can enable an SSL connection. Note that the target server must be configured to accept SSL connections.")%>"><input value="1" type="checkbox" name="useSSL"<%=(editBean.isSSLEnabled(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
2017-05-14 05:30:13 +00:00
<%=intl._t("Use SSL to connect to target")%></label>
2019-04-11 14:00:42 +00:00
<% } /* !streamrserver */ %>
2016-07-11 06:54:26 +00:00
</td>
2019-04-11 14:00:42 +00:00
<% if ("httpbidirserver".equals(tunnelType)) { %>
</tr><tr>
2016-07-11 06:54:26 +00:00
<th colspan="2">
<%=intl._t("Access Point")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td>
<b><%=intl._t("Port")%>:</b>
2017-02-10 16:41:49 +00:00
2019-04-11 14:00:42 +00:00
<% String value4 = editBean.getClientPort(curTunnel);
2010-01-14 05:45:01 +00:00
if (value4 == null || "".equals(value4.trim())) {
2016-07-11 06:54:26 +00:00
out.write(" <span class=\"required\"><font color=\"red\">(");
2015-09-25 19:55:36 +00:00
out.write(intl._t("required"));
2016-07-11 06:54:26 +00:00
out.write(")</font></span>");
2010-01-14 05:45:01 +00:00
}
2019-04-11 14:00:42 +00:00
%>
2017-06-03 14:10:08 +00:00
<input type="text" size="6" maxlength="5" name="port" title="<%=intl._t("Port required to access service (this can be a different port to the port the service is hosted on)")%>" value="<%=editBean.getClientPort(curTunnel)%>" class="freetext port" placeholder="required" />
2016-07-11 06:54:26 +00:00
</td>
2019-04-11 14:00:42 +00:00
<% } /* httpbidirserver */
if ("httpbidirserver".equals(tunnelType) || "streamrserver".equals(tunnelType)) {
%>
2016-07-11 06:54:26 +00:00
<td>
2017-01-07 16:24:34 +00:00
<b><%=intl._t("Reachable by")%>:</b>
2016-07-11 06:54:26 +00:00
2017-06-03 14:10:08 +00:00
<select id="reachableBy" name="reachableBy" title="<%=intl._t("Listening interface (IP address) for client access (normally 127.0.0.1)")%>" class="selectbox">
2019-04-11 14:00:42 +00:00
<%
2010-12-30 00:36:41 +00:00
String clientInterface = editBean.getClientInterface(curTunnel);
for (String ifc : editBean.interfaceSet()) {
out.write("<option value=\"");
out.write(ifc);
out.write('\"');
if (ifc.equals(clientInterface))
out.write(" selected=\"selected\"");
out.write('>');
out.write(ifc);
out.write("</option>\n");
}
2019-04-11 14:00:42 +00:00
%>
2016-07-11 06:54:26 +00:00
</select>
</td>
2010-12-30 00:36:41 +00:00
<% } /* httpbidirserver || streamrserver */ %>
2016-07-11 06:54:26 +00:00
</tr>
2019-04-11 14:00:42 +00:00
<% if (("httpserver".equals(tunnelType)) || ("httpbidirserver".equals(tunnelType))) {
%>
2016-07-11 06:54:26 +00:00
<tr>
<th>
<%=intl._t("Website Hostname")%>
</th>
<th></th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2017-02-10 16:41:49 +00:00
<td colspan="2">
2017-06-03 14:10:08 +00:00
<input type="text" size="20" id="websiteName" name="spoofedHost" title="<%=intl._t("Website Hostname e.g. mysite.i2p")%>" value="<%=editBean.getSpoofedHost(curTunnel)%>" class="freetext" />
2016-07-11 06:54:26 +00:00
<%=intl._t("(leave blank for outproxies)")%>
</td>
</tr>
2005-11-12 02:38:55 +00:00
<% }
2016-07-11 06:54:26 +00:00
%>
<tr>
2017-06-03 14:10:08 +00:00
<th>
<%=intl._t("Local destination")%>
2019-04-11 14:00:42 +00:00
</th><th>
2016-07-11 06:54:26 +00:00
<%=intl._t("Private key file")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2017-06-03 14:10:08 +00:00
<td>
2019-05-24 19:36:11 +00:00
<div class="displayText" title="<%=intl._t("Read Only: Local Destination (if known)")%>" tabindex="0" onblur="resetScrollLeft(this)"><%=editBean.getDestinationBase64(curTunnel)%></div>
2019-04-11 14:00:42 +00:00
</td><td>
2010-01-14 05:45:01 +00:00
<% String value3 = editBean.getPrivateKeyFile(curTunnel);
if (value3 == null || "".equals(value3.trim())) {
2016-07-11 06:54:26 +00:00
out.write(" <span class=\"required\"><font color=\"red\">(");
2015-09-25 19:55:36 +00:00
out.write(intl._t("required"));
2016-07-11 06:54:26 +00:00
out.write(")</font></span>");
2010-01-01 17:33:55 +00:00
}
2008-11-15 19:00:08 +00:00
%>
2017-06-03 14:10:08 +00:00
<input type="text" size="30" id="privKeyFile" name="privKeyFile" title="<%=intl._t("Path to Private Key File")%>" value="<%=editBean.getPrivateKeyFile(curTunnel)%>" class="freetext" placeholder="required" />
2016-07-11 06:54:26 +00:00
</td>
</tr>
2016-04-24 18:10:10 +00:00
<%
/******
2019-04-11 14:00:42 +00:00
if (("httpserver".equals(tunnelType)) || ("httpbidirserver".equals(tunnelType))) {
2016-02-26 15:25:01 +00:00
String sig = editBean.getNameSignature(curTunnel);
if (sig.length() > 0) {
2010-10-02 17:20:39 +00:00
%><div id="sigField" class="rowItem">
2015-09-25 19:55:36 +00:00
<%=intl._t("Hostname Signature")%>
2017-06-03 14:10:08 +00:00
<input type="text" size="30" readonly="readonly" title="<%=intl._t("Use to prove that the website name is for this destination")%>" value="<%=sig%>" wrap="off" class="freetext" />
2016-02-26 15:25:01 +00:00
</div>
<%
} // sig
} // type
2016-04-24 18:10:10 +00:00
****/
2016-02-26 15:25:01 +00:00
String b64 = editBean.getDestinationBase64(curTunnel);
2018-03-14 14:09:41 +00:00
net.i2p.util.PortMapper pm = net.i2p.I2PAppContext.getGlobalContext().portMapper();
boolean hasImagegen = pm.getPort(net.i2p.util.PortMapper.SVC_IMAGEGEN) > 0;
boolean hasSusiDNS = pm.getPort(net.i2p.util.PortMapper.SVC_SUSIDNS) > 0;
2016-02-26 15:25:01 +00:00
if (!"".equals(b64)) {
2019-04-11 14:00:42 +00:00
%>
2016-07-11 06:54:26 +00:00
<tr>
2019-04-11 14:00:42 +00:00
<%
2016-02-26 15:25:01 +00:00
b64 = b64.replace("=", "%3d");
String name = editBean.getSpoofedHost(curTunnel);
if (name == null || name.equals(""))
name = editBean.getTunnelName(curTunnel);
2016-09-24 15:46:57 +00:00
// mysite.i2p is set in the installed i2ptunnel.config
if (name != null && !name.equals("") && !name.equals("mysite.i2p") && !name.contains(" ") && name.endsWith(".i2p")) {
2019-04-11 14:00:42 +00:00
%>
2016-07-11 06:54:26 +00:00
<td class="buttons" colspan="2">
2019-04-11 14:00:42 +00:00
<%
2018-03-14 14:09:41 +00:00
if (hasImagegen) {
2019-04-11 14:00:42 +00:00
%>
2017-06-03 14:10:08 +00:00
<a class="control" title="<%=intl._t("Generate a QR Code for this domain")%>" href="/imagegen/qr?s=320&t=<%=name%>&c=http%3a%2f%2f<%=name%>%2f%3fi2paddresshelper%3d<%=b64%>" target="_top"><%=intl._t("Generate QR Code")%></a>
2019-04-11 14:00:42 +00:00
<%
2018-03-14 14:09:41 +00:00
}
if (hasSusiDNS) {
2019-04-11 14:00:42 +00:00
%>
2017-06-03 14:10:08 +00:00
<a class="control" title="<%=intl._t("Add to Private addressbook")%>" href="/susidns/addressbook.jsp?book=private&hostname=<%=name%>&destination=<%=b64%>#add"><%=intl._t("Add to local addressbook")%></a>
2019-04-11 14:00:42 +00:00
<%
2018-03-14 14:09:41 +00:00
}
2019-04-11 14:00:42 +00:00
%>
2017-06-03 14:10:08 +00:00
<a class="control" title="<%=intl._t("Register, unregister or change details for hostname")%>" href="register?tunnel=<%=curTunnel%>"><%=intl._t("Registration Authentication")%></a>
2019-04-11 14:00:42 +00:00
<%
2018-05-05 14:09:47 +00:00
if (("httpserver".equals(tunnelType)) || ("httpbidirserver".equals(tunnelType))) {
2019-04-11 14:00:42 +00:00
%>
2018-05-05 14:09:47 +00:00
<a class="control" title="<%=intl._t("HTTPS configuration")%>" href="ssl?tunnel=<%=curTunnel%>"><%=intl._t("SSL Wizard")%></a>
2019-04-11 14:00:42 +00:00
<%
2018-05-05 14:09:47 +00:00
}
2019-04-11 14:00:42 +00:00
%>
2016-07-11 06:54:26 +00:00
</td>
2019-04-11 14:00:42 +00:00
<%
2016-02-26 15:25:01 +00:00
} else {
2019-04-11 14:00:42 +00:00
%>
2016-07-11 06:54:26 +00:00
<td class="infohelp" colspan="2">
2017-06-03 14:10:08 +00:00
<%=intl._t("Note: In order to enable QR code generation or registration authentication, configure the Website Hostname field (for websites) or the Name field (everything else) above with an .i2p suffixed hostname e.g. mynewserver.i2p")%>
2016-07-11 06:54:26 +00:00
</td>
2019-04-11 14:00:42 +00:00
<%
2016-02-26 15:25:01 +00:00
} // name
2019-04-11 14:00:42 +00:00
%>
2016-07-11 06:54:26 +00:00
</tr>
2019-04-11 14:00:42 +00:00
<%
2016-02-26 15:25:01 +00:00
} // b64
2010-10-02 17:20:39 +00:00
2019-04-11 14:00:42 +00:00
%>
2016-07-11 06:54:26 +00:00
</table>
2005-11-12 02:38:55 +00:00
2017-06-04 04:59:26 +00:00
<h3><%=intl._t("Advanced networking options")%></h3>
2005-11-12 02:38:55 +00:00
2016-07-11 06:54:26 +00:00
<table id="#advancedServerTunnelOptions" class="tunnelConfig">
<tr>
<th colspan="2">
<%=intl._t("Tunnel Options")%>
</th>
</tr>
2019-04-11 14:00:42 +00:00
<% if (editBean.isAdvanced()) {
2018-01-06 20:19:55 +00:00
%><tr>
<th colspan="2">
<%=intl._t("Inbound")%>
</th>
</tr><%
} // isAdvanced()
2019-04-11 14:00:42 +00:00
%>
2018-01-06 20:19:55 +00:00
2016-07-11 06:54:26 +00:00
<tr>
<td>
<b><%=intl._t("Length")%></b>
2019-04-11 14:00:42 +00:00
</td><td>
2016-07-11 06:54:26 +00:00
<b><%=intl._t("Variance")%></b>
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td>
2017-06-03 14:10:08 +00:00
<select id="tunnelDepth" name="tunnelDepth" title="<%=intl._t("Length of each Tunnel")%>" class="selectbox">
2013-05-29 16:28:28 +00:00
<% int tunnelDepth = editBean.getTunnelDepth(curTunnel, 3);
2015-09-25 19:55:36 +00:00
%><option value="0"<%=(tunnelDepth == 0 ? " selected=\"selected\"" : "") %>><%=intl._t("0 hop tunnel (no anonymity)")%></option>
<option value="1"<%=(tunnelDepth == 1 ? " selected=\"selected\"" : "") %>><%=intl._t("1 hop tunnel (low anonymity)")%></option>
<option value="2"<%=(tunnelDepth == 2 ? " selected=\"selected\"" : "") %>><%=intl._t("2 hop tunnel (medium anonymity)")%></option>
<option value="3"<%=(tunnelDepth == 3 ? " selected=\"selected\"" : "") %>><%=intl._t("3 hop tunnel (high anonymity)")%></option>
2019-04-11 14:00:42 +00:00
<% if (editBean.isAdvanced()) {
2015-11-05 20:24:12 +00:00
%><option value="4"<%=(tunnelDepth == 4 ? " selected=\"selected\"" : "") %>>4 hop tunnel</option>
<option value="5"<%=(tunnelDepth == 5 ? " selected=\"selected\"" : "") %>>5 hop tunnel</option>
<option value="6"<%=(tunnelDepth == 6 ? " selected=\"selected\"" : "") %>>6 hop tunnel</option>
<option value="7"<%=(tunnelDepth == 7 ? " selected=\"selected\"" : "") %>>7 hop tunnel</option>
2019-04-11 14:00:42 +00:00
<% } else if (tunnelDepth > 3) {
2015-09-25 19:55:36 +00:00
%> <option value="<%=tunnelDepth%>" selected="selected"><%=tunnelDepth%> <%=intl._t("hop tunnel (very poor performance)")%></option>
2019-04-11 14:00:42 +00:00
<% }
2005-11-12 02:38:55 +00:00
%></select>
2019-04-11 14:00:42 +00:00
</td><td>
2017-06-03 14:10:08 +00:00
<select id="tunnelVariance" name="tunnelVariance" title="<%=intl._t("Level of Randomization for Tunnel Depth")%>" class="selectbox">
2009-01-20 17:24:28 +00:00
<% int tunnelVariance = editBean.getTunnelVariance(curTunnel, 0);
2016-09-10 16:26:29 +00:00
%><option value="0"<%=(tunnelVariance == 0 ? " selected=\"selected\"" : "") %>><%=intl._t("0 hop variance (no randomization, consistent performance)")%></option>
<option value="1"<%=(tunnelVariance == 1 ? " selected=\"selected\"" : "") %>><%=intl._t("+ 0-1 hop variance (medium additive randomization, subtractive performance)")%></option>
<option value="2"<%=(tunnelVariance == 2 ? " selected=\"selected\"" : "") %>><%=intl._t("+ 0-2 hop variance (high additive randomization, subtractive performance)")%></option>
<option value="-1"<%=(tunnelVariance == -1 ? " selected=\"selected\"" : "") %>><%=intl._t("+/- 0-1 hop variance (standard randomization, standard performance)")%></option>
2015-09-25 19:55:36 +00:00
<option value="-2"<%=(tunnelVariance == -2 ? " selected=\"selected\"" : "") %>><%=intl._t("+/- 0-2 hop variance (not recommended)")%></option>
2019-04-11 14:00:42 +00:00
<% if (tunnelVariance > 2 || tunnelVariance < -2) {
2015-09-25 19:55:36 +00:00
%> <option value="<%=tunnelVariance%>" selected="selected"><%= (tunnelVariance > 2 ? "+ " : "+/- ") %>0-<%=tunnelVariance%> <%=intl._t("hop variance")%></option>
2019-04-11 14:00:42 +00:00
<% }
2016-07-11 06:54:26 +00:00
%></select>
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td>
<b><%=intl._t("Count")%></b>
2019-04-11 14:00:42 +00:00
</td><td>
2016-07-11 06:54:26 +00:00
<b><%=intl._t("Backup Count")%></b>
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td>
2017-06-03 14:10:08 +00:00
<select id="tunnelQuantity" name="tunnelQuantity" title="<%=intl._t("Number of Tunnels in Group")%>" class="selectbox">
2018-01-06 20:19:55 +00:00
<%=editBean.getQuantityOptions(curTunnel, editBean.isAdvanced() ? 1 : 0)%>
2016-07-11 06:54:26 +00:00
</select>
2019-04-11 14:00:42 +00:00
</td><td>
2017-06-03 14:10:08 +00:00
<select id="tunnelBackupQuantity" name="tunnelBackupQuantity" title="<%=intl._t("Number of Reserve Tunnels")%>" class="selectbox">
2019-04-11 14:00:42 +00:00
<% int tunnelBackupQuantity = editBean.getTunnelBackupQuantity(curTunnel, 0);
2018-01-06 20:19:55 +00:00
if (editBean.isAdvanced()) {
// TODO ngettext
%><option value="0"<%=(tunnelBackupQuantity == 0 ? " selected=\"selected\"" : "") %>>0 <%=intl._t("backup tunnels")%></option>
<option value="1"<%=(tunnelBackupQuantity == 1 ? " selected=\"selected\"" : "") %>>1 <%=intl._t("backup tunnels")%></option>
<option value="2"<%=(tunnelBackupQuantity == 2 ? " selected=\"selected\"" : "") %>>2 <%=intl._t("backup tunnels")%></option>
<option value="3"<%=(tunnelBackupQuantity == 3 ? " selected=\"selected\"" : "") %>>3 <%=intl._t("backup tunnels")%></option>
2019-04-11 14:00:42 +00:00
<%
2018-01-06 20:19:55 +00:00
} else {
2015-09-25 19:55:36 +00:00
%><option value="0"<%=(tunnelBackupQuantity == 0 ? " selected=\"selected\"" : "") %>><%=intl._t("0 backup tunnels (0 redundancy, no added resource usage)")%></option>
<option value="1"<%=(tunnelBackupQuantity == 1 ? " selected=\"selected\"" : "") %>><%=intl._t("1 backup tunnel each direction (low redundancy, low resource usage)")%></option>
<option value="2"<%=(tunnelBackupQuantity == 2 ? " selected=\"selected\"" : "") %>><%=intl._t("2 backup tunnels each direction (medium redundancy, medium resource usage)")%></option>
<option value="3"<%=(tunnelBackupQuantity == 3 ? " selected=\"selected\"" : "") %>><%=intl._t("3 backup tunnels each direction (high redundancy, high resource usage)")%></option>
2019-04-11 14:00:42 +00:00
<% } // isAdvanced()
2018-01-06 20:19:55 +00:00
if (tunnelBackupQuantity > 3) {
2015-09-25 19:55:36 +00:00
%> <option value="<%=tunnelBackupQuantity%>" selected="selected"><%=tunnelBackupQuantity%> <%=intl._t("backup tunnels")%></option>
2019-04-11 14:00:42 +00:00
<% }
2016-07-11 06:54:26 +00:00
%></select>
</td>
</tr>
2017-02-10 16:41:49 +00:00
2019-04-11 14:00:42 +00:00
<% if (editBean.isAdvanced()) {
2018-01-06 20:19:55 +00:00
// repeat four options above for outbound
%><tr>
<th colspan="2">
<%=intl._t("Outbound")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2018-01-06 20:19:55 +00:00
<td>
<b><%=intl._t("Length")%></b>
2019-04-11 14:00:42 +00:00
</td><td>
2018-01-06 20:19:55 +00:00
<b><%=intl._t("Variance")%></b>
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2018-01-06 20:19:55 +00:00
<td>
<select id="tunnelDepthOut" name="tunnelDepthOut" title="<%=intl._t("Length of each Tunnel")%>" class="selectbox">
<% int tunnelDepthOut = editBean.getTunnelDepthOut(curTunnel, 3);
%><option value="0"<%=(tunnelDepthOut == 0 ? " selected=\"selected\"" : "") %>><%=intl._t("0 hop tunnel (no anonymity)")%></option>
<option value="1"<%=(tunnelDepthOut == 1 ? " selected=\"selected\"" : "") %>><%=intl._t("1 hop tunnel (low anonymity)")%></option>
<option value="2"<%=(tunnelDepthOut == 2 ? " selected=\"selected\"" : "") %>><%=intl._t("2 hop tunnel (medium anonymity)")%></option>
<option value="3"<%=(tunnelDepthOut == 3 ? " selected=\"selected\"" : "") %>><%=intl._t("3 hop tunnel (high anonymity)")%></option>
<option value="4"<%=(tunnelDepthOut == 4 ? " selected=\"selected\"" : "") %>>4 hop tunnel</option>
<option value="5"<%=(tunnelDepthOut == 5 ? " selected=\"selected\"" : "") %>>5 hop tunnel</option>
<option value="6"<%=(tunnelDepthOut == 6 ? " selected=\"selected\"" : "") %>>6 hop tunnel</option>
<option value="7"<%=(tunnelDepthOut == 7 ? " selected=\"selected\"" : "") %>>7 hop tunnel</option>
</select>
2019-04-11 14:00:42 +00:00
</td><td>
2018-01-06 20:19:55 +00:00
<select id="tunnelVarianceOut" name="tunnelVarianceOut" title="<%=intl._t("Level of Randomization for Tunnel Depth")%>" class="selectbox">
2019-04-11 14:00:42 +00:00
<% int tunnelVarianceOut = editBean.getTunnelVarianceOut(curTunnel, 0);
2018-01-06 20:19:55 +00:00
%><option value="0"<%=(tunnelVarianceOut == 0 ? " selected=\"selected\"" : "") %>><%=intl._t("0 hop variance (no randomization, consistent performance)")%></option>
<option value="1"<%=(tunnelVarianceOut == 1 ? " selected=\"selected\"" : "") %>><%=intl._t("+ 0-1 hop variance (medium additive randomization, subtractive performance)")%></option>
<option value="2"<%=(tunnelVarianceOut == 2 ? " selected=\"selected\"" : "") %>><%=intl._t("+ 0-2 hop variance (high additive randomization, subtractive performance)")%></option>
<option value="-1"<%=(tunnelVarianceOut == -1 ? " selected=\"selected\"" : "") %>><%=intl._t("+/- 0-1 hop variance (standard randomization, standard performance)")%></option>
<option value="-2"<%=(tunnelVarianceOut == -2 ? " selected=\"selected\"" : "") %>><%=intl._t("+/- 0-2 hop variance (not recommended)")%></option>
2019-04-11 14:00:42 +00:00
<% if (tunnelVarianceOut > 2 || tunnelVarianceOut < -2) {
2018-01-06 20:19:55 +00:00
%> <option value="<%=tunnelVarianceOut%>" selected="selected"><%= (tunnelVarianceOut > 2 ? "+ " : "+/- ") %>0-<%=tunnelVarianceOut%> <%=intl._t("hop variance")%></option>
2019-04-11 14:00:42 +00:00
<% }
2018-01-06 20:19:55 +00:00
%></select>
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2018-01-06 20:19:55 +00:00
<td>
<b><%=intl._t("Count")%></b>
2019-04-11 14:00:42 +00:00
</td><td>
2018-01-06 20:19:55 +00:00
<b><%=intl._t("Backup Count")%></b>
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2018-01-06 20:19:55 +00:00
<td>
<select id="tunnelQuantityOut" name="tunnelQuantityOut" title="<%=intl._t("Number of Tunnels in Group")%>" class="selectbox">
<%=editBean.getQuantityOptions(curTunnel, 2)%>
</select>
2019-04-11 14:00:42 +00:00
</td><td>
2018-01-06 20:19:55 +00:00
<select id="tunnelBackupQuantityOut" name="tunnelBackupQuantityOut" title="<%=intl._t("Number of Reserve Tunnels")%>" class="selectbox">
2019-04-11 14:00:42 +00:00
<% int tunnelBackupQuantityOut = editBean.getTunnelBackupQuantityOut(curTunnel, 0);
2018-01-06 20:19:55 +00:00
// TODO ngettext
%><option value="0"<%=(tunnelBackupQuantityOut == 0 ? " selected=\"selected\"" : "") %>>0 <%=intl._t("backup tunnels")%></option>
<option value="1"<%=(tunnelBackupQuantityOut == 1 ? " selected=\"selected\"" : "") %>>1 <%=intl._t("backup tunnels")%></option>
<option value="2"<%=(tunnelBackupQuantityOut == 2 ? " selected=\"selected\"" : "") %>>2 <%=intl._t("backup tunnels")%></option>
<option value="3"<%=(tunnelBackupQuantityOut == 3 ? " selected=\"selected\"" : "") %>>3 <%=intl._t("backup tunnels")%></option>
2019-04-11 14:00:42 +00:00
<% if (tunnelBackupQuantityOut > 3) {
2018-01-06 20:19:55 +00:00
%> <option value="<%=tunnelBackupQuantityOut%>" selected="selected"><%=tunnelBackupQuantityOut%> <%=intl._t("backup tunnels")%></option>
2019-04-11 14:00:42 +00:00
<% }
2018-01-06 20:19:55 +00:00
%></select>
</td>
</tr>
2019-04-11 14:00:42 +00:00
<%
2018-01-06 20:19:55 +00:00
} // isAdvanced() End outbound config section
2016-07-11 06:54:26 +00:00
2019-04-11 14:00:42 +00:00
if (!"streamrserver".equals(tunnelType)) {
%>
2016-07-11 06:54:26 +00:00
<tr>
<th colspan="2">
<%=intl._t("Profile")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td colspan="2">
2017-06-03 14:10:08 +00:00
<select id="profile" name="profile" title="<%=intl._t("Connection Profile")%>" class="selectbox">
2010-06-26 04:11:02 +00:00
<% boolean interactiveProfile = editBean.isInteractive(curTunnel);
2015-09-25 19:55:36 +00:00
%><option <%=(interactiveProfile == true ? "selected=\"selected\" " : "")%>value="interactive"><%=intl._t("interactive connection")%> </option>
<option <%=(interactiveProfile == false ? "selected=\"selected\" " : "")%>value="bulk"><%=intl._t("bulk connection (downloads/websites/BT)")%> </option>
2016-07-11 06:54:26 +00:00
</select>
</td>
</tr>
2019-04-11 20:16:44 +00:00
<%
} /* !streamrserver */
if (!editBean.isRouterContext()) {
%>
2016-07-11 06:54:26 +00:00
<tr>
<th colspan="2">
<%=intl._t("Router I2CP Address")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td>
<b><%=intl._t("Host")%>:</b>
2019-04-11 20:16:44 +00:00
<input type="text" id="clientHost" name="clientHost" size="20" title="<%=intl._t("I2CP Hostname or IP")%>" value="<%=editBean.getI2CPHost(curTunnel)%>" class="freetext" />
2019-04-11 14:00:42 +00:00
</td><td>
2016-07-11 06:54:26 +00:00
<b><%=intl._t("Port")%>:</b>
2019-04-11 20:16:44 +00:00
<input type="text" id="clientPort" name="clientport" size="20" title="<%=intl._t("I2CP Port Number")%>" value="<%=editBean.getI2CPPort(curTunnel)%>" class="freetext" />
2016-07-11 06:54:26 +00:00
</td>
2019-04-11 15:59:11 +00:00
</tr>
<%
2019-04-11 20:16:44 +00:00
} // !isRouterContext
2019-04-11 15:59:11 +00:00
// TODO, encrypted + offline is unimplemented
if (!editBean.getIsOfflineKeys(curTunnel)) {
%>
<tr>
2016-07-11 06:54:26 +00:00
<th colspan="2">
<%=intl._t("Encrypt Leaseset")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td colspan="2">
2019-04-11 14:00:42 +00:00
<%
2019-04-08 20:37:58 +00:00
String curEncryptMode = editBean.getEncryptMode(curTunnel);
2019-04-11 14:00:42 +00:00
%>
2019-05-23 11:12:19 +00:00
<select id="encryptMode" name="encryptMode" class="selectbox">
<option title="<%=intl._t("Allow all clients to connect to this service")%>" value="0" <%=(curEncryptMode.equals("0") ? " selected=\"selected\"" : "")%> >
2019-05-23 10:41:34 +00:00
<%=intl._t("Disable")%></option>
<%
if (editBean.isAdvanced() || curEncryptMode.equals("10")) {
%>
2019-05-23 11:12:19 +00:00
<option title="<%=intl._t("Allow all clients to connect to this service")%>" value="10" <%=(curEncryptMode.equals("10") ? " selected=\"selected\"" : "")%> >
2019-05-23 10:41:34 +00:00
<%=intl._t("Disable")%> (LS2)</option>
<%
} // isAdvanced()
%>
2019-05-23 11:12:19 +00:00
<option title="<%=intl._t("Only clients with the encryption key will be able to connect")%>" value="1" <%=(curEncryptMode.equals("1") ? " selected=\"selected\"" : "")%> >
2019-05-23 10:41:34 +00:00
<%=intl._t("Encrypted")%></option>
2019-04-11 14:00:42 +00:00
<%
2019-04-11 15:59:11 +00:00
int curSigType = editBean.getSigType(curTunnel, tunnelType);
boolean allowBlinding = (curSigType == 7 || curSigType == 11);
if (allowBlinding) {
2019-04-11 14:00:42 +00:00
%>
2019-05-23 11:12:19 +00:00
<option title="<%=intl._t("Prevents server discovery by floodfills")%>" value="2" <%=(curEncryptMode.equals("2") ? " selected=\"selected\"" : "")%> >
2019-05-23 10:41:34 +00:00
<%=intl._t("Blinded")%></option>
2019-04-12 12:08:09 +00:00
<%
if (editBean.isAdvanced()) {
%>
2019-05-23 11:12:19 +00:00
<option title="<%=intl._t("Only clients with the password will be able to connect")%>" value="3" <%=(curEncryptMode.equals("3") ? " selected=\"selected\"" : "")%> >
2019-05-23 10:41:34 +00:00
<%=intl._t("Blinded with lookup password")%></option>
2019-05-23 11:12:19 +00:00
<option title="<%=intl._t("Only clients with the encryption key will be able to connect")%>" value="4" <%=(curEncryptMode.equals("4") ? " selected=\"selected\"" : "")%> >
2019-05-28 15:12:20 +00:00
<%=intl._t("Blinded with shared key")%> (PSK)</option>
2019-05-23 11:12:19 +00:00
<option title="<%=intl._t("Only clients with the password and key will be able to connect")%>" value="5" <%=(curEncryptMode.equals("5") ? " selected=\"selected\"" : "")%> >
2019-05-28 15:12:20 +00:00
<%=intl._t("Blinded with lookup password and shared key")%> (PSK)</option>
2019-05-23 11:12:19 +00:00
<option title="<%=intl._t("Only clients with the encryption key will be able to connect")%>" value="6" <%=(curEncryptMode.equals("6") ? " selected=\"selected\"" : "")%> >
2019-05-23 10:41:34 +00:00
<%=intl._t("Blinded with per-user key")%> (PSK)</option>
2019-05-23 11:12:19 +00:00
<option title="<%=intl._t("Only clients with the password and key will be able to connect")%>" value="7" <%=(curEncryptMode.equals("7") ? " selected=\"selected\"" : "")%> >
2019-05-23 10:41:34 +00:00
<%=intl._t("Blinded with lookup password and per-user key")%> (PSK)</option>
2019-05-23 11:12:19 +00:00
<option title="<%=intl._t("Only clients with the encryption key will be able to connect")%>" value="8" <%=(curEncryptMode.equals("8") ? " selected=\"selected\"" : "")%> >
2019-05-23 10:41:34 +00:00
<%=intl._t("Blinded with per-user key")%> (DH)</option>
2019-05-23 11:12:19 +00:00
<option title="<%=intl._t("Only clients with the password and key will be able to connect")%>" value="9" <%=(curEncryptMode.equals("9") ? " selected=\"selected\"" : "")%> >
2019-05-23 10:41:34 +00:00
<%=intl._t("Blinded with lookup password and per-user key")%> (DH)</option>
2019-04-11 14:00:42 +00:00
<%
2019-04-11 15:59:11 +00:00
} // isAdvanced()
} // allowBlinding
2019-04-11 14:00:42 +00:00
%>
2019-05-23 10:41:34 +00:00
</select>
2016-07-11 06:54:26 +00:00
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td>
2019-05-23 13:22:29 +00:00
<%
if (allowBlinding && editBean.isAdvanced()) {
%>
<b><%=intl._t("Optional lookup password")%>:</b>
<%
} // allowBlinding
2019-05-24 17:42:11 +00:00
%>
</td><td>
<%
// even if not shown, we need to preserve the param as a hidden input below
// as it's the key we use to decrypt the PSK/DH LS on the router side
boolean showSharedKey = curEncryptMode.equals("1") || curEncryptMode.equals("4") || curEncryptMode.equals("5");
if (showSharedKey) {
%>
<b><%=intl._t("Encryption Key")%></b>
<%
} // showSharedKey
2019-05-23 13:22:29 +00:00
%>
2016-07-11 06:54:26 +00:00
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td>
2019-04-11 14:00:42 +00:00
<%
2019-04-12 12:08:09 +00:00
if (allowBlinding && editBean.isAdvanced()) {
2019-04-11 14:00:42 +00:00
%>
2019-04-08 20:37:58 +00:00
<input type="password" name="nofilter_blindedPassword" title="<%=intl._t("Set password required to access this service")%>" value="<%=editBean.getBlindedPassword(curTunnel)%>" class="freetext password" />
2019-04-11 14:00:42 +00:00
<%
2019-04-11 15:59:11 +00:00
} // allowBlinding
2019-05-23 13:22:29 +00:00
%>
2019-05-24 17:42:11 +00:00
</td><td>
2019-05-24 19:36:11 +00:00
<input type="<%=showSharedKey ? "text" : "hidden"%>" size="44" id="leasesetKey" name="encryptKey" title="<%=intl._t("Encryption key required to access this service")%>" readonly="readonly" value="<%=editBean.getEncryptKey(curTunnel)%>" class="freetext"/>
2019-05-23 13:22:29 +00:00
</td>
</tr>
<%
2019-05-24 17:42:11 +00:00
if (allowBlinding && editBean.isAdvanced()) {
boolean pskClient = curEncryptMode.equals("6") || curEncryptMode.equals("7");
boolean dhClient = curEncryptMode.equals("8") || curEncryptMode.equals("9");
if (pskClient || dhClient) {
// b64Name:b64Key
java.util.List<String> clientAuths = editBean.getClientAuths(curTunnel, dhClient);
if (!clientAuths.isEmpty()) {
%>
2019-05-29 19:08:33 +00:00
<tr><td><b><%=intl._t("Revoke")%> <%=intl._t("Client Name")%></b></td><td><b><%=intl._t("Client Key")%></b></td></tr>
2019-05-24 17:42:11 +00:00
<%
int i = 0;
for (String clientAuth : clientAuths) {
String[] split = net.i2p.data.DataHelper.split(clientAuth, ":", 2);
String cname, ckey;
if (split.length == 2) {
cname = split[0];
ckey = split[1];
} else {
cname = "";
ckey = split[0];
}
if (cname.length() > 0) {
cname = net.i2p.data.DataHelper.escapeHTML(net.i2p.data.DataHelper.getUTF8(net.i2p.data.Base64.decode(cname)));
} else {
cname = intl._t("Client") + ' ' + (i + 1);
}
%>
<tr>
<td><input value="<%=i%>" type="checkbox" name="revokeClient" class="tickbox" />
<input type="text" value="<%=cname%>" size="44" name="nofilter_clientName" class="freetext" /></td>
2019-05-24 19:36:11 +00:00
<td><input type="text" id="leasesetKey" value="<%=ckey%>" size="44" name="clientKey" readonly="readonly" class="freetext" />
2019-05-24 17:42:11 +00:00
</tr>
<%
i++;
} // for
} // isEmpty
%>
2019-05-29 19:08:33 +00:00
<tr><td><b><%=intl._t("Add")%> <%=intl._t("Client Name")%></b></td><td>
2019-05-24 17:42:11 +00:00
<%
if (dhClient) {
%>
<b><%=intl._t("Client Key")%></b>
<%
} // dhClient
%>
</td></tr><tr>
<td><input value="1" type="checkbox" name="addClient" class="tickbox" />
<input type="text" value="<%=intl._t("Client") + ' ' + (clientAuths.size() + 1)%>" size="44" name="nofilter_newClientName" class="freetext" /></td>
<td>
<%
if (dhClient) {
%>
<input type="text" id="leasesetKey" value="" size="44" maxlength="44" name="newClientKey" class="freetext" />
<%
} // dhClient
%>
</td></tr>
<%
} // pskClient || dhClient
} // allowBlinding
2019-04-11 15:59:11 +00:00
} // !isOffline
2019-04-11 14:00:42 +00:00
%>
2016-07-11 06:54:26 +00:00
<tr>
<th colspan="2">
<%=intl._t("Restricted Access List")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td colspan="2">
2017-06-03 14:10:08 +00:00
<span class="multiOption"><label title="<%=intl._t("Allow all clients to connect to this service")%>"><input value="0" type="radio" name="accessMode"<%=(editBean.getAccessMode(curTunnel).equals("0") ? " checked=\"checked\"" : "")%> class="tickbox" />
2017-05-14 05:30:13 +00:00
<%=intl._t("Disable")%></label></span>
2017-06-03 14:10:08 +00:00
<span class="multiOption"><label title="<%=intl._t("Prevent listed clients from connecting to this service")%>"><input value="2" type="radio" name="accessMode"<%=(editBean.getAccessMode(curTunnel).equals("2") ? " checked=\"checked\"" : "")%> class="tickbox" />
2017-05-14 05:30:13 +00:00
<%=intl._t("Blacklist")%></label></span>
2017-06-03 14:10:08 +00:00
<span class="multiOption"><label title="<%=intl._t("Only allow listed clients to connect to this service")%>"><input value="1" type="radio" name="accessMode"<%=(editBean.getAccessMode(curTunnel).equals("1") ? " checked=\"checked\"" : "")%> class="tickbox" />
2017-05-14 05:30:13 +00:00
<%=intl._t("Whitelist")%></label></span>
2016-07-11 06:54:26 +00:00
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td colspan="2">
2019-04-05 18:20:59 +00:00
<b><%=intl._t("Access List Description")%></b> (<%=intl._t("Specify clients, 1 per line")%>)
2016-07-11 06:54:26 +00:00
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td colspan="2">
2017-06-03 14:10:08 +00:00
<textarea rows="2" style="height: 8em;" cols="60" name="accessList" title="<%=intl._t("Control access to this service")%>" wrap="off" spellcheck="false"><%=editBean.getAccessList(curTunnel)%></textarea>
2016-07-11 06:54:26 +00:00
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2019-04-02 16:04:33 +00:00
<td colspan="2">
<b><%=intl._t("Filter Definition File")%></b>
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2019-04-02 16:04:33 +00:00
<td colspan="2">
<%=intl._t("You can define an advanced filter for this tunnel.")%> (<a href="http://i2p-projekt.i2p/spec/filter-format" target="_blank"><%=intl._t("Format Specification")%></a>)
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2019-04-02 16:04:33 +00:00
<td colspan="2">
2019-04-02 16:51:26 +00:00
<label for="filterDefinition"><%=intl._t("Absolute path to file containing filter definition")%></label>
2019-04-03 12:31:44 +00:00
<input type="text" id="filterDefinition" name="filterDefinition" value="<%=editBean.getFilterDefinition(curTunnel)%>" size="80"/>
2019-04-02 16:04:33 +00:00
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<th colspan="2">
<%=intl._t("Server Access Options")%>
</th>
</tr>
2019-04-11 14:00:42 +00:00
<%
if (("httpserver".equals(tunnelType)) || ("httpbidirserver".equals(tunnelType))) {
%>
2016-07-11 06:54:26 +00:00
<tr>
<td>
2017-06-03 14:10:08 +00:00
<label title="<%=intl._t("Prevent clients from accessing this service via an inproxy")%>"><input value="1" type="checkbox" name="rejectInproxy"<%=(editBean.isRejectInproxy(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
2017-05-14 05:30:13 +00:00
<%=intl._t("Block Access via Inproxies")%></label>
2019-04-11 14:00:42 +00:00
</td><td>
2018-05-28 17:49:47 +00:00
<label><input value="1" type="checkbox" name="rejectReferer"<%=(editBean.isRejectReferer(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
2017-05-14 05:30:13 +00:00
<%=intl._t("Block Accesses containing Referers")%></label>
2016-07-11 06:54:26 +00:00
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td>
2017-06-03 14:10:08 +00:00
<label title="<%=intl._t("Deny User-Agents matching these strings (probably from inproxies)")%>"><input value="1" type="checkbox" name="rejectUserAgents"<%=(editBean.isRejectUserAgents(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
2017-05-14 05:30:13 +00:00
<%=intl._t("Block these User-Agents")%></label>
2019-04-11 14:00:42 +00:00
</td><td>
2016-07-11 06:54:26 +00:00
<input type="text" id="userAgents" name="userAgents" size="20" title="<%=intl._t("comma separated, e.g. Mozilla,Opera (case-sensitive)")%>" value="<%=editBean.getUserAgents(curTunnel)%>" class="freetext" />
</td>
</tr>
2019-04-11 14:00:42 +00:00
<% } // httpserver
%>
2016-07-11 06:54:26 +00:00
<tr>
<td>
2017-06-03 14:10:08 +00:00
<label title="<%=intl._t("Use unique IP addresses for each connecting client (local non-SSL servers only)")%>"><input value="1" type="checkbox" name="uniqueLocal"<%=(editBean.getUniqueLocal(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
2017-05-14 05:30:13 +00:00
<%=intl._t("Unique Local Address per Client")%></label>
2019-04-11 14:00:42 +00:00
</td><td>
2017-06-03 14:10:08 +00:00
<label title="<%=intl._t("Only enable if you are hosting this service on multiple routers")%>"><input value="1" type="checkbox" name="multihome"<%=(editBean.getMultihome(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
2017-05-14 05:30:13 +00:00
<%=intl._t("Optimize for Multihoming")%></label>
2016-07-11 06:54:26 +00:00
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<th colspan="2">
<%=intl._t("Server Throttling")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td id="throttle" colspan="4">
<table id="throttler">
<tr>
<th colspan="5">
<%=intl._t("Inbound connection limits (0=unlimited)")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td></td>
<td><b><%=intl._t("Per Minute")%></b></td>
<td><b><%=intl._t("Per Hour")%></b></td>
<td><b><%=intl._t("Per Day")%></b></td>
<td class="blankColumn"></td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td><b><%=intl._t("Per Client")%></b></td>
<td>
2017-06-03 14:10:08 +00:00
<input type="text" name="limitMinute" title="<%=intl._t("Maximum number of web page requests per minute for a unique client before access to the server is blocked")%>" value="<%=editBean.getLimitMinute(curTunnel)%>" class="freetext" />
2019-04-11 14:00:42 +00:00
</td><td>
2017-06-03 14:10:08 +00:00
<input type="text" name="limitHour" title="<%=intl._t("Maximum number of web page requests per hour for a unique client before access to the server is blocked")%>" value="<%=editBean.getLimitHour(curTunnel)%>" class="freetext" />
2019-04-11 14:00:42 +00:00
</td><td>
2017-06-03 14:10:08 +00:00
<input type="text" name="limitDay" title="<%=intl._t("Maximum number of web page requests per day for a unique client before access to the server is blocked")%>" value="<%=editBean.getLimitDay(curTunnel)%>" class="freetext" />
2019-04-11 14:00:42 +00:00
</td><td class="blankColumn"></td>
</tr><tr>
2016-07-11 06:54:26 +00:00
<td><b><%=intl._t("Total")%></b></td>
<td>
2017-06-03 14:10:08 +00:00
<input type="text" name="totalMinute" title="<%=intl._t("Total number of web page requests per minute before access to the server is blocked")%>" value="<%=editBean.getTotalMinute(curTunnel)%>" class="freetext" />
2019-04-11 14:00:42 +00:00
</td><td>
2017-06-03 14:10:08 +00:00
<input type="text" name="totalHour" title="<%=intl._t("Total number of web page requests per hour before access to the server is blocked")%>" value="<%=editBean.getTotalHour(curTunnel)%>" class="freetext" />
2019-04-11 14:00:42 +00:00
</td><td>
2017-06-03 14:10:08 +00:00
<input type="text" name="totalDay" title="<%=intl._t("Total number of web page requests per day before access to the server is blocked")%>" value="<%=editBean.getTotalDay(curTunnel)%>" class="freetext" />
2019-04-11 14:00:42 +00:00
</td><td class="blankColumn"></td>
</tr><tr>
2016-07-11 06:54:26 +00:00
<th colspan="5"><%=intl._t("Max concurrent connections (0=unlimited)")%></th>
2019-04-11 14:00:42 +00:00
</tr><tr>
<td></td><td>
2017-06-03 14:10:08 +00:00
<input type="text" name="maxStreams" title="<%=intl._t("Maximum number of simultaneous client connections")%>" value="<%=editBean.getMaxStreams(curTunnel)%>" class="freetext" />
2019-04-11 14:00:42 +00:00
</td><td></td><td></td><td class="blankColumn"></td>
2016-07-11 06:54:26 +00:00
</tr>
2019-04-11 14:00:42 +00:00
<%
if (("httpserver".equals(tunnelType)) || ("httpbidirserver".equals(tunnelType))) {
%>
2016-07-11 06:54:26 +00:00
<tr>
<th colspan="5">
<%=intl._t("POST limits (0=unlimited)")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
<td></td><td>
2016-07-11 06:54:26 +00:00
<b><%=intl._t("Per Period")%></b>
2019-04-11 14:00:42 +00:00
</td><td>
2016-07-11 06:54:26 +00:00
<b><%=intl._t("Ban Duration")%></b>
2019-04-11 14:00:42 +00:00
</td><td></td><td class="blankColumn"></td>
</tr><tr>
2016-07-11 06:54:26 +00:00
<td>
<b><%=intl._t("Per Client")%>
</b>
2019-04-11 14:00:42 +00:00
</td><td>
2017-06-03 14:10:08 +00:00
<input type="text" name="postMax" title="<%=intl._t("Maximum number of post requests permitted for a unique client for the configured timespan")%>" value="<%=editBean.getPostMax(curTunnel)%>" class="freetext quantity"/>
2019-04-11 14:00:42 +00:00
</td><td colspan="2">
2017-06-03 14:10:08 +00:00
<input type="text" name="postBanTime" title="<%=intl._t("If a client exceeds the maximum number of post requests per allocated period, enforce a ban for this number of minutes")%>" value="<%=editBean.getPostBanTime(curTunnel)%>" class="freetext period"/>
2016-07-11 06:54:26 +00:00
<%=intl._t("minutes")%>
2019-04-11 14:00:42 +00:00
</td><td class="blankColumn"></td>
</tr><tr>
2016-07-11 06:54:26 +00:00
<td>
<b><%=intl._t("Total")%>
</b>
2019-04-11 14:00:42 +00:00
</td><td>
2017-06-03 14:10:08 +00:00
<input type="text" name="postTotalMax" title="<%=intl._t("Total number of post requests permitted for the configured timespan")%>" value="<%=editBean.getPostTotalMax(curTunnel)%>" class="freetext quantity"/>
2019-04-11 14:00:42 +00:00
</td><td colspan="2">
2017-06-03 14:10:08 +00:00
<input type="text" name="postTotalBanTime" title="<%=intl._t("If the maximum number of post requests per allocated period is exceeded, enforce a global access ban for this number of minutes")%>" value="<%=editBean.getPostTotalBanTime(curTunnel)%>" class="freetext period"/>
2016-07-11 06:54:26 +00:00
<%=intl._t("minutes")%>
2019-04-11 14:00:42 +00:00
</td><td class="blankColumn"></td>
</tr><tr>
2016-07-11 06:54:26 +00:00
<td>
<b><%=intl._t("POST limit period")%>
</b>
2019-04-11 14:00:42 +00:00
</td><td colspan="2">
2017-06-03 14:10:08 +00:00
<input type="text" name="postCheckTime" title="<%=intl._t("Timespan for the maximum number of post requests to be reached before a ban is triggered")%>" value="<%=editBean.getPostCheckTime(curTunnel)%>" class="freetext period"/>
2016-07-11 06:54:26 +00:00
<%=intl._t("minutes")%>
2019-04-11 14:00:42 +00:00
</td><td></td><td class="blankColumn"></td>
2016-07-11 06:54:26 +00:00
</tr>
2019-04-11 14:00:42 +00:00
<% } // httpserver
%>
2009-01-20 17:24:28 +00:00
2016-07-11 06:54:26 +00:00
</table>
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<th colspan="2">
<%=intl._t("Reduce tunnel quantity when idle")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td colspan="2">
2017-06-03 14:10:08 +00:00
<label><input value="1" type="checkbox" id="startOnLoad" name="reduce" <%=(editBean.getReduce(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
2017-05-14 05:30:13 +00:00
<%=intl._t("Reduce tunnel quantity when idle to conserve resources")%></label>
2016-07-11 06:54:26 +00:00
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td>
<b><%=intl._t("Reduced tunnel count")%>:</b>
2017-06-03 14:10:08 +00:00
<input type="text" id="reduceCount" name="reduceCount" size="1" maxlength="1" title="<%=intl._t("Number of tunnels to keep open to maintain availability of service")%>" value="<%=editBean.getReduceCount(curTunnel)%>" class="freetext quantity" />
2016-07-11 06:54:26 +00:00
</td>
<td>
<b><%=intl._t("Idle period")%>:</b>
2017-06-03 14:10:08 +00:00
<input type="text" id="reduceTime" name="reduceTime" size="4" maxlength="4" title="<%=intl._t("Period of inactivity before tunnel number is reduced")%>" value="<%=editBean.getReduceTime(curTunnel)%>" class="freetext period" />
2016-07-11 06:54:26 +00:00
<%=intl._t("minutes")%>
</td>
</tr>
2014-01-03 15:31:08 +00:00
<% /***************** %>
2017-06-03 14:10:08 +00:00
<tr>
<th colspan="2">
<%=intl._t("New Certificate type")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2017-06-03 14:10:08 +00:00
<td colspan="2">
<span class="multiOption"><label title="<%=intl._t("No Certificate")%>"><%=intl._t("None")%>
<input value="0" type="radio" id="startOnLoad" name="cert"<%=(editBean.getCert(curTunnel)==0 ? " checked=\"checked\"" : "")%> class="tickbox" /></label></span>
<span class="multiOption"><label title="<%=intl._t("Hashcash Certificate")%>"><%=intl._t("Hashcash (effort)")%>
<input value="1" type="radio" id="startOnLoad" name="cert"<%=(editBean.getCert(curTunnel)==1 ? " checked=\"checked\"" : "")%> class="tickbox" /></label>
<input type="text" id="port" name="effort" size="2" maxlength="2" title="<%=intl._t("Hashcash Effort")%>" value="<%=editBean.getEffort(curTunnel)%>" class="freetext" /></span>
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2017-06-03 14:10:08 +00:00
<th>
<%=intl._t("Hashcash Calc Time")%>
2019-04-11 14:00:42 +00:00
</th><th>
2017-06-03 14:10:08 +00:00
<%=intl._t("Hidden")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2017-06-03 14:10:08 +00:00
<td>
<button class="control" type="submit" name="action" value="Estimate" title="<%=intl._t("Estimate Calculation Time")%>"><%=intl._t("Estimate")%></button>
2019-04-11 14:00:42 +00:00
</td><td>
2017-06-03 14:10:08 +00:00
<input value="2" type="radio" id="startOnLoad" name="cert" title="<%=intl._t("Hidden Certificate")%>"<%=(editBean.getCert(curTunnel)==2 ? " checked=\"checked\"" : "")%> class="tickbox" />
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2017-06-03 14:10:08 +00:00
<th colspan="2">
<%=intl._t("Signed Certificate")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2017-06-03 14:10:08 +00:00
<td colspan="2">
<label title="<%=intl._t("Signed Certificate")%>"><%=intl._t("Signed (signed by)")%>:
<input value="3" type="radio" id="startOnLoad" name="cert"<%=(editBean.getCert(curTunnel)==3 ? " checked=\"checked\"" : "")%> class="tickbox" /></label>
<input type="text" id="port" name="signer" size="50" title="<%=intl._t("Cert Signer")%>" value="<%=editBean.getSigner(curTunnel)%>" class="freetext" />
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2017-06-03 14:10:08 +00:00
<th colspan="2">
<%=intl._t("Modify Certificate")%> <%=intl._t("(Tunnel must be stopped first)")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2017-06-03 14:10:08 +00:00
<td colspan="2">
<button class="control" type="submit" name="action" value="Modify" title="<%=intl._t("Force new Certificate now")%>"><%=intl._t("Modify")%></button>
</td>
</tr>
2019-04-11 14:00:42 +00:00
<%
**********************/
2017-03-14 14:15:54 +00:00
int currentSigType = editBean.getSigType(curTunnel, tunnelType);
if (true /* editBean.isAdvanced() */ ) {
2018-01-19 12:58:41 +00:00
String disabled = editBean.canChangeSigType(curTunnel) ? "" : " disabled=\"disabled\" ";
2019-04-11 14:00:42 +00:00
%>
2016-07-11 06:54:26 +00:00
<tr>
<th colspan="2">
2018-01-19 12:58:41 +00:00
<%=intl._t("Signature type")%> <%-- (<%=intl._t("Experts only! Changes B32!")%>) --%>
2016-07-11 06:54:26 +00:00
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td colspan="2">
2019-05-23 11:12:19 +00:00
<select id="sigType" name="sigType" class="selectbox">
<option title="<%=intl._t("Legacy option (deprecated), provided for backward compatibility")%>" value="0" <%=(currentSigType==0 ? " selected=\"selected\"" : disabled)%> >
DSA-SHA1</option>
2019-04-11 14:00:42 +00:00
<% if (editBean.isSigTypeAvailable(1)) { %>
2019-05-23 11:12:19 +00:00
<option value="1" <%=(currentSigType==1 ? " selected=\"selected\"" : disabled)%> >
ECDSA-P256</option>
2019-04-11 14:00:42 +00:00
<% }
2014-02-21 17:47:30 +00:00
if (editBean.isSigTypeAvailable(2)) { %>
2019-05-23 11:12:19 +00:00
<option value="2" <%=(currentSigType==2 ? " selected=\"selected\"" : disabled)%> >
ECDSA-P384</option>
2019-04-11 14:00:42 +00:00
<% }
2014-02-21 17:47:30 +00:00
if (editBean.isSigTypeAvailable(3)) { %>
2019-05-23 11:12:19 +00:00
<option value="3" <%=(currentSigType==3 ? " selected=\"selected\"" : disabled)%> >
ECDSA-P521</option>
2019-04-11 14:00:42 +00:00
<% }
2014-04-26 12:11:02 +00:00
if (editBean.isSigTypeAvailable(7)) { %>
2019-05-23 11:12:19 +00:00
<option title="<%=intl._t("This is the default, recommended option")%>" value="7" <%=(currentSigType==7 ? " selected=\"selected\"" : disabled)%> >
Ed25519-SHA-512</option>
2019-04-11 14:33:38 +00:00
<% }
if (editBean.isSigTypeAvailable(11)) { %>
2019-05-23 11:12:19 +00:00
<option title="<%=intl._t("Experimental")%>" value="11" <%=(currentSigType==11 ? " selected=\"selected\"" : disabled)%> >
Red25519-SHA-512</option>
2019-04-11 14:00:42 +00:00
<% } // isAvailable
%>
2019-05-23 11:12:19 +00:00
</select>
2016-07-11 06:54:26 +00:00
</td>
</tr>
2019-04-11 14:00:42 +00:00
<% } // isAdvanced
2016-07-11 06:54:26 +00:00
2017-03-14 14:15:54 +00:00
/* alternate dest, only if current dest is set and is DSA_SHA1 */
if (currentSigType == 0 && !"".equals(b64) && !"streamrserver".equals(tunnelType)) {
2019-04-11 14:00:42 +00:00
%>
2017-06-03 14:10:08 +00:00
<tr>
<th colspan="2">
<%=intl._t("Alternate private key file")%> (Ed25519-SHA-512)
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2017-06-03 14:10:08 +00:00
<td colspan="2">
<input type="text" class="freetext" size="30" id="altPrivKeyFile" name="altPrivKeyFile" title="<%=intl._t("Path to Private Key File")%>" value="<%=editBean.getAltPrivateKeyFile(curTunnel)%>" />
</td>
</tr>
2019-04-11 14:00:42 +00:00
<%
2017-03-14 14:15:54 +00:00
String ab64 = editBean.getAltDestinationBase64(curTunnel);
if (!"".equals(ab64)) {
2019-04-11 14:00:42 +00:00
%>
2017-06-03 14:10:08 +00:00
<tr>
<th colspan="2">
<%=intl._t("Alternate local destination")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2017-06-03 14:10:08 +00:00
<td colspan="2">
2017-07-27 01:23:06 +00:00
<div class="displayText" title="<%=intl._t("Read Only: Alternate Local Destination")%>" onblur="resetScrollLeft(this)"><%=ab64%></div>
2017-06-03 14:10:08 +00:00
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2017-06-03 14:10:08 +00:00
<td colspan="2">
<%=editBean.getAltDestHashBase32(curTunnel)%>
</td>
</tr>
2019-04-11 14:00:42 +00:00
<%
2017-03-14 14:15:54 +00:00
ab64 = ab64.replace("=", "%3d");
String name = editBean.getSpoofedHost(curTunnel);
if (name == null || name.equals(""))
name = editBean.getTunnelName(curTunnel);
// mysite.i2p is set in the installed i2ptunnel.config
if (name != null && !name.equals("") && !name.equals("mysite.i2p") && !name.contains(" ") && name.endsWith(".i2p")) {
2019-04-11 14:00:42 +00:00
%>
2017-06-03 14:10:08 +00:00
<tr>
<td class="buttons" colspan="2">
2019-04-11 14:00:42 +00:00
<%
2018-03-14 14:09:41 +00:00
if (hasImagegen) {
2019-04-11 14:00:42 +00:00
%>
2017-03-14 14:15:54 +00:00
<a class="control" title="<%=intl._t("Generate QR Code")%>" href="/imagegen/qr?s=320&t=<%=name%>&c=http%3a%2f%2f<%=name%>%2f%3fi2paddresshelper%3d<%=ab64%>" target="_top"><%=intl._t("Generate QR Code")%></a>
2019-04-11 14:00:42 +00:00
<%
2018-03-14 14:09:41 +00:00
}
if (hasSusiDNS) {
2019-04-11 14:00:42 +00:00
%>
2017-06-03 14:10:08 +00:00
<a class="control" title="<%=intl._t("Add to Private addressbook")%>" href="/susidns/addressbook.jsp?book=private&hostname=<%=name%>&destination=<%=ab64%>#add"><%=intl._t("Add to local addressbook")%></a>
2019-04-11 14:00:42 +00:00
<%
2018-03-14 14:09:41 +00:00
}
2017-03-14 14:15:54 +00:00
} else {
2019-04-11 14:00:42 +00:00
%>
2017-06-03 14:10:08 +00:00
<tr>
<td colspan="2">
<%=intl._t("Note: In order to enable QR code generation or registration authentication, configure the Website Hostname field (for websites) or the Name field (everything else) above with an .i2p suffixed hostname e.g. mynewserver.i2p")%>
</td>
</tr>
2019-04-11 14:00:42 +00:00
<%
2017-03-14 14:15:54 +00:00
} // name
} // ab64
2019-04-11 14:00:42 +00:00
} // currentSigType
%>
2016-07-11 06:54:26 +00:00
<tr>
<th colspan="2">
<%=intl._t("Custom options")%>
</th>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td colspan="2">
2018-05-28 17:49:47 +00:00
<input type="text" class="freetext" id="customOptions" name="nofilter_customOptions" size="60" title="<%=intl._t("Advanced tunnel, streaming, and I2CP options")%>" value="<%=editBean.getCustomOptions(curTunnel)%>" />
2016-07-11 06:54:26 +00:00
</td>
2019-04-11 14:00:42 +00:00
</tr><tr>
2016-07-11 06:54:26 +00:00
<td class="buttons" colspan="2">
2005-11-12 02:38:55 +00:00
<input type="hidden" value="true" name="removeConfirm" />
2017-06-03 14:10:08 +00:00
<button id="controlCancel" class="control" type="submit" name="action" value=""><%=intl._t("Cancel")%></button>
<button id="controlDelete" <%=(editBean.allowJS() ? "onclick=\"if (!confirm('Are you sure you want to delete?')) { return false; }\" " : "")%>class="control" type="submit" name="action" value="Delete this proxy" title="<%=intl._t("Delete this Proxy (cannot be undone)")%>"><%=intl._t("Delete")%></button>
<button id="controlSave" class="control" type="submit" name="action" value="Save changes"><%=intl._t("Save")%></button>
2016-07-11 06:54:26 +00:00
</td>
</tr>
2019-04-11 14:00:42 +00:00
</table>