2012-01-21 05:30:23 +00:00
|
|
|
<%
|
|
|
|
// NOTE: Do the header carefully so there is no whitespace before the <?xml... line
|
|
|
|
|
|
|
|
%><%@page pageEncoding="UTF-8"
|
|
|
|
%><%@page contentType="text/html" import="net.i2p.i2ptunnel.web.WizardBean"
|
|
|
|
%><?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!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.WizardBean" id="wizardBean" scope="request" />
|
|
|
|
<jsp:useBean class="net.i2p.i2ptunnel.web.Messages" id="intl" scope="request" />
|
|
|
|
<% String pageStr = request.getParameter("page");
|
|
|
|
int curPage = 1;
|
|
|
|
if (pageStr != null) {
|
|
|
|
try {
|
|
|
|
curPage = Integer.parseInt(pageStr);
|
|
|
|
if (curPage > 7 || curPage <= 0) {
|
|
|
|
curPage = 1;
|
|
|
|
}
|
|
|
|
} catch (NumberFormatException nfe) {
|
|
|
|
curPage = 1;
|
|
|
|
}
|
|
|
|
}
|
2012-01-22 00:11:29 +00:00
|
|
|
boolean tunnelIsClient = wizardBean.getIsClient();
|
2012-01-22 04:23:45 +00:00
|
|
|
String tunnelType = wizardBean.getType();
|
2012-01-21 05:30:23 +00:00
|
|
|
%>
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
|
|
<head>
|
|
|
|
<title><%=intl._("I2P Tunnel Manager - Tunnel Creation Wizard")%></title>
|
|
|
|
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
|
|
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
|
|
|
|
<link href="/themes/console/images/favicon.ico" type="image/x-icon" rel="shortcut icon" />
|
|
|
|
|
|
|
|
<% if (wizardBean.allowCSS()) {
|
|
|
|
%><link href="<%=wizardBean.getTheme()%>default.css" rel="stylesheet" type="text/css" />
|
|
|
|
<link href="<%=wizardBean.getTheme()%>i2ptunnel.css" rel="stylesheet" type="text/css" />
|
|
|
|
<% }
|
|
|
|
%>
|
|
|
|
</head>
|
|
|
|
<body id="tunnelWizardPage">
|
|
|
|
<div id="pageHeader">
|
|
|
|
</div>
|
|
|
|
|
2012-01-22 00:11:29 +00:00
|
|
|
<form method="post" action="<%=(curPage == 7 ? "list" : "wizard") %>">
|
2012-01-21 05:30:23 +00:00
|
|
|
|
|
|
|
<div id="wizardPanel" class="panel">
|
|
|
|
<div class="header">
|
|
|
|
<%
|
|
|
|
if (curPage == 1) {
|
2012-01-22 00:11:29 +00:00
|
|
|
%><h4><%=intl._("Server or client tunnel?")%></h4><%
|
|
|
|
} else if (curPage == 2) {
|
|
|
|
%><h4><%=intl._("Tunnel type")%></h4><%
|
|
|
|
} else if (curPage == 3) {
|
|
|
|
%><h4><%=intl._("Tunnel name and description")%></h4><%
|
|
|
|
} else if (curPage == 4 && tunnelIsClient) {
|
|
|
|
%><h4><%=intl._("Tunnel destination")%></h4><%
|
|
|
|
} else if (curPage == 5) {
|
|
|
|
%><h4><%=intl._("Binding address and port")%></h4><%
|
|
|
|
} else if (curPage == 6) {
|
|
|
|
%><h4><%=intl._("Tunnel auto-start")%></h4><%
|
|
|
|
} else if (curPage == 7) {
|
|
|
|
%><h4><%=intl._("Wizard completed")%></h4><%
|
2012-01-21 05:30:23 +00:00
|
|
|
} %>
|
|
|
|
<input type="hidden" name="page" value="<%=request.getParameter("page")%>" />
|
2012-01-22 00:21:13 +00:00
|
|
|
<input type="hidden" name="tunnel" value="null" />
|
2012-01-21 05:30:23 +00:00
|
|
|
<input type="hidden" name="nonce" value="<%=wizardBean.getNextNonce()%>" />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="separator">
|
|
|
|
<hr />
|
|
|
|
</div>
|
|
|
|
|
2012-01-25 00:06:18 +00:00
|
|
|
<% /* Page 1 - Whether to make a client or server tunnel */
|
|
|
|
|
2012-01-21 05:30:23 +00:00
|
|
|
if (curPage == 1) {
|
|
|
|
%><div id="typeField" class="rowItem">
|
|
|
|
<label><%=intl._("Server Tunnel")%></label>
|
|
|
|
<input value="0" type="radio" id="baseType" name="isClient" class="tickbox" />
|
|
|
|
<label><%=intl._("Client Tunnel")%></label>
|
|
|
|
<input value="1" type="radio" id="baseType" name="isClient" class="tickbox" />
|
|
|
|
</div><%
|
|
|
|
} else {
|
2012-01-22 00:11:29 +00:00
|
|
|
%><input type="hidden" name="isClient" value="<%=tunnelIsClient%>" /><%
|
2012-01-25 00:06:18 +00:00
|
|
|
} /* curPage 1 */
|
|
|
|
|
|
|
|
/* End page 1 */ %>
|
|
|
|
|
|
|
|
<% /* Page 2 - Tunnel type */
|
2012-01-22 00:11:29 +00:00
|
|
|
|
2012-01-22 02:44:51 +00:00
|
|
|
if (curPage == 2) {
|
2012-01-22 00:11:29 +00:00
|
|
|
%><div id="typeField" class="rowItem">
|
2012-01-22 02:44:51 +00:00
|
|
|
<%
|
|
|
|
if (tunnelIsClient) {
|
2012-01-22 00:11:29 +00:00
|
|
|
%><select name="type">
|
|
|
|
<option value="client"><%=intl._("Standard")%></option>
|
|
|
|
<option value="httpclient">HTTP</option>
|
|
|
|
<option value="ircclient">IRC</option>
|
|
|
|
<option value="sockstunnel">SOCKS 4/4a/5</option>
|
|
|
|
<option value="socksirctunnel">SOCKS IRC</option>
|
|
|
|
<option value="connectclient">CONNECT</option>
|
|
|
|
<option value="streamrclient">Streamr</option>
|
|
|
|
</select><%
|
|
|
|
} else {
|
|
|
|
%><select name="type">
|
|
|
|
<option value="server"><%=intl._("Standard")%></option>
|
|
|
|
<option value="httpserver">HTTP</option>
|
|
|
|
<option value="httpbidirserver">HTTP bidir</option>
|
|
|
|
<option value="ircserver">IRC</option>
|
|
|
|
<option value="streamrserver">Streamr</option>
|
|
|
|
</select><%
|
2012-01-22 02:44:51 +00:00
|
|
|
} /* tunnelIsClient */ %>
|
2012-01-22 00:11:29 +00:00
|
|
|
</div><%
|
|
|
|
} else {
|
2012-01-22 04:23:45 +00:00
|
|
|
%><input type="hidden" name="type" value="<%=tunnelType%>" /><%
|
2012-01-25 00:06:18 +00:00
|
|
|
} /* curPage 2 */
|
|
|
|
|
|
|
|
/* End page 2 */ %>
|
|
|
|
|
|
|
|
<% /* Page 3 - Name and description */
|
2012-01-22 02:37:39 +00:00
|
|
|
|
2012-01-22 02:44:51 +00:00
|
|
|
if (curPage == 3) {
|
2012-01-22 02:37:39 +00:00
|
|
|
%><div id="nameField" class="rowItem">
|
|
|
|
<label for="name" accesskey="N">
|
|
|
|
<%=intl._("Name")%>:(<span class="accessKey">N</span>)
|
|
|
|
</label>
|
|
|
|
<input type="text" size="30" maxlength="50" name="name" id="name" title="Tunnel Name" value="" class="freetext" />
|
|
|
|
</div>
|
|
|
|
<div id="descriptionField" class="rowItem">
|
|
|
|
<label for="description" accesskey="e">
|
|
|
|
<%=intl._("Description")%>:(<span class="accessKey">E</span>)
|
|
|
|
</label>
|
|
|
|
<input type="text" size="60" maxlength="80" name="description" id="description" title="Tunnel Description" value="" class="freetext" />
|
|
|
|
</div><%
|
|
|
|
} else {
|
|
|
|
%><input type="hidden" name="name" value="<%=wizardBean.getName()%>" />
|
|
|
|
<input type="hidden" name="description" value="<%=wizardBean.getDescription()%>" /><%
|
2012-01-25 00:06:18 +00:00
|
|
|
} /* curPage 3 */
|
|
|
|
|
|
|
|
/* End page 3 */ %>
|
|
|
|
|
|
|
|
<% /* Page 4 - Target destination or proxy list */
|
2012-01-21 05:30:23 +00:00
|
|
|
|
2012-01-22 04:23:45 +00:00
|
|
|
if (tunnelIsClient) {
|
2012-01-22 22:03:26 +00:00
|
|
|
if ("httpclient".equals(tunnelType) || "connectclient".equals(tunnelType) || "sockstunnel".equals(tunnelType) || "socksirctunnel".equals(tunnelType)) {
|
|
|
|
if (curPage == 4) {
|
2012-01-22 04:23:45 +00:00
|
|
|
%><div id="destinationField" class="rowItem">
|
|
|
|
<label for="proxyList" accesskey="x">
|
|
|
|
<%=intl._("Outproxies")%>(<span class="accessKey">x</span>):
|
|
|
|
</label>
|
|
|
|
<input type="text" size="30" id="proxyList" name="proxyList" title="List of Outproxy I2P destinations" value="" class="freetext" />
|
|
|
|
</div><%
|
2012-01-22 22:03:26 +00:00
|
|
|
} else {
|
|
|
|
%><input type="hidden" name="proxyList" value="<%=wizardBean.getProxyList()%>" /><%
|
|
|
|
} /* curPage 4 */
|
|
|
|
} else if ("client".equals(tunnelType) || "ircclient".equals(tunnelType) || "streamrclient".equals(tunnelType)) {
|
|
|
|
if (curPage == 4) {
|
2012-01-22 04:23:45 +00:00
|
|
|
%><div id="destinationField" class="rowItem">
|
|
|
|
<label for="targetDestination" accesskey="T">
|
|
|
|
<%=intl._("Tunnel Destination")%>(<span class="accessKey">T</span>):
|
|
|
|
</label>
|
|
|
|
<input type="text" size="30" id="targetDestination" name="targetDestination" title="Destination of the Tunnel" value="" class="freetext" />
|
|
|
|
<span class="comment">(<%=intl._("name or destination")%>; <%=intl._("b32 not recommended")%>)</span>
|
|
|
|
</div><%
|
2012-01-22 22:03:26 +00:00
|
|
|
} else {
|
2012-01-22 04:23:45 +00:00
|
|
|
%><input type="hidden" name="targetDestination" value="<%=wizardBean.getTargetDestination()%>" /><%
|
2012-01-22 22:03:26 +00:00
|
|
|
} /* curPage 4 */
|
|
|
|
}
|
2012-01-25 00:06:18 +00:00
|
|
|
} /* tunnelIsClient */
|
|
|
|
|
|
|
|
/* End page 4 */ %>
|
2012-01-23 01:09:17 +00:00
|
|
|
|
|
|
|
<% /* Page 5 - Binding ports and addresses*/
|
|
|
|
|
|
|
|
if ((tunnelIsClient && "streamrclient".equals(tunnelType)) || !"streamrserver".equals(tunnelType)) {
|
|
|
|
if (curPage == 5) {
|
|
|
|
%><div id="hostField" class="rowItem">
|
|
|
|
<label for="targetHost" accesskey="H">
|
|
|
|
<%=intl._("Host")%>(<span class="accessKey">H</span>):
|
|
|
|
</label>
|
|
|
|
<input type="text" size="20" id="targetHost" name="targetHost" title="Target Hostname or IP" value="" class="freetext" />
|
|
|
|
</div><%
|
|
|
|
} else {
|
|
|
|
%><input type="hidden" name="targetHost" value="<%=wizardBean.getTargetHost()%>" /><%
|
|
|
|
} /* curPage 5 */
|
|
|
|
} /* streamrclient or !streamrserver */ %>
|
|
|
|
<%
|
|
|
|
if (!tunnelIsClient) {
|
|
|
|
if (curPage == 5) {
|
|
|
|
%><div id="portField" class="rowItem">
|
|
|
|
<label for="targetPort" accesskey="P">
|
|
|
|
</label>
|
|
|
|
<input type="text" size="6" maxlength="5" id="targetPort" name="targetPort" title="Target Port Number" value="" class="freetext" />
|
|
|
|
</div><%
|
|
|
|
} else {
|
|
|
|
%><input type="hidden" name="targetPort" value="<%=wizardBean.getTargetPort()%>" /><%
|
|
|
|
} /* curPage 5 */
|
|
|
|
} /* !tunnelIsClient */ %>
|
|
|
|
<%
|
|
|
|
if (tunnelIsClient || "httpbidirserver".equals(tunnelType)) {
|
|
|
|
if (curPage == 5) {
|
|
|
|
%><div id="portField" class="rowItem">
|
|
|
|
<label for="port" accesskey="P">
|
|
|
|
<span class="accessKey">P</span>ort:
|
|
|
|
</label>
|
|
|
|
<input type="text" size="6" maxlength="5" id="port" name="port" title="Access Port Number" value="" class="freetext" />
|
|
|
|
</div><%
|
|
|
|
} else {
|
|
|
|
%><input type="hidden" name="port" value="<%=wizardBean.getPort()%>" /><%
|
|
|
|
} /* curPage 5 */
|
|
|
|
} /* tunnelIsClient or httpbidirserver */ %>
|
|
|
|
<%
|
|
|
|
if ((tunnelIsClient && !"streamrclient".equals(tunnelType)) || "httpbidirserver".equals(tunnelType) || "streamrserver".equals(tunnelType)) {
|
|
|
|
if (curPage == 5) {
|
|
|
|
%><div id="reachField" class="rowItem">
|
|
|
|
<label for="reachableBy" accesskey="r">
|
|
|
|
<%=intl._("Reachable by")%>(<span class="accessKey">R</span>):
|
|
|
|
</label>
|
|
|
|
<select id="reachableBy" name="reachableBy" title="IP for Client Access" class="selectbox">
|
|
|
|
<%
|
|
|
|
for (String ifc : wizardBean.interfaceSet()) {
|
|
|
|
out.write("<option value=\"");
|
|
|
|
out.write(ifc);
|
|
|
|
out.write('\"');
|
|
|
|
if (ifc.equals("127.0.0.1"))
|
|
|
|
out.write(" selected=\"selected\"");
|
|
|
|
out.write('>');
|
|
|
|
out.write(ifc);
|
|
|
|
out.write("</option>\n");
|
|
|
|
}
|
|
|
|
%>
|
|
|
|
</select>
|
|
|
|
</div><%
|
|
|
|
} else {
|
|
|
|
%><input type="hidden" name="reachableBy" value="<%=wizardBean.getReachableBy()%>" /><%
|
|
|
|
} /* curPage 5 */
|
2012-01-25 00:06:18 +00:00
|
|
|
} /* (tunnelIsClient && !streamrclient) || httpbidirserver || streamrserver */
|
|
|
|
|
|
|
|
/* End page 5 */ %>
|
2012-01-25 01:12:17 +00:00
|
|
|
|
|
|
|
<% /* Page 6 - Automatic start */
|
|
|
|
|
|
|
|
if (curPage == 6) {
|
|
|
|
%><div id="startupField" class="rowItem">
|
|
|
|
<label for="startOnLoad" accesskey="a">
|
|
|
|
<%=intl._("Auto Start")%>(<span class="accessKey">A</span>):
|
|
|
|
</label>
|
|
|
|
<input value="1" type="checkbox" id="startOnLoad" name="startOnLoad" title="Start Tunnel Automatically" class="tickbox" />
|
|
|
|
<span class="comment"><%=intl._("(Check the Box for 'YES')")%></span>
|
|
|
|
</div><%
|
|
|
|
} else {
|
|
|
|
%><input type="hidden" name="startOnLoad" value="<%=wizardBean.getStartOnLoad()%>" /><%
|
|
|
|
} /* curPage 6 */
|
|
|
|
|
|
|
|
/* End page 6 */ %>
|
2012-01-22 04:23:45 +00:00
|
|
|
</div>
|
|
|
|
|
2012-01-21 05:30:23 +00:00
|
|
|
<div id="globalOperationsPanel" class="panel">
|
|
|
|
<div class="header"></div>
|
|
|
|
<div class="footer">
|
|
|
|
<div class=toolbox">
|
|
|
|
<button id="controlCancel" class="control" type="submit" name="action" value="" title="Cancel"><%=intl._("Cancel")%></button>
|
2012-01-22 00:11:29 +00:00
|
|
|
<% if (curPage == 7) {
|
|
|
|
%><button id="controlNext" accesskey="N" class="control" type="submit" name="action" value="Next page" title="Next Page"><%=intl._("Next")%>(<span class="accessKey">N</span>)</button><%
|
|
|
|
} else {
|
|
|
|
%><button id="controlFinish" accesskey="F" class="control" type="submit" name="action" value="Finish wizard" title="Finish Wizard"><%=intl._("Finish")%>(<span class="accessKey">F</span>)</button><%
|
|
|
|
} %>
|
2012-01-21 05:30:23 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<div id="pageFooter">
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|