Skip to content

Commit

Permalink
remove old description for proxy port settings (Settings_p.html?page=…
Browse files Browse the repository at this point in the history
…ProxyAccess)

- The options were not current (only port number accepted, which is part of ConfigBasic.html)
- Deleted options and the port number input field from the proxyaccess page.
- joined both transparent proxy setup pages (Settings_Http.inc & Settings_ProxyAccess.inc) in one page
- adjustments to the related/linked pages
  • Loading branch information
reger committed Aug 20, 2014
1 parent e4e1bde commit e033e79
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 109 deletions.
2 changes: 1 addition & 1 deletion htroot/ConfigBasic.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ <h2>Basic Configuration</h2>
<dt><label for="port">Peer Port: </label></dt>
<dd>
<input type="text" name="port" id="port" value="#[defaultPort]#" size="5" maxlength="5" />&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="withssl" id="withssl" #(withsslenabled)#::checked="checked"#(/withsslenabled)#>with SSL (https enabled#(withsslenabled)#:: on port <a href="Settings_p.html?page=http">#[sslport]#</a>#(/withsslenabled)#)
<input type="checkbox" name="withssl" id="withssl" #(withsslenabled)#::checked="checked"#(/withsslenabled)#>with SSL (https enabled#(withsslenabled)#:: on port <a href="Settings_p.html?page=ProxyAccess">#[sslport]#</a>#(/withsslenabled)#)
</dd>
#(upnp)#::<dt>
<label for="enableUpnp">Configure your router for YaCy using UPnP:&nbsp;</label>
Expand Down
2 changes: 0 additions & 2 deletions htroot/SettingsAck_p.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ <h2>Settings Receipt:</h2>
::<!-- 25 -->
<p>You are now in <strong>Cache Mode</strong>. Only Proxy-cache ist available in this mode. After a short while you should see the effect on the <a href="Status.html">status</a> page.</p>
::<!-- 26 -->
<p class="error">Unable to bild the server to the new Port: <span class="settingsValue">#[port]#</span><br />
This values seems not to be a valid port configuration.</p>
::<!-- 27 -->
<p class="error"><strong>Invalid IP-Number filter:</strong> <tt>#[filter]#</tt><br />
<strong>Error in pattern nr #[nr]#</strong> "<tt>#[pattern]#</tt>": <tt>#[error]#</tt>
Expand Down
32 changes: 4 additions & 28 deletions htroot/SettingsAck_p.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
// javac -classpath .:../Classes SettingsAck_p.java
// if the shell's current path is HTROOT

import java.net.InetSocketAddress;
import java.net.SocketException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.StringTokenizer;
Expand All @@ -37,9 +35,7 @@

import net.yacy.cora.document.id.MultiProtocolURL;
import net.yacy.cora.order.Digest;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.http.YaCyHttpServer;
import net.yacy.kelondro.util.Formatter;
import net.yacy.peers.Network;
import net.yacy.peers.Seed;
Expand Down Expand Up @@ -101,31 +97,11 @@ public static serverObjects respond(final RequestHeader header, final serverObje
// proxy password
if (post.containsKey("proxyaccount")) {
/*
* set new port
* display port info
*/
final String port = post.get("port");
prop.putHTML("info_port", port);
if (!env.getConfig("port", port).equals(port)) {
// validation port
final YaCyHttpServer theServerCore = env.getHttpServer();
try {
final InetSocketAddress theNewAddress = theServerCore.generateSocketAddress(port);
final String hostName = Domains.getHostName(theNewAddress.getAddress());
prop.put("info_restart", "1");
prop.put("info_restart_ip",(hostName.equals("0.0.0.0"))? Domains.LOCALHOST : hostName);
prop.put("info_restart_port", theNewAddress.getPort());

env.setConfig("port", port);

theServerCore.reconnect(5000);
} catch (final SocketException e) {
prop.put("info", "26");
return prop;
}
} else {
prop.put("info_restart", "0");
}

prop.putHTML("info_port", env.getConfig("port", "8090"));
prop.put("info_restart", "0");

// read and process data
String filter = (post.get("proxyfilter")).trim();
final boolean useProxyAccounts = post.containsKey("use_proxyaccounts") && post.get("use_proxyaccounts").equals("on");
Expand Down
51 changes: 0 additions & 51 deletions htroot/Settings_Http.inc

This file was deleted.

63 changes: 43 additions & 20 deletions htroot/Settings_ProxyAccess.inc
Original file line number Diff line number Diff line change
@@ -1,30 +1,53 @@
<form action="SettingsAck_p.html" method="post" enctype="multipart/form-data">
<fieldset><legend id="http">Proxy Settings</legend>
<table border="0" cellspacing="5">
<tr valign="top">
<td><label for="trans_proxy">Transparent Proxy</label>:</td>
<td><input type="checkbox" name="isTransparentProxy" id="trans_proxy" #(isTransparentProxy)#::checked="checked" #(/isTransparentProxy)#/></td>
<td>
With this you can specify if YaCy can be used as transparent proxy.<br />
<em>Hint: On linux you can configure your firewall to transparently redirect all http traffic through yacy using this iptables rule</em>:<br />
<small><code>iptables -t nat -A PREROUTING -p tcp -s 192.168.0.0/16 --dport 80 -j DNAT --to 192.168.0.1:#[port]#</code></small>
</td>
</tr>
<tr valign="top">
<td><label for="via_header">Send "Via" Header</label>:</td>
<td><input type="checkbox" name="proxy.sendViaHeader" id="via_header" #(proxy.sendViaHeader)#::checked="checked" #(/proxy.sendViaHeader)#/></td>
<td>
Specifies if the proxy should send the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.45" target="_blank">Via</a>
http header according to RFC 2616 Sect 14.45.
</td>
</tr>
<tr valign="top">
<td><label for="x_forwarded_header">Send "X-Forwarded-For" Header</label>:</td>
<td><input type="checkbox" name="proxy.sendXForwardedForHeader" id="x_forwarded_header" #(proxy.sendXForwardedForHeader)#::checked="checked" #(/proxy.sendXForwardedForHeader)#/></td>
<td>Specifies if the proxy should send the X-Forwarded-For http header.</td>
</tr>
<tr valign="top">
<td colspan="3"><input type="submit" class="btn btn-primary btn-sm" name="httpNetworking" value="Submit" /> <em>Changes will take effect immediately.</em></td>
</tr>
</table>
</fieldset>
</form>
<form action="SettingsAck_p.html" method="post" enctype="multipart/form-data">
<fieldset><legend id="ProxyAccess">Proxy Access Settings</legend>
<p>
These settings configure the access method to your own http proxy and server.
All traffic is routed throug one single port, for both proxy and server.<br />
<br />
<strong>Server/Proxy Port Configuration</strong>
</p>
<p>
The socket addresses where YaCy should listen for incoming connections from other YaCy peers or http clients.<br />
You have four possibilities to specify the address:
</p>
<ul>
<li>defining a port only (<em>e.g. 8090</em>)</li>
<li>defining IP address and port (<em>e.g. 192.168.0.1:8090</em>)</li>
<li>defining host name and port (<em>e.g. home:8090</em>)</li>
<li>defining interface name and port (<em>e.g. #eth0:8090</em>)</li>
</ul>
<p><em>Hint: Dont forget to change your firewall configuration after you have changed the port.</em></p>
<table border="0" cellspacing="5">
<tr valign="top">
<td><label for="port">Proxy and http-Server Administration Port</label>:</td>
<td><input name="port" id="port" type="text" size="30" maxlength="30" value="#[port]#" /></td>
<td><em>Changes will take effect in 5-10 seconds</em></td>
</tr>
</table>
<tr>
<td><a href="ConfigBasic.html">HTTP Server Port</a>:</td>
<td><b>#[port]#</b></td>

#(server.https)#::
<td style="width:10%">&nbsp;</td>
<td>HTTPS Server Port:</td>
<td><input type="text" width="4" name="port.ssl" value="#[port.ssl]#" size="4" maxlength="6"/>&nbsp;<input class="btn btn-primary btn-xs" type="submit" value="change"/></td>
</tr>
#(/server.https)#
</table>
<br />
<p>
<strong>Server Access Restrictions</strong><br />
<br />
Expand Down Expand Up @@ -56,7 +79,7 @@
</td>
</tr>
<tr valign="top">
<td colspan="2"><input type="submit" name="proxyaccount" value="Submit" /></td>
<td colspan="2"><input class="btn btn-primary btn-sm" type="submit" name="proxyaccount" value="Submit" /></td>
</tr>
</table>
</fieldset>
Expand Down
1 change: 0 additions & 1 deletion htroot/Settings_p.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ <h2>Advanced Settings</h2>
<li><a href="?page=ServerAccess">Server Access Settings</a></li>
<li><a href="?page=ProxyAccess">Proxy Access Settings</a></li>
<li><a href="?page=crawler">Crawler Settings</a></li>
<li><a href="?page=http">HTTP Networking</a></li>
<li><a href="?page=proxy">Remote Proxy (optional)</a></li>
<li><a href="?page=seed">Seed Upload Settings</a></li>
<li><a href="?page=messageForwarding">Message Forwarding (optional)</a></li>
Expand Down
4 changes: 0 additions & 4 deletions htroot/Settings_p.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ public static serverObjects respond(final RequestHeader header, final serverObje
if (page.equals("ProxyAccess")) {
prop.put("settingsTables", "Settings_ProxyAccess.inc");
}
else if (page.equals("http")) {
prop.put("settingsTables", "Settings_Http.inc");
}
else if (page.equals("proxy")) {
prop.put("settingsTables", "Settings_Proxy.inc");
}
Expand Down Expand Up @@ -186,7 +183,6 @@ else if (page.equals("crawler")) {
prop.putHTML("crawler.file.maxFileSize",sb.getConfig("crawler.file.maxFileSize", "-1"));

// http server info
prop.put("httpservername",sb.getHttpServer().getVersion());
prop.put("server.https",sb.getConfigBool("server.https", false));
prop.put("server.https_port.ssl", sb.getConfig("port.ssl","8443"));

Expand Down
4 changes: 2 additions & 2 deletions htroot/Status_p.inc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</dd>

<dt>Address</dt>
<dd>Host: #[host]#:#[port]# #(extPortFormat)#::| (Binding to interface: #[extPort]#)#(/extPortFormat)# #(sslSupport)#::| SSL: <a href="ConfigBasic.html">enabled</a> (port <a href="Settings_p.html?page=http">#[sslPort]#</a>)#(/sslSupport)#<br />
<dd>Host: #[host]#:#[port]# #(extPortFormat)#::| (Binding to interface: #[extPort]#)#(/extPortFormat)# #(sslSupport)#::| SSL: <a href="ConfigBasic.html">enabled</a> (port <a href="Settings_p.html?page=ProxyAccess">#[sslPort]#</a>)#(/sslSupport)#<br />
#(peerAddress)#
peer address not assigned
::
Expand All @@ -43,7 +43,7 @@
#(/portForwarding)#

<dt>Proxy</dt>
<dd>Transparent <a href="Settings_p.html?page=http">#(info_isTransparentProxy)#on::off#(/info_isTransparentProxy)#</a>&nbsp;&nbsp;
<dd>Transparent <a href="Settings_p.html?page=ProxyAccess">#(info_isTransparentProxy)#on::off#(/info_isTransparentProxy)#</a>&nbsp;&nbsp;
URL <a href="AugmentedBrowsing_p.html">#(info_proxyURL)#on::off#(/info_proxyURL)#</a></dd>
<dd>Remote: <a href="Settings_p.html?page=proxy">#(remoteProxy)#not used::#[host]#:#[port]# | Used for YaCy -> YaCy communication: #(4Yacy)#Yes::No #(/4Yacy)# #(/remoteProxy)#</a></dd>
<dt>Auto-popup on start-up</dt>
Expand Down

0 comments on commit e033e79

Please sign in to comment.