<% String tunnelTypeName; String tunnelType; if (curTunnel >= 0) { tunnelTypeName = editBean.getTunnelType(curTunnel); tunnelType = editBean.getInternalType(curTunnel); %>

<%=intl._t("Edit Server Settings")%> (<%=editBean.getTunnelName(curTunnel)%>)

<% } else { tunnelTypeName = editBean.getTypeName(request.getParameter("type")); tunnelType = net.i2p.data.DataHelper.stripHTML(request.getParameter("type")); %>

<%=intl._t("New Server Settings")%>

<% } %> <% // 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) { %> <% } key = editBean.getKey2(curTunnel); if (key != null && key.length() > 0) { %> <% } key = editBean.getKey3(curTunnel); if (key != null && key.length() > 0) { %> <% } key = editBean.getKey4(curTunnel); if (key != null && key.length() > 0) { %> <% } %> <% String stopFirst = intl._t("The hidden service must be stopped to change this setting"); String tstopFirst = " title=\"" + stopFirst + "\" "; boolean canChangeDest = editBean.canChangePort(curTunnel); boolean isStreamrServer = "streamrserver".equals(tunnelType); boolean isBidirServer = "httpbidirserver".equals(tunnelType); boolean canChangePort = canChangeDest || !(isStreamrServer || isBidirServer); String phdisabled = canChangePort ? "" : tstopFirst; %> <% if (!isStreamrServer) { %> <% } /* !streamrserver */ %> <% if (isBidirServer) { %> <% } /* httpbidirserver */ if (isBidirServer || isStreamrServer) { %> <% } /* httpbidirserver || streamrserver */ %> <% if ("httpserver".equals(tunnelType) || isBidirServer) { %> <% } %> <% /****** if ("httpserver".equals(tunnelType) || isBidirServer) { String sig = editBean.getNameSignature(curTunnel); if (sig.length() > 0) { %>
<%=intl._t("Hostname Signature")%> " value="<%=sig%>" wrap="off" class="freetext" />
<% } // sig } // type ****/ String b64 = editBean.getDestinationBase64(curTunnel); 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; if (!"".equals(b64)) { %> <% b64 = b64.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")) { %> <% } else { %> <% } // name %> <% } // b64 %>
<%=intl._t("Name")%> <%=intl._t("Type")%>
" value="<%=editBean.getTunnelName(curTunnel)%>" class="freetext tunnelName" /> <%=tunnelTypeName%>
<%=intl._t("Description")%> <%=intl._t("Auto Start Tunnel")%>
" value="<%=editBean.getTunnelDescription(curTunnel)%>" class="freetext tunnelDescriptionText" />
> <% if (isStreamrServer) { %> <%=intl._t("Access Point")%> <% } else { %> <%=intl._t("Target")%> <% } %>
<%=intl._t("Host")%>: " value="<%=editBean.getTargetHost(curTunnel)%>" class="freetext host" /> <%=intl._t("Port")%>: <% String value = editBean.getTargetPort(curTunnel); if (value == null || "".equals(value.trim())) { out.write(" ("); out.write(intl._t("required")); out.write(")"); } String asphelp = intl._t("Specify the local port this service should be accessible from"); String bsphelp = intl._t("Specify the port the server is running on"); String ptext = canChangePort ? (isStreamrServer ? asphelp : bsphelp) : stopFirst; String pdisabled = canChangePort ? "" : " readonly=\"readonly\" "; %> /> <% if (!isStreamrServer) { %> <% } /* !streamrserver */ %>
> <%=intl._t("Access Point")%>
<%=intl._t("Port")%>: <% String value4 = editBean.getClientPort(curTunnel); if (value4 == null || "".equals(value4.trim())) { out.write(" ("); out.write(intl._t("required")); out.write(")"); } String csphelp = intl._t("Port required to access service (this can be a different port to the port the service is hosted on)"); String dsphelp = canChangePort ? csphelp : stopFirst; %> /> <%=intl._t("Reachable by")%>: <% String esphelp = intl._t("Listening interface (IP address) for client access (normally 127.0.0.1)"); String fsphelp = canChangePort ? esphelp : stopFirst; %>
<%=intl._t("Website Hostname")%>
" value="<%=editBean.getSpoofedHost(curTunnel)%>" class="freetext" /> <%=intl._t("(leave blank for outproxies)")%>
<%=intl._t("Local destination")%> <% String dhdisable = canChangeDest ? "" : tstopFirst; %> > <%=intl._t("Private key file")%>
" tabindex="0"><%=editBean.getDestinationBase64(curTunnel)%>
<% String value3 = editBean.getPrivateKeyFile(curTunnel); if (value3 == null || "".equals(value3.trim())) { out.write(" ("); out.write(intl._t("required")); out.write(")"); } String htext = intl._t("Path to Private Key File"); String dtext = canChangeDest ? htext : stopFirst; String ddisabled = canChangeDest ? "" : " readonly=\"readonly\" "; %> />
<% if (hasImagegen) { %> " href="/imagegen/qr?s=320&t=<%=name%>&c=http%3a%2f%2f<%=name%>%2f%3fi2paddresshelper%3d<%=b64%>" target="_top"><%=intl._t("Generate QR Code")%> <% } if (hasSusiDNS) { %> " href="/susidns/addressbook.jsp?book=private&hostname=<%=name%>&destination=<%=b64%>#add"><%=intl._t("Add to local addressbook")%> <% } %> " href="register?tunnel=<%=curTunnel%>"><%=intl._t("Registration Authentication")%> <% if ("httpserver".equals(tunnelType) || isBidirServer) { %> " href="ssl?tunnel=<%=curTunnel%>"><%=intl._t("SSL Wizard")%> <% } %> <%=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")%>

<%=intl._t("Advanced networking options")%>

<% if (editBean.isAdvanced()) { %><% } // isAdvanced() %> <% if (editBean.isAdvanced()) { // repeat two options above for outbound %> <% } // isAdvanced() End outbound config section %>
<%=intl._t("Tunnel Length Options")%>
<%=intl._t("Inbound")%>
<%=intl._t("Length")%> <%=intl._t("Variance")%>
<%=intl._t("Outbound")%>
<%=intl._t("Length")%> <%=intl._t("Variance")%>
<% if (editBean.isAdvanced()) { %><% } // isAdvanced() %> <% if (editBean.isAdvanced()) { // repeat two options above for outbound %> <% } // isAdvanced() End outbound config section %> <% boolean canChangeEncType = editBean.canChangeEncType(curTunnel); String ehdisabled = canChangeEncType ? "" : tstopFirst; // TODO, encrypted + offline is unimplemented if (!editBean.getIsOfflineKeys(curTunnel)) { %>
<%=intl._t("Tunnel Quantity Options")%>
<%=intl._t("Inbound")%>
<%=intl._t("Count")%> <%=intl._t("Backup Count")%>
<%=intl._t("Outbound")%>
<%=intl._t("Count")%> <%=intl._t("Backup Count")%>
<% 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 clientAuths = editBean.getClientAuths(curTunnel, dhClient); if (!clientAuths.isEmpty()) { %> <% 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); } %> <% i++; } // for } // isEmpty %> <% } // pskClient || dhClient } // allowBlinding } // !isOffline %> <% /***************** %> <% **********************/ int currentSigType = editBean.getSigType(curTunnel, tunnelType); String tooLate = intl._t("Configuration cannot be changed after destination is created"); String tTooLate = " title=\"" + tooLate + "\" "; boolean canChangeSigType = editBean.canChangeSigType(curTunnel); String shdisabled = canChangeSigType ? "" : tTooLate; String disabled = canChangeSigType ? "" : " disabled=\"disabled\" "; %> <% boolean has0 = editBean.hasEncType(curTunnel, 0); boolean has4 = editBean.hasEncType(curTunnel, 4); String edisabled = canChangeEncType ? "" : " disabled=\"disabled\" "; %> <% /* alternate dest, only if current dest is set and is DSA_SHA1 */ if (currentSigType == 0 && !"".equals(b64) && !isStreamrServer) { %> <% String ab64 = editBean.getAltDestinationBase64(curTunnel); if (!"".equals(ab64)) { %> <% 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")) { %> <% } else { %> <% } // name } // ab64 } // currentSigType %>
<%=intl._t("Tunnel Cryptography Options")%>
<%=intl._t("Encrypt Leaseset")%>
<% String curEncryptMode = editBean.getEncryptMode(curTunnel); String cdisabled = canChangeEncType ? "" : " disabled=\"disabled\" "; %>
<% if (allowBlinding /* && editBean.isAdvanced() */) { %> <%=intl._t("Optional lookup password")%>: <% } // allowBlinding %> <% // 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) { %> <%=intl._t("Encryption Key")%> <% } // showSharedKey %>
<% if (allowBlinding /* && editBean.isAdvanced() */) { String pwTitle = "title=\"" + (canChangeEncType ? intl._t("Set password required to access this service") : stopFirst) + '"'; %> value="<%=editBean.getBlindedPassword(curTunnel)%>" class="freetext password" <%=bidisabled%>/> <% } // allowBlinding %> " size="44" id="leasesetKey" name="encryptKey" title="<%=intl._t("Encryption key required to access this service")%>" readonly="readonly" value="<%=editBean.getEncryptKey(curTunnel)%>" class="freetext"/>
<%=intl._t("Revoke")%>    <%=intl._t("Client Name")%><%=intl._t("Client Key")%>
<%=intl._t("Add")%>    <%=intl._t("Client Name")%> <% if (dhClient) { %> <%=intl._t("Client Key")%> <% } // dhClient %>
" size="44" name="nofilter_newClientName" class="freetext" /> <% if (dhClient) { %> <% } // dhClient %>
<%=intl._t("New Certificate type")%>
" value="<%=editBean.getEffort(curTunnel)%>" class="freetext" />
<%=intl._t("Hashcash Calc Time")%> <%=intl._t("Hidden")%>
"<%=(editBean.getCert(curTunnel)==2 ? " checked=\"checked\"" : "")%> class="tickbox" />
<%=intl._t("Signed Certificate")%>
" value="<%=editBean.getSigner(curTunnel)%>" class="freetext" />
<%=intl._t("Modify Certificate")%> <%=intl._t("(Tunnel must be stopped first)")%>
> <%=intl._t("Signature type")%>
> <%=intl._t("Encryption types")%>
> > >
<%=intl._t("Alternate private key file")%> (Ed25519-SHA-512)
" value="<%=editBean.getAltPrivateKeyFile(curTunnel)%>" />
<%=intl._t("Alternate local destination")%>
"><%=ab64%>
<%=editBean.getAltDestHashBase32(curTunnel)%>
<% if (hasImagegen) { %> " href="/imagegen/qr?s=320&t=<%=name%>&c=http%3a%2f%2f<%=name%>%2f%3fi2paddresshelper%3d<%=ab64%>" target="_top"><%=intl._t("Generate QR Code")%> <% } if (hasSusiDNS) { %> " href="/susidns/addressbook.jsp?book=private&hostname=<%=name%>&destination=<%=ab64%>#add"><%=intl._t("Add to local addressbook")%> <% } %>
<%=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")%>
<% if ("httpserver".equals(tunnelType) || isBidirServer) { %> <% } // httpserver %>
<%=intl._t("Tunnel Access Control Options")%>
<%=intl._t("Restricted Access List")%>
<%=intl._t("Access List Description")%> (<%=intl._t("Specify clients, 1 per line")%>)
<%=intl._t("Filter Definition File")%>
<%=intl._t("You can define an advanced filter for this tunnel.")%> (<%=intl._t("Format Specification")%>)
<%=intl._t("Server Access Options")%>
" value="<%=editBean.getUserAgents(curTunnel)%>" class="freetext" />
<% if (!isStreamrServer) { %> <% } /* !streamrserver */ %> <% if ("httpserver".equals(tunnelType) || isBidirServer) { %> <% } // httpserver %> <% if (!editBean.isRouterContext()) { %>
<%=intl._t("Tunnel Performance Options")%>
<%=intl._t("Profile")%>
<%=intl._t("Reduce tunnel quantity when idle")%>
<%=intl._t("Reduced tunnel count")%>: " value="<%=editBean.getReduceCount(curTunnel)%>" class="freetext quantity" /> <%=intl._t("Idle period")%>: " value="<%=editBean.getReduceTime(curTunnel)%>" class="freetext period" /> <%=intl._t("minutes")%>
<%=intl._t("Server Throttling")%>
<%=intl._t("Inbound connection limits (0=unlimited)")%>
<%=intl._t("Per Minute")%> <%=intl._t("Per Hour")%> <%=intl._t("Per Day")%>
<%=intl._t("Per Client")%> " value="<%=editBean.getLimitMinute(curTunnel)%>" class="freetext" /> " value="<%=editBean.getLimitHour(curTunnel)%>" class="freetext" /> " value="<%=editBean.getLimitDay(curTunnel)%>" class="freetext" />
<%=intl._t("Total")%> " value="<%=editBean.getTotalMinute(curTunnel)%>" class="freetext" /> " value="<%=editBean.getTotalHour(curTunnel)%>" class="freetext" /> " value="<%=editBean.getTotalDay(curTunnel)%>" class="freetext" />
<%=intl._t("Max concurrent connections (0=unlimited)")%>
" value="<%=editBean.getMaxStreams(curTunnel)%>" class="freetext" />
<%=intl._t("POST limits (0=unlimited)")%>
<%=intl._t("Per Period")%> <%=intl._t("Ban Duration")%>
<%=intl._t("Per Client")%> " value="<%=editBean.getPostMax(curTunnel)%>" class="freetext quantity"/> " value="<%=editBean.getPostBanTime(curTunnel)%>" class="freetext period"/> <%=intl._t("minutes")%>
<%=intl._t("Total")%> " value="<%=editBean.getPostTotalMax(curTunnel)%>" class="freetext quantity"/> " value="<%=editBean.getPostTotalBanTime(curTunnel)%>" class="freetext period"/> <%=intl._t("minutes")%>
<%=intl._t("POST limit period")%> " value="<%=editBean.getPostCheckTime(curTunnel)%>" class="freetext period"/> <%=intl._t("minutes")%>
<% } // !isRouterContext %>
<%=intl._t("Router I2CP Address")%>
<%=intl._t("Host")%>: " value="<%=editBean.getI2CPHost(curTunnel)%>" class="freetext" /> <%=intl._t("Port")%>: " value="<%=editBean.getI2CPPort(curTunnel)%>" class="freetext" />
<%=intl._t("Custom options")%>
" value="<%=editBean.getCustomOptions(curTunnel)%>" />