i2ptunnel: jsp whitespace removal

This commit is contained in:
zzz
2019-04-11 14:00:42 +00:00
parent 2960156b33
commit dd5f8b45ef
3 changed files with 460 additions and 760 deletions

View File

@@ -1,4 +1,4 @@
<%
<%
String tunnelTypeName;
String tunnelType;
if (curTunnel >= 0) {
@@ -13,111 +13,97 @@
<input type="hidden" name="tunnel" value="<%=curTunnel%>" />
<input type="hidden" name="nonce" value="<%=net.i2p.i2ptunnel.web.IndexBean.getNextNonce()%>" />
<input type="hidden" name="type" value="<%=tunnelType%>" />
<%
<%
// 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%>" />
<% }
<% }
key = editBean.getKey2(curTunnel);
if (key != null && key.length() > 0) { %>
<input type="hidden" name="key2" value="<%=key%>" />
<% }
<% }
key = editBean.getKey3(curTunnel);
if (key != null && key.length() > 0) { %>
<input type="hidden" name="key3" value="<%=key%>" />
<% }
<% }
key = editBean.getKey4(curTunnel);
if (key != null && key.length() > 0) { %>
<input type="hidden" name="key4" value="<%=key%>" />
<% } %>
<% }
%>
<input type="submit" class="default" name="action" value="Save changes" />
<table id="clientTunnelEdit" class="tunnelConfig">
<tr>
<th>
<%=intl._t("Name")%>
</th>
<th>
</th><th>
<%=intl._t("Type")%>
</th>
</tr>
<tr>
</tr><tr>
<td>
<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" />
</td>
<td>
</td><td>
<%=tunnelTypeName%>
</td>
</tr>
<tr>
</tr><tr>
<th>
<%=intl._t("Description")%>
</th>
<th>
</th><th>
<%=intl._t("Auto Start Tunnel")%>
</th>
</tr>
<tr>
</tr><tr>
<td>
<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 tunnelDescription" />
</td>
<td>
</td><td>
<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" />
<%=intl._t("Automatically start tunnel when router starts")%></label>
</td>
</tr>
<tr>
</tr><tr>
<th colspan="2">
<% if ("streamrclient".equals(tunnelType)) { %>
<% if ("streamrclient".equals(tunnelType)) { %>
<%=intl._t("Target")%>
<% } else { %>
<% } else { %>
<%=intl._t("Access Point")%>
<% } /* streamrclient */ %>
<% } /* streamrclient */ %>
</th>
</tr>
<tr>
</tr><tr>
<td>
<b><%=intl._t("Port")%>:</b>
<% String value = editBean.getClientPort(curTunnel);
<%
String value = editBean.getClientPort(curTunnel);
if (value == null || "".equals(value.trim())) {
out.write(" <span class=\"required\"><font color=\"red\">(");
out.write(intl._t("required"));
out.write(")</font></span>");
}
%>
%>
<input type="text" size="6" maxlength="5" name="port" title="<%=intl._t("Specify the local port this service should be accessible from")%>" value="<%=editBean.getClientPort(curTunnel)%>" class="freetext port" placeholder="required" />
</td>
<%
if ("streamrclient".equals(tunnelType)) { %>
<%
if ("streamrclient".equals(tunnelType)) {
%>
<td>
<b><%=intl._t("Host")%>:</b>
<%
<%
String targetHost = editBean.getTargetHost(curTunnel);
if (targetHost == null || "".equals(targetHost.trim())) {
out.write(" <span class=\"required\"><font color=\"red\">(");
out.write(intl._t("required"));
out.write(")</font></span>");
}
%>
%>
<input type="text" size="20" id="targetHost" name="targetHost" title="<%=intl._t("Hostname or IP address of the target server")%>" value="<%=targetHost%>" class="freetext host" placeholder="required" />
</td>
<% } else { %>
<%
} else {
%>
<td>
<b><%=intl._t("Reachable by")%>:</b>
<select id="reachableBy" name="reachableBy" title="<%=intl._t("Local interface (ip address) the client tunnel will be reachable from")%>" class="selectbox">
<%
<%
String clientInterface = editBean.getClientInterface(curTunnel);
for (String ifc : editBean.interfaceSet()) {
out.write("<option value=\"");
@@ -129,75 +115,71 @@
out.write(ifc);
out.write("</option>\n");
}
%>
%>
</select>
</td>
<% } /* streamrclient */ %>
</tr>
<% if ("client".equals(tunnelType) || "ircclient".equals(tunnelType)) {
%>
<%
if ("client".equals(tunnelType) || "ircclient".equals(tunnelType)) {
%>
<tr>
<th colspan="2">
<%=intl._t("Use SSL?")%>
</th>
</tr>
<tr>
</tr><tr>
<td colspan="2">
<label title="<%=intl._t("If you are accessing a service on a remote I2P router, you may wish to connect with SSL to avoid traffic interception. The client application should be also be configured to use SSL.")%>"><input value="1" type="checkbox" name="useSSL" <%=(editBean.isSSLEnabled(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
<%=intl._t("Clients use SSL to connect to tunnel")%></label>
</td>
</tr>
<% } /* tunnel types */ %>
<%
} /* tunnel types */
<% if ("httpclient".equals(tunnelType) || "connectclient".equals(tunnelType) || "sockstunnel".equals(tunnelType) || "socksirctunnel".equals(tunnelType)) {
%>
if ("httpclient".equals(tunnelType) || "connectclient".equals(tunnelType) || "sockstunnel".equals(tunnelType) || "socksirctunnel".equals(tunnelType)) {
%>
<tr>
<th colspan="2">
<%=intl._t("Outproxies")%>
</th>
</tr>
<tr>
</tr><tr>
<td colspan="2">
<input type="text" size="30" name="proxyList" title="<%=intl._t("Specify the .i2p address or destination (b32 or b64) of the outproxy here.")%>&nbsp;<%=intl._t("For a random selection from a pool, separate with commas e.g. server1.i2p,server2.i2p")%>" value="<%=editBean.getClientDestination(curTunnel)%>" class="freetext proxyList" />
</td>
</tr>
<% if ("httpclient".equals(tunnelType)) {
%>
<%
if ("httpclient".equals(tunnelType)) {
%>
<tr>
<th colspan="2">
<%=intl._t("SSL Outproxies")%>
</th>
</tr>
<tr>
</tr><tr>
<td colspan="2">
<input type="text" size="30" name="sslProxies" title="<%=intl._t("Specify the .i2p address or destination (b32 or b64) of the outproxy here.")%>&nbsp;<%=intl._t("For a random selection from a pool, separate with commas e.g. server1.i2p,server2.i2p")%>" value="<%=editBean.getSslProxies(curTunnel)%>" class="freetext proxyList" />
</td>
</tr>
<% } // httpclient %>
<%
} // httpclient
%>
<tr>
<th colspan="2">
<%=intl._t("Use Outproxy Plugin")%>
</th>
</tr>
<tr>
</tr><tr>
<td colspan="2">
<label title="<%=intl._t("If an outproxy plugin is installed (e.g. Orchid), use this instead of any configured outproxies to access websites outside of I2P")%>"><input value="1" type="checkbox" name="useOutproxyPlugin" <%=(editBean.getUseOutproxyPlugin(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
<%=intl._t("Use plugin instead of above-listed proxies if available")%></label>
</td>
</tr>
<% } else if ("client".equals(tunnelType) || "ircclient".equals(tunnelType) || "streamrclient".equals(tunnelType)) {
%>
<%
} else if ("client".equals(tunnelType) || "ircclient".equals(tunnelType) || "streamrclient".equals(tunnelType)) {
%>
<tr>
<th colspan="2">
<%=intl._t("Tunnel Destination")%>
</th>
</tr>
<tr>
</tr><tr>
<td colspan="2">
<% String value2 = editBean.getClientDestination(curTunnel);
if (value2 == null || "".equals(value2.trim())) {
@@ -205,96 +187,98 @@
out.write(intl._t("required"));
out.write(")</font></span>");
}
%>
%>
<input type="text" size="30" id="targetDestination" name="targetDestination" title="<%=intl._t("Specify the .i2p address or destination (b32 or b64) of the tunnel here.")%>&nbsp;<%=intl._t("For a random selection from a pool, separate with commas e.g. server1.i2p,server2.i2p")%>" value="<%=editBean.getClientDestination(curTunnel)%>" class="freetext destination" placeholder="required" />
(<%=intl._t("name, name:port, or destination")%>
<% if ("streamrclient".equals(tunnelType)) { /* deferred resolution unimplemented in streamr client */ %>
<%
if ("streamrclient".equals(tunnelType)) {
/* deferred resolution unimplemented in streamr client */
%>
- <%=intl._t("b32 not recommended")%>
<% } %> )
<%
}
%> )
</td>
</tr>
<%
}
<% } %>
<% if (!"streamrclient".equals(tunnelType)) { %>
if (!"streamrclient".equals(tunnelType)) {
%>
<tr>
<th colspan="2">
<%=intl._t("Shared Client")%>
</th>
</tr>
<tr>
</tr><tr>
<td colspan="2">
<label title="<%=intl._t("Traffic from all clients with this feature enabled will be routed over the same set of tunnels. This will make profiling the tunnels by an adversary more difficult, but will link the clients together.")%>"><input value="true" type="checkbox" name="shared"<%=(editBean.isSharedClient(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
<%=intl._t("Share tunnels with other clients and irc/httpclients? (Change requires restart of client proxy tunnel)")%></label>
</td>
</tr>
<%
} // !streamrclient
<% } // !streamrclient %>
<% if ("ircclient".equals(tunnelType)) { %>
if ("ircclient".equals(tunnelType)) {
%>
<tr>
<th colspan="2">
<%=intl._t("Enable DCC")%>
</th>
</tr>
<tr>
</tr><tr>
<td colspan="2">
<label title="<%=intl._t("Enables direct chat and file transfers, bypassing I2P")%>"><input value="1" type="checkbox" name="DCC"<%=(editBean.getDCC(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
<%=intl._t("Enable Direct Client-to-Client protocol. Note that this will compromise your anonymity and is <i>not</i> recommended.")%></label>
</td>
</tr>
<% } // ircclient %>
<%
} // ircclient
%>
</table>
<h3><%=intl._t("Advanced networking options")%></h3>
<table class="tunnelConfig">
<% if (!"streamrclient".equals(tunnelType)) { %> <% // no shared client tunnels for streamr %>
<%
if (!"streamrclient".equals(tunnelType)) {
// no shared client tunnels for streamr
%>
<tr>
<td class="infohelp" colspan="2">
<%=intl._t("Note: When this client proxy is configured to share tunnels, then these options are for all the shared proxy clients!")%>
</td>
</tr>
<% } // !streamrclient %>
<%
} // !streamrclient
%>
<tr>
<th colspan="2">
<%=intl._t("Tunnel Options")%>
</th>
</tr>
<tr>
</tr><tr>
<td>
<b><%=intl._t("Length")%></b>
</td>
<td>
</td><td>
<b><%=intl._t("Variance")%></b>
</td>
</tr>
<tr>
</tr><tr>
<td>
<select id="tunnelDepth" name="tunnelDepth" title="<%=intl._t("Length of each Tunnel")%>" class="selectbox">
<% int tunnelDepth = editBean.getTunnelDepth(curTunnel, 3);
<%
int tunnelDepth = editBean.getTunnelDepth(curTunnel, 3);
%><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>
<% if (editBean.isAdvanced()) {
<% if (editBean.isAdvanced()) {
%><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>
<% } else if (tunnelDepth > 3) {
<%
} else if (tunnelDepth > 3) {
%> <option value="<%=tunnelDepth%>" selected="selected"><%=tunnelDepth%> <%=intl._t("hop tunnel (very poor performance)")%></option>
<% }
<%
}
%></select>
</td>
<td>
</td><td>
<select id="tunnelVariance" name="tunnelVariance" title="<%=intl._t("Level of Randomization for Tunnel Length")%>" class="selectbox">
<% int tunnelVariance = editBean.getTunnelVariance(curTunnel, 0);
%><option value="0"<%=(tunnelVariance == 0 ? " selected=\"selected\"" : "") %>><%=intl._t("0 hop variance (no randomization, consistent performance)")%></option>
@@ -307,149 +291,119 @@
<% }
%></select>
</td>
</tr>
<tr>
</tr><tr>
<td>
<b><%=intl._t("Count")%></b>
</td>
<td>
</td><td>
<b><%=intl._t("Backup Count")%></b>
</td>
</tr>
<tr>
</tr><tr>
<td>
<select id="tunnelQuantity" name="tunnelQuantity" title="<%=intl._t("Number of Tunnels in Group")%>" class="selectbox">
<%=editBean.getQuantityOptions(curTunnel, 0)%>
</select>
</td>
<td>
</td><td>
<select id="tunnelBackupQuantity" name="tunnelBackupQuantity" title="<%=intl._t("Number of Reserve Tunnels")%>" class="selectbox">
<% int tunnelBackupQuantity = editBean.getTunnelBackupQuantity(curTunnel, 0);
<%
int tunnelBackupQuantity = editBean.getTunnelBackupQuantity(curTunnel, 0);
%><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>
<% if (tunnelBackupQuantity > 3) {
<%
if (tunnelBackupQuantity > 3) {
%> <option value="<%=tunnelBackupQuantity%>" selected="selected"><%=tunnelBackupQuantity%> <%=intl._t("backup tunnels")%></option>
<% }
<%
}
%></select>
</td>
</tr>
<% if (!"streamrclient".equals(tunnelType)) { %>
<%
if (!"streamrclient".equals(tunnelType)) {
%>
<tr>
<th>
<%=intl._t("Profile")%>
</th>
<th>
</th><th>
<%=intl._t("Delay Connect")%>
</th>
</tr>
<tr>
</tr><tr>
<td>
<select id="connectionProfile" name="profile" title="<%=intl._t("Connection Profile")%>" class="selectbox">
<% boolean interactiveProfile = editBean.isInteractive(curTunnel);
%><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>
</select>
</td>
<td>
</td><td>
<label title="<%=intl._t("Delay Connection")%>"><input value="1000" type="checkbox" name="connectDelay"<%=(editBean.shouldDelay(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
(<%=intl._t("for request/response connections")%>)</label> <% // TODO: Convey to users: Where is the (1s) delay introduced? What is the difference between delay connect and delay open? %>
</td>
</tr>
<% } // !streamrclient %>
<%
} // !streamrclient
%>
<tr>
<th colspan="2">
<%=intl._t("Router I2CP Address")%>
</th>
</tr>
<tr>
</tr><tr>
<td>
<b><%=intl._t("Host")%>:</b>
<input type="text" name="clientHost" size="20" title="<%=intl._t("I2CP Hostname or IP")%>" value="<%=editBean.getI2CPHost(curTunnel)%>" class="freetext host" <% if (editBean.isRouterContext()) { %> readonly="readonly" <% } %> />
</td>
<td>
</td><td>
<b><%=intl._t("Port")%>:</b>
<input type="text" name="clientport" size="20" title="<%=intl._t("I2CP Port Number")%>" value="<%=editBean.getI2CPPort(curTunnel)%>" class="freetext port" <% if (editBean.isRouterContext()) { %> readonly="readonly" <% } %> />
</td>
</tr>
<% if (!"streamrclient".equals(tunnelType)) { // streamr client sends pings so it will never be idle %>
<%
if (!"streamrclient".equals(tunnelType)) {
// streamr client sends pings so it will never be idle
%>
<tr>
<th colspan="2">
<%=intl._t("Delay tunnel open until required")%>
</th>
</tr>
<tr>
</tr><tr>
<td colspan="2">
<label title="<%=intl._t("Conserve resources by only creating tunnels when required")%>"><input value="1" type="checkbox" name="delayOpen"<%=(editBean.getDelayOpen(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
<%=intl._t("Delay opening client tunnel until activity is detected on the configured tunnel port")%></label>
</td>
</tr>
<% } // !streamrclient %>
<%
} // !streamrclient
%>
<tr>
<th colspan="2">
<%=intl._t("Reduce tunnel quantity when idle")%>
</th>
</tr>
<tr>
</tr><tr>
<td colspan="2">
<label title="<%=intl._t("Reduce tunnel count when idle but keep tunnel open (to ensure immediate availability)")%>"><input value="1" type="checkbox" name="reduce"<%=(editBean.getReduce(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
<%=intl._t("Reduce tunnel quantity when idle to conserve resources")%></label>
</td>
</tr>
<tr>
</tr><tr>
<td>
<b><%=intl._t("Reduced tunnel count")%>:</b>
<input type="text" id="reducedTunnelCount" name="reduceCount" size="1" maxlength="1" title="<%=intl._t("Reduced tunnel count")%>" value="<%=editBean.getReduceCount(curTunnel)%>" class="freetext quantity" />
</td>
<td>
</td><td>
<b><%=intl._t("Idle period")%>:</b>
<input type="text" name="reduceTime" size="4" maxlength="4" title="<%=intl._t("Reduced Tunnel Idle Time")%>" value="<%=editBean.getReduceTime(curTunnel)%>" class="freetext period" />
minutes
</td>
</tr>
<tr>
</tr><tr>
<th colspan="2">
<%=intl._t("Close tunnels when idle")%>
</th>
</tr>
<tr>
</tr><tr>
<td>
<label title="<%=intl._t("To conserve resources, close tunnels when not in use")%>"><input value="1" type="checkbox" name="close"<%=(editBean.getClose(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
<%=intl._t("Close client tunnels after specified idle period")%></label>
</td>
<td>
</td><td>
<b><%=intl._t("Idle period")%>:</b>
<input type="text" name="closeTime" size="4" maxlength="4" title="<%=intl._t("Close Tunnel Idle Time")%>" value="<%=editBean.getCloseTime(curTunnel)%>" class="freetext period" />
minutes
</td>
</tr>
<tr>
</tr><tr>
<td colspan="2">
<b><%=intl._t("New Keys on Reopen")%>:</b>
<span class="multiOption">
@@ -464,152 +418,135 @@
</span>
</td>
</tr>
<% if ("client".equals(tunnelType) || "ircclient".equals(tunnelType) || "socksirctunnel".equals(tunnelType) || "sockstunnel".equals(tunnelType)) { %>
<%
if ("client".equals(tunnelType) || "ircclient".equals(tunnelType) || "socksirctunnel".equals(tunnelType) || "sockstunnel".equals(tunnelType)) {
%>
<tr>
<th colspan="2">
<%=intl._t("Persistent private key")%>
</th>
</tr>
<tr>
</tr><tr>
<td>
<label title="<%=intl._t("Enabling this feature will ensure your tunnel identity (destination) remains static, for services offering features based on destination e.g. IRC user authentication")%>"><input value="2" type="radio" name="newDest"
<%=(editBean.getPersistentClientKey(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
<%=intl._t("Generate key to enable persistent client tunnel identity")%></label>
</td>
<td>
</td><td>
<b><%=intl._t("File")%>:</b>
<input type="text" size="30" id="privKeyFile" name="privKeyFile" title="<%=intl._t("Path to Private Key File")%>" value="<%=editBean.getPrivateKeyFile(curTunnel)%>" class="freetext" />
</td>
</tr>
<%
<%
String destb64 = editBean.getDestinationBase64(curTunnel);
if (destb64.length() > 0) {
%>
%>
<tr>
<td colspan="2">
<b><%=intl._t("Local destination")%></b>
</td>
</tr>
<tr>
</tr><tr>
<td colspan="2">
<div class="displayText" title="<%=intl._t("Read Only: Local Destination (if known)")%>" tabindex="0" onblur="resetScrollLeft(this)"><%=destb64%></div>
</td>
</tr>
<tr>
</tr><tr>
<td colspan="2">
<b><%=intl._t("Local Base 32")%>:</b>&nbsp;
<%=editBean.getDestHashBase32(curTunnel)%>
</td>
</tr>
<%
} // if destb64
}
<% } // if destb64 %>
<% } %>
<% if ("httpclient".equals(tunnelType)) { %>
if ("httpclient".equals(tunnelType)) {
%>
<tr>
<th colspan="2">
<%=intl._t("HTTP Filtering")%>
</th>
</tr>
<tr>
</tr><tr>
<td>
<label title="<%=intl._t("When enabled, the user agent of your web browser or http client will not be spoofed, potentially reducing your anonymity")%>"><input value="1" type="checkbox" name="allowUserAgent"<%=(editBean.getAllowUserAgent(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
<%=intl._t("Do not spoof User-Agent header")%></label>
</td>
<td>
</td><td>
<label title="<%=intl._t("When enabled, the referer (originating page) of your web requests will not be filtered, potentially reducing your anonymity")%>"><input value="1" type="checkbox" name="allowReferer"<%=(editBean.getAllowReferer(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
<%=intl._t("Do not block Referer header")%></label>
</td>
</tr>
<tr>
</tr><tr>
<td>
<label title="<%=intl._t("When enabled, the accept headers (mime types support) broadcast by your web browser will not be filtered, potentially reducing your anonymity")%>"><input value="1" type="checkbox" name="allowAccept"<%=(editBean.getAllowAccept(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
<%=intl._t("Do not block Accept headers")%></label>
</td>
<td>
</td><td>
<label title="<%=intl._t("Allow SSL to I2P addresses when enabled")%>"><input value="1" type="checkbox" name="allowInternalSSL"<%=(editBean.getAllowInternalSSL(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
<%=intl._t("Allow SSL to I2P addresses")%></label>
</td>
</tr>
<% } // if httpclient %>
<%
} // if httpclient
<% if (true /* editBean.isAdvanced() */ ) {
if (true /* editBean.isAdvanced() */ ) {
int currentSigType = editBean.getSigType(curTunnel, tunnelType);
String disabled = editBean.canChangeSigType(curTunnel) ? "" : " disabled=\"disabled\" ";
%>
%>
<tr>
<th colspan="2">
<%=intl._t("Signature type")%> <%-- (<%=intl._t("Experts only!")%>) --%>
</th>
</tr>
<tr>
</tr><tr>
<td colspan="2">
<span class="multiOption">
<label title="<%=intl._t("Legacy option (deprecated), provided for backward compatibility")%>"><input value="0" type="radio" name="sigType" <%=disabled%> <%=(currentSigType==0 ? " checked=\"checked\"" : "")%> class="tickbox" />
DSA-SHA1</label>
</span>
<% if (editBean.isSigTypeAvailable(1)) { %>
<%
if (editBean.isSigTypeAvailable(1)) {
%>
<span class="multiOption">
<label><input value="1" type="radio" name="sigType" <%=disabled%> <%=(currentSigType==1 ? " checked=\"checked\"" : "")%> class="tickbox" />
ECDSA-P256</label>
</span>
<% }
if (editBean.isSigTypeAvailable(2)) { %>
<%
}
if (editBean.isSigTypeAvailable(2)) {
%>
<span class="multiOption">
<label><input value="2" type="radio" name="sigType" <%=disabled%> <%=(currentSigType==2 ? " checked=\"checked\"" : "")%> class="tickbox" />
ECDSA-P384</label>
</span>
<% }
if (editBean.isSigTypeAvailable(3)) { %>
<%
}
if (editBean.isSigTypeAvailable(3)) {
%>
<span class="multiOption">
<label><input value="3" type="radio" name="sigType" <%=disabled%> <%=(currentSigType==3 ? " checked=\"checked\"" : "")%> class="tickbox" />
ECDSA-P521</label>
</span>
<% }
if (editBean.isSigTypeAvailable(7)) { %>
<%
}
if (editBean.isSigTypeAvailable(7)) {
%>
<span class="multiOption">
<label title="<%=intl._t("This is the default, recommended option")%>"><input value="7" type="radio" name="sigType" <%=disabled%> <%=(currentSigType==7 ? " checked=\"checked\"" : "")%> class="tickbox" />
Ed25519-SHA-512</label>
</span>
</td>
</tr>
<% } // isAvailable %>
<%
} // isAvailable
<% } // isAdvanced %>
} // isAdvanced
<% if ("httpclient".equals(tunnelType) || "connectclient".equals(tunnelType) || "sockstunnel".equals(tunnelType) || "socksirctunnel".equals(tunnelType)) { %>
if ("httpclient".equals(tunnelType) || "connectclient".equals(tunnelType) || "sockstunnel".equals(tunnelType) || "socksirctunnel".equals(tunnelType)) {
%>
<tr>
<th colspan="2">
<%=intl._t("Local Authorization")%>
</th>
</tr>
<tr>
</tr><tr>
<td colspan="2">
<label title="<%=intl._t("Enable to require a username and password to access this local service (for example if hosting on a LAN)")%>"><input value="1" type="checkbox" name="proxyAuth"<%=(editBean.getProxyAuth(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
<%=intl._t("Require local authorization for this service")%></label>
</td>
</tr>
<tr>
</tr><tr>
<td>
<b><%=intl._t("Username")%>:</b>
<input type="text" name="proxyUsername" title="<%=intl._t("Set username required to access this service")%>" value="" class="freetext username" />
@@ -618,21 +555,16 @@
<b><%=intl._t("Password")%>:</b>
<input type="password" name="nofilter_proxyPassword" title="<%=intl._t("Set password required to access this service")%>" value="" class="freetext password" />
</td>
</tr>
<tr>
</tr><tr>
<th colspan="2">
<%=intl._t("Outproxy Authorization")%>
</th>
</tr>
<tr>
</tr><tr>
<td colspan="2">
<label title="<%=intl._t("Enable if the outproxy a username and password to access")%>"><input value="1" type="checkbox" id="startOnLoad" name="outproxyAuth"<%=(editBean.getOutproxyAuth(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
<%=intl._t("Outproxy requires authorization")%></label>
</td>
</tr>
<tr>
</tr><tr>
<td>
<b><%=intl._t("Username")%>:</b>
<input type="text" name="outproxyUsername" title="<%=intl._t("Enter username required by outproxy")%>" value="<%=editBean.getOutproxyUsername(curTunnel)%>" class="freetext username" />
@@ -643,37 +575,32 @@
<input type="password" name="nofilter_outproxyPassword" title="<%=intl._t("Enter password required by outproxy")%>" value="<%=editBean.getOutproxyPassword(curTunnel)%>" class="freetext password" />
</td>
</tr>
<%
} // httpclient || connect || socks || socksirc
<% } // httpclient || connect || socks || socksirc %>
<% if ("httpclient".equals(tunnelType)) { %>
if ("httpclient".equals(tunnelType)) {
%>
<tr>
<th colspan="2">
<%=intl._t("Jump URL List")%>
</th>
</tr>
<tr>
</tr><tr>
<td colspan="2">
<textarea rows="2" style="height: 8em;" cols="60" id="hostField" name="jumpList" title="<%=intl._t("List of helper URLs providing jump links when a host is not found in your addressbook")%>" wrap="off" spellcheck="false"><%=editBean.getJumpList(curTunnel)%></textarea>
</td>
</tr>
<% } // httpclient %>
<%
} // httpclient
%>
<tr>
<th colspan="2">
<%=intl._t("Custom options")%>
</th>
</tr>
<tr>
</tr><tr>
<td colspan="2">
<input type="text" id="customOptions" name="nofilter_customOptions" size="60" title="<%=intl._t("Advanced tunnel, streaming, and I2CP options")%>" value="<%=editBean.getCustomOptions(curTunnel)%>" class="freetext" spellcheck="false"/>
</td>
</tr>
<tr>
</tr><tr>
<td class="buttons" colspan="2">
<input type="hidden" value="true" name="removeConfirm" />
<button id="controlCancel" class="control" type="submit" name="action" value=""><%=intl._t("Cancel")%></button>
@@ -681,4 +608,4 @@
<button id="controlSave" class="control" type="submit" name="action" value="Save changes"><%=intl._t("Save")%></button>
</td>
</tr>
</table>
</table>

File diff suppressed because it is too large Load Diff

View File

@@ -32,9 +32,7 @@
<link href="<%=indexBean.getTheme()%>i2ptunnel.css?<%=net.i2p.CoreVersion.VERSION%>" rel="stylesheet" type="text/css" />
<% }
%>
</head>
<body id="tunnelListPage">
</head><body id="tunnelListPage">
<%
boolean isInitialized = indexBean.isInitialized();
String nextNonce = isInitialized ? net.i2p.i2ptunnel.web.IndexBean.getNextNonce() : null;
@@ -51,8 +49,7 @@
<td id="tunnelMessages">
<textarea id="statusMessages" rows="4" cols="60" readonly="readonly"><%=msgs%></textarea>
</td>
</tr>
<tr>
</tr><tr>
<td class="buttons">
<a class="control" href="list"><%=intl._t("Refresh")%></a>
<%
@@ -87,11 +84,8 @@
</tr>
</table>
</div>
<div class="panel" id="servers">
<h2><%=intl._t("I2P Hidden Services")%></h2>
<table id="serverTunnels">
<tr>
<th class="tunnelName"><%=intl._t("Name")%></th>
@@ -101,85 +95,74 @@
<th class="tunnelStatus"><%=intl._t("Status")%></th>
<th class="tunnelControl"><%=intl._t("Control")%></th>
</tr>
<%
<%
for (int curServer = 0; curServer < indexBean.getTunnelCount(); curServer++) {
if (indexBean.isClient(curServer)) continue;
%>
%>
<tr class="tunnelProperties">
<td class="tunnelName">
<a href="edit?tunnel=<%=curServer%>" title="<%=intl._t("Edit Server Tunnel Settings for")%>&nbsp;<%=indexBean.getTunnelName(curServer)%>"><%=indexBean.getTunnelName(curServer)%></a>
</td>
<td class="tunnelType"><%=indexBean.getTunnelType(curServer)%></td>
<td class="tunnelLocation">
<%
</td><td class="tunnelType"><%=indexBean.getTunnelType(curServer)%>
</td><td class="tunnelLocation">
<%
if (indexBean.isServerTargetLinkValid(curServer)) {
if (indexBean.isSSLEnabled(curServer)) { %>
<a href="https://<%=indexBean.getServerTarget(curServer)%>/" title="<%=intl._t("Test HTTPS server, bypassing I2P")%>" target="_top"><%=indexBean.getServerTarget(curServer)%> SSL</a>
<% } else { %>
<% } else { %>
<a href="http://<%=indexBean.getServerTarget(curServer)%>/" title="<%=intl._t("Test HTTP server, bypassing I2P")%>" target="_top"><%=indexBean.getServerTarget(curServer)%></a>
<%
<%
}
} else {
%><%=indexBean.getServerTarget(curServer)%>
<%
<%
if (indexBean.isSSLEnabled(curServer)) { %>
SSL
<%
<%
}
}
%>
</td>
<td class="tunnelPreview">
<%
%>
</td><td class="tunnelPreview">
<%
if (("httpserver".equals(indexBean.getInternalType(curServer)) || ("httpbidirserver".equals(indexBean.getInternalType(curServer)))) && indexBean.getTunnelStatus(curServer) == IndexBean.RUNNING) {
%>
%>
<a class="control" title="<%=intl._t("Test HTTP server through I2P")%>" href="http://<%=indexBean.getDestHashBase32(curServer)%>" target="_top"><%=intl._t("Preview")%></a>
<%
<%
} else if (indexBean.getTunnelStatus(curServer) == IndexBean.RUNNING) {
%><%=intl._t("Base32 Address")%>:<%=indexBean.getDestHashBase32(curServer)%>
<%
<%
} else {
%><%=intl._t("No Preview")%>
<%
<%
}
%>
</td>
<td class="tunnelStatus">
<%
%>
</td><td class="tunnelStatus">
<%
switch (indexBean.getTunnelStatus(curServer)) {
case IndexBean.STARTING:
%><div class="statusStarting text" title="<%=intl._t("Starting...")%>"><%=intl._t("Starting...")%></div>
</td>
<td class="tunnelControl">
</td><td class="tunnelControl">
<a class="control" title="<%=intl._t("Stop this Tunnel")%>" href="list?nonce=<%=nextNonce%>&amp;action=stop&amp;tunnel=<%=curServer%>"><%=intl._t("Stop")%></a>
<%
<%
break;
case IndexBean.RUNNING:
%><div class="statusRunning text" title="<%=intl._t("Running")%>"><%=intl._t("Running")%></div>
</td>
<td class="tunnelControl">
</td><td class="tunnelControl">
<a class="control" title="<%=intl._t("Stop this Tunnel")%>" href="list?nonce=<%=nextNonce%>&amp;action=stop&amp;tunnel=<%=curServer%>"><%=intl._t("Stop")%></a>
<%
<%
break;
case IndexBean.NOT_RUNNING:
%><div class="statusNotRunning text" title="<%=intl._t("Stopped")%>"><%=intl._t("Stopped")%></div>
</td>
<td class="tunnelControl">
</td><td class="tunnelControl">
<a class="control" title="<%=intl._t("Start this Tunnel")%>" href="list?nonce=<%=nextNonce%>&amp;action=start&amp;tunnel=<%=curServer%>"><%=intl._t("Start")%></a>
<%
<%
break;
}
%>
%>
</td>
</tr>
<tr>
</tr><tr>
<td class="tunnelDestination" colspan="6">
<span class="tunnelDestinationLabel">
<%
<%
String name = indexBean.getSpoofedHost(curServer);
if (name == null || name.equals("")) {
name = indexBean.getTunnelName(curServer);
@@ -193,35 +176,31 @@
out.write(":</b></span> ");
out.write(name);
}
%>
%>
</td>
</tr>
<%
<%
String encName = indexBean.getEncryptedBase32(curServer);
if (encName != null && encName.length() > 0) {
%>
%>
<tr>
<td class="tunnelDestination" colspan="6">
<span class="tunnelDestinationLabel"><b><%=intl._t("Encrypted")%>:</b></span>
<%=encName%>
</td>
</tr>
<%
<%
} // encName
%>
%>
<tr>
<td class="tunnelDescription" colspan="6">
<span class="tunnelDestinationLabel"><b><%=intl._t("Description")%>:</b></span>
<%=indexBean.getTunnelDescription(curServer)%>
</td>
</tr>
<%
<%
} // for loop
%>
%>
<tr>
<td class="newTunnel" colspan="6">
<form id="addNewServerTunnelForm" action="edit">
@@ -239,10 +218,8 @@
</tr>
</table>
</div>
<div class="panel" id="clients">
<h2><%=intl._t("I2P Client Tunnels")%></h2>
<table id="clientTunnels">
<tr>
<th class="tunnelName"><%=intl._t("Name")%></th>
@@ -252,21 +229,16 @@
<th class="tunnelStatus"><%=intl._t("Status")%></th>
<th class="tunnelControl"><%=intl._t("Control")%></th>
</tr>
<%
<%
for (int curClient = 0; curClient < indexBean.getTunnelCount(); curClient++) {
if (!indexBean.isClient(curClient)) continue;
%>
%>
<tr class="tunnelProperties">
<td class="tunnelName">
<a href="edit?tunnel=<%=curClient%>" title="<%=intl._t("Edit Tunnel Settings for")%>&nbsp;<%=indexBean.getTunnelName(curClient)%>"><%=indexBean.getTunnelName(curClient)%></a>
</td>
<td class="tunnelType"><%=indexBean.getTunnelType(curClient)%></td>
<td class="tunnelInterface">
<%
</td><td class="tunnelType"><%=indexBean.getTunnelType(curClient)%>
</td><td class="tunnelInterface">
<%
/* should only happen for streamr client */
String cHost= indexBean.getClientInterface(curClient);
if (cHost == null || "".equals(cHost)) {
@@ -276,62 +248,55 @@
} else {
out.write(cHost);
}
%>
</td>
<td class="tunnelPort">
<%
%>
</td><td class="tunnelPort">
<%
String cPort= indexBean.getClientPort2(curClient);
out.write(cPort);
if (indexBean.isSSLEnabled(curClient))
out.write(" SSL");
%>
</td>
<td class="tunnelStatus">
<%
%>
</td><td class="tunnelStatus">
<%
switch (indexBean.getTunnelStatus(curClient)) {
case IndexBean.STARTING:
%><div class="statusStarting text" title="<%=intl._t("Starting...")%>"><%=intl._t("Starting...")%></div>
</td>
<td class="tunnelControl">
</td><td class="tunnelControl">
<a class="control" title="<%=intl._t("Stop this Tunnel")%>" href="list?nonce=<%=nextNonce%>&amp;action=stop&amp;tunnel=<%=curClient%>"><%=intl._t("Stop")%></a>
<%
<%
break;
case IndexBean.STANDBY:
%><div class="statusStarting text" title="<%=intl._t("Standby")%>"><%=intl._t("Standby")%></div>
</td>
<td class="tunnelControl">
</td><td class="tunnelControl">
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=nextNonce%>&amp;action=stop&amp;tunnel=<%=curClient%>"><%=intl._t("Stop")%></a>
<%
<%
break;
case IndexBean.RUNNING:
%><div class="statusRunning text" title="<%=intl._t("Running")%>"><%=intl._t("Running")%></div>
</td>
<td class="tunnelControl">
</td><td class="tunnelControl">
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=nextNonce%>&amp;action=stop&amp;tunnel=<%=curClient%>"><%=intl._t("Stop")%></a>
<%
<%
break;
case IndexBean.NOT_RUNNING:
%><div class="statusNotRunning text" title="<%=intl._t("Stopped")%>"><%=intl._t("Stopped")%></div>
</td>
<td class="tunnelControl">
</td><td class="tunnelControl">
<a class="control" title="<%=intl._t("Start this Tunnel")%>" href="list?nonce=<%=nextNonce%>&amp;action=start&amp;tunnel=<%=curClient%>"><%=intl._t("Start")%></a>
<%
<%
break;
}
%>
%>
</td>
</tr>
<tr>
</tr><tr>
<td class="tunnelDestination" colspan="6">
<span class="tunnelDestinationLabel">
<% if ("httpclient".equals(indexBean.getInternalType(curClient)) || "connectclient".equals(indexBean.getInternalType(curClient)) ||
<% if ("httpclient".equals(indexBean.getInternalType(curClient)) || "connectclient".equals(indexBean.getInternalType(curClient)) ||
"sockstunnel".equals(indexBean.getInternalType(curClient)) || "socksirctunnel".equals(indexBean.getInternalType(curClient))) { %>
<b><%=intl._t("Outproxy")%>:</b>
<% } else { %>
<% } else { %>
<b><%=intl._t("Destination")%>:</b>
<% } %>
<% } %>
</span>
<%
<%
if (indexBean.getIsUsingOutproxyPlugin(curClient)) {
%><%=intl._t("internal plugin")%><%
} else {
@@ -346,16 +311,16 @@
} %>
</td>
</tr>
<% /* TODO SSL outproxy for httpclient if plugin not present */ %>
<% /* TODO SSL outproxy for httpclient if plugin not present */ %>
<tr>
<td class="tunnelDescription" colspan="6">
<span class="tunnelDescriptionLabel"><b><%=intl._t("Description")%>:</b></span>
<%=indexBean.getTunnelDescription(curClient)%>
</td>
</tr>
<%
<%
}
%>
%>
<tr>
<td class="newTunnel" colspan="6">
<form id="addNewClientTunnelForm" action="edit">
@@ -375,12 +340,9 @@
</tr>
</table>
</div>
<%
} // isInitialized()
%>
</body>
</html>
</body></html>