2011-03-21 14:27:46 +00:00
|
|
|
<%
|
|
|
|
// NOTE: Do the header carefully so there is no whitespace before the <?xml... line
|
|
|
|
|
2020-05-11 17:12:12 +00:00
|
|
|
String cspNonce = Integer.toHexString(net.i2p.util.RandomSource.getInstance().nextInt());
|
|
|
|
|
2012-05-13 13:05:17 +00:00
|
|
|
response.setHeader("X-Frame-Options", "SAMEORIGIN");
|
2014-10-04 13:54:09 +00:00
|
|
|
// edit pages need script for the delete button 'are you sure'
|
2020-05-11 17:12:12 +00:00
|
|
|
response.setHeader("Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'nonce-" + cspNonce + "'; form-action 'self'; frame-ancestors 'self'; object-src 'none'; media-src 'none'");
|
2014-07-26 09:32:26 +00:00
|
|
|
response.setHeader("X-XSS-Protection", "1; mode=block");
|
2016-02-25 14:56:06 +00:00
|
|
|
response.setHeader("X-Content-Type-Options", "nosniff");
|
2016-12-23 12:35:41 +00:00
|
|
|
response.setHeader("Referrer-Policy", "no-referrer");
|
2018-03-09 16:02:00 +00:00
|
|
|
response.setHeader("Accept-Ranges", "none");
|
2012-05-13 13:05:17 +00:00
|
|
|
|
2011-03-21 14:27:46 +00:00
|
|
|
%><%@page pageEncoding="UTF-8"
|
2012-01-10 13:21:35 +00:00
|
|
|
%><%@page trimDirectiveWhitespaces="true"
|
2011-03-21 14:27:46 +00:00
|
|
|
%><%@page contentType="text/html" import="net.i2p.i2ptunnel.web.EditBean"
|
|
|
|
%><%
|
2018-01-17 16:51:55 +00:00
|
|
|
boolean __isClient = false;
|
|
|
|
boolean __invalid = false;
|
|
|
|
int curTunnel = -1;
|
2005-11-12 02:38:55 +00:00
|
|
|
String tun = request.getParameter("tunnel");
|
2014-10-04 13:54:09 +00:00
|
|
|
if (tun != null) {
|
2005-11-12 02:38:55 +00:00
|
|
|
try {
|
2018-01-17 16:51:55 +00:00
|
|
|
curTunnel = Integer.parseInt(tun);
|
|
|
|
__isClient = EditBean.staticIsClient(curTunnel);
|
2005-11-12 02:38:55 +00:00
|
|
|
} catch (NumberFormatException nfe) {
|
2018-01-17 16:51:55 +00:00
|
|
|
__invalid = true;
|
2005-11-12 02:38:55 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
String type = request.getParameter("type");
|
2018-01-17 16:51:55 +00:00
|
|
|
__isClient = EditBean.isClient(type);
|
|
|
|
}
|
|
|
|
%><?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.EditBean" id="editBean" scope="request" />
|
2018-04-14 18:54:17 +00:00
|
|
|
<jsp:useBean class="net.i2p.i2ptunnel.ui.Messages" id="intl" scope="request" />
|
2018-01-17 16:51:55 +00:00
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
|
|
<head>
|
2018-01-18 09:06:34 +00:00
|
|
|
<title><%=intl._t("Hidden Services Manager")%> - <%=(__isClient ? intl._t("Edit Client Tunnel") : intl._t("Edit Hidden Service"))%></title>
|
2018-01-17 16:51:55 +00:00
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
|
|
<link href="/themes/console/images/favicon.ico" type="image/x-icon" rel="shortcut icon" />
|
2020-05-09 12:42:44 +00:00
|
|
|
<link rel="icon" href="<%=editBean.getTheme()%>images/favicon.ico" />
|
2018-01-17 16:51:55 +00:00
|
|
|
<link href="<%=editBean.getTheme()%>i2ptunnel.css?<%=net.i2p.CoreVersion.VERSION%>" rel="stylesheet" type="text/css" />
|
|
|
|
<style type='text/css'>
|
2020-05-11 17:12:12 +00:00
|
|
|
input.default { width: 1px; height: 1px; visibility: hidden; }
|
2018-01-17 16:51:55 +00:00
|
|
|
</style>
|
2020-04-17 15:53:10 +00:00
|
|
|
<script src="/js/resetScroll.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script>
|
|
|
|
<script src="js/tableSlider.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script>
|
2020-05-11 17:12:12 +00:00
|
|
|
<script nonce="<%=cspNonce%>" type="text/javascript">
|
|
|
|
var deleteMessage = "<%=intl._t("Are you sure you want to delete?")%>";
|
|
|
|
</script>
|
|
|
|
<script src="js/delete.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script>
|
2018-01-17 16:51:55 +00:00
|
|
|
</head>
|
|
|
|
<body id="tunnelEditPage">
|
|
|
|
<%
|
|
|
|
if (__invalid) {
|
|
|
|
%>Invalid tunnel parameter<%
|
|
|
|
} else {
|
|
|
|
if (editBean.isInitialized()) {
|
2018-01-17 17:46:18 +00:00
|
|
|
%>
|
|
|
|
<form method="post" action="list">
|
|
|
|
<div class="panel">
|
|
|
|
<%
|
2018-01-17 16:51:55 +00:00
|
|
|
if (__isClient) {
|
|
|
|
%><%@include file="editClient.jsi" %><%
|
|
|
|
} else {
|
|
|
|
%><%@include file="editServer.jsi" %><%
|
|
|
|
}
|
2018-01-17 17:46:18 +00:00
|
|
|
%>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<%
|
2018-01-17 16:51:55 +00:00
|
|
|
} else {
|
|
|
|
%><div id="notReady"><%=intl._t("Tunnels not initialized yet; please retry in a few moments.")%></div><%
|
|
|
|
} // isInitialized()
|
2005-11-12 02:38:55 +00:00
|
|
|
}
|
2009-01-23 01:22:14 +00:00
|
|
|
%>
|
2018-01-17 16:51:55 +00:00
|
|
|
</body>
|
|
|
|
</html>
|