Group all proxy settings on System Administration by adding settings of

UrlProxyAccss page (moved from deleted AugmentedBrowsing_p), adjust
submenu (remove Augmented Browsing) and translation files.
pull/105/head
reger 8 years ago
parent 39e081ef38
commit e61ee180a7

@ -1,47 +0,0 @@
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
public final class AugmentedBrowsing_p {
public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header,
final serverObjects post, final serverSwitch env) {
// return variable that accumulates replacements
final serverObjects prop = new serverObjects();
if (post != null) {
if (post.containsKey("urlproxySettings")) {
env.setConfig("proxyURL.access", post.get("urlproxyfilter"));
env.setConfig("proxyURL.rewriteURLs",
post.get("urlproxydomains"));
env.setConfig("proxyURL",
"on".equals(post.get("urlproxyenabled")) ? true : false);
env.setConfig("proxyURL.useforresults",
"on".equals(post.get("urlproxyuseforresults")) ? true : false);
}
}
prop.putHTML("urlproxyfilter",
env.getConfig("proxyURL.access", "127.0.0.1,0:0:0:0:0:0:0:1"));
prop.putHTML("urlproxydomains",
env.getConfig("proxyURL.rewriteURLs", "domainlist"));
prop.put("urlproxyenabled_checked",
env.getConfigBool("proxyURL", false) ? "1" : "0");
prop.put("urlproxyuseforresults_checked",
env.getConfigBool("proxyURL.useforresults", false) ? "1" : "0");
// return rewrite properties
return prop;
}
}

@ -257,8 +257,8 @@ var solr= $.getJSON("solr/collection1/select?q=*:*&defType=edismax&start=0&rows=
<td align="center"><input type="checkbox" name="search.result.show.proxy" value="true" #(search.result.show.proxy)#::checked="checked" #(/search.result.show.proxy)# /> <td align="center"><input type="checkbox" name="search.result.show.proxy" value="true" #(search.result.show.proxy)#::checked="checked" #(/search.result.show.proxy)# />
<span class="info" style="padding-left: 10px"><img src="env/grafics/i16.gif" alt="info"/><span> <span class="info" style="padding-left: 10px"><img src="env/grafics/i16.gif" alt="info"/><span>
For this option URL proxy must be enabled.<br> For this option URL proxy must be enabled.<br>
see <a href="AugmentedBrowsing_p.html">AugmentedBrowsing_p.html</a><br> see <a href="Settings_p.html?page=UrlProxyAccess">Settings_p.html</a><br>
menu: Content Semantic > Augmented Browsing menu: System Administration > Advanced Settings
</span></span> </span></span>
</td> </td>
<td align="center"><input type="checkbox" name="search.result.show.hostbrowser" value="true" #(search.result.show.hostbrowser)#::checked="checked" #(/search.result.show.hostbrowser)# /></td> <td align="center"><input type="checkbox" name="search.result.show.hostbrowser" value="true" #(search.result.show.hostbrowser)#::checked="checked" #(/search.result.show.hostbrowser)# /></td>

@ -189,6 +189,8 @@
<p>HTTPS port is now: <span class="settingsValue">#[port.ssl]#</span></p> <p>HTTPS port is now: <span class="settingsValue">#[port.ssl]#</span></p>
<p>the change will take effect after restart.</p> <p>the change will take effect after restart.</p>
<p>Note: the SSL option must be switched on, see <a href="ConfigBasic.html">Basic Configuration</a></p> <p>Note: the SSL option must be switched on, see <a href="ConfigBasic.html">Basic Configuration</a></p>
::<!-- 33: Url/Web proxy settings changed -->
<p>URL Proxy settings have been saved.</p>
#(/info)# #(/info)#
<p></p> <p></p>
#(needsRestart)# #(needsRestart)#

@ -287,6 +287,16 @@ public class SettingsAck_p {
return prop; return prop;
} }
if (post.containsKey("urlproxySettings")) {
env.setConfig("proxyURL.access", post.get("urlproxyfilter"));
env.setConfig("proxyURL.rewriteURLs", post.get("urlproxydomains"));
env.setConfig("proxyURL", "on".equals(post.get("urlproxyenabled")) ? true : false);
env.setConfig("proxyURL.useforresults", "on".equals(post.get("urlproxyuseforresults")) ? true : false);
prop.put("info_success", "1");
prop.put("info", "33");
return prop;
}
if (post.containsKey("seedUploadRetry")) { if (post.containsKey("seedUploadRetry")) {
String error; String error;
if ((error = Network.saveSeedList(sb)) == null) { if ((error = Network.saveSeedList(sb)) == null) {

@ -1,33 +1,22 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>YaCy '#[clientname]#': Augmented Browsing</title>
#%env/templates/metas.template%#
</head>
<body id="Settings">
#%env/templates/header.template%#
#%env/templates/submenuSemantic.template%#
<h2>Web Proxy Browsing</h2>
<form id="parsersettings" action="AugmentedBrowsing_p.html" method="post" enctype="multipart/form-data">
<fieldset><legend id="urlproxy">URL Proxy Settings</legend>
<p>
With this settings you can activate or deactivate URL proxy.
Service call: http://localhost:8090/proxy.html?url=parameter, where parameter is the url of an external web page.
</p>
<dl> <form id="urlproxysettings" action="SettingsAck_p.html" method="post" enctype="multipart/form-data">
<fieldset><legend id="urlproxy">URL Proxy Settings</legend>
<dt>URL proxy:</dt> <p>
<dd> With this settings you can activate or deactivate URL proxy.
Service call: http://localhost:8090/proxy.html?url=parameter, where parameter is the url of an external web page.
</p>
<dl>
<dt>URL proxy:</dt>
<dd>
<input type="checkbox" name="urlproxyenabled" id="urlproxyenabled" #(urlproxyenabled_checked)#:: checked="checked"#(/urlproxyenabled_checked)# />Enabled<br/> <input type="checkbox" name="urlproxyenabled" id="urlproxyenabled" #(urlproxyenabled_checked)#:: checked="checked"#(/urlproxyenabled_checked)# />Enabled<br/>
<p class="help"> <p class="help">
Globally enables or disables URL proxy via http://yourpeer:yourport/proxy.html?url=http://externalurl/ Globally enables or disables URL proxy via http://yourpeer:yourport/proxy.html?url=http://externalurl/
</p> </p>
</dd> </dd>
<dt>Show search results via URL proxy:</dt> <dt>Show search results via URL proxy:</dt>
<dd> <dd>
<input type="checkbox" name="urlproxyuseforresults" id="urlproxyuseforresults" #(urlproxyuseforresults_checked)#:: checked="checked"#(/urlproxyuseforresults_checked)# />Enabled<br/> <input type="checkbox" name="urlproxyuseforresults" id="urlproxyuseforresults" #(urlproxyuseforresults_checked)#:: checked="checked"#(/urlproxyuseforresults_checked)# />Enabled<br/>
<p class="help"> <p class="help">
Enables or disables URL proxy for all search results. If enabled, all search results will be tunneled through URL proxy. Enables or disables URL proxy for all search results. If enabled, all search results will be tunneled through URL proxy.
@ -38,28 +27,25 @@
<code>javascript: window.location.href = ('http://localhost:8090/proxy.html?url=' + location.href);</code> <code>javascript: window.location.href = ('http://localhost:8090/proxy.html?url=' + location.href);</code>
or right-click this link and add to favorites: <code><a class="link" href="javascript: window.location.href = ('http://localhost:8090/proxy.html?url=' + location.href);">YaCy proxy start</a></code> or right-click this link and add to favorites: <code><a class="link" href="javascript: window.location.href = ('http://localhost:8090/proxy.html?url=' + location.href);">YaCy proxy start</a></code>
</p> </p>
</dd> </dd>
<dt>Restrict URL proxy use:</dt> <dt>Restrict URL proxy use:</dt>
<dd> <dd>
<input type="text" name="urlproxyfilter" value="#[urlproxyfilter]#" size="60" /><br/><br/> <input type="text" name="urlproxyfilter" value="#[urlproxyfilter]#" size="60" /><br/><br/>
<p class="help"> <p class="help">
Define client filter. Default: 127.0.0.1,0:0:0:0:0:0:0:1. Define client filter. Default: 127.0.0.1,0:0:0:0:0:0:0:1.
</p> </p>
</dd> </dd>
<dt>URL substitution:</dt> <dt>URL substitution:</dt>
<dd> <dd>
<input type="text" name="urlproxydomains" value="#[urlproxydomains]#" size="60" /><br/><br/> <input type="text" name="urlproxydomains" value="#[urlproxydomains]#" size="60" /><br/><br/>
<p class="help"> <p class="help">
Define URL substitution rules which allow navigating in proxy environment. Possible values: all, domainlist. Default: domainlist. Define URL substitution rules which allow navigating in proxy environment. Possible values: all, domainlist. Default: domainlist.
</p> </p>
</dd> </dd>
</dl> </dl>
<dl><dt></dt><dd><input type="submit" name="urlproxySettings" value="Submit" class="btn btn-primary"/></dd></dl> <dl><dt></dt><dd><input type="submit" name="urlproxySettings" value="Submit" class="btn btn-primary"/></dd></dl>
</fieldset> </fieldset>
</form> </form>
#%env/templates/footer.template%#
</body>
</html>

@ -12,14 +12,25 @@
but <strong>forgot your administration password</strong>, you must stop the proxy, but <strong>forgot your administration password</strong>, you must stop the proxy,
delete the file 'DATA/SETTINGS/yacy.conf' in the YaCy application root folder and start YaCy again. delete the file 'DATA/SETTINGS/yacy.conf' in the YaCy application root folder and start YaCy again.
</p> </p>
<ul class="settingsMenu"> <table>
<li><a href="?page=ServerAccess">Server Access Settings</a></li> <tr>
<li><a href="?page=ProxyAccess">Proxy Access Settings</a></li> <td valign="top">
<li><a href="?page=crawler">Crawler Settings</a></li> <ul class="settingsMenu">
<li><a href="?page=proxy">Remote Proxy (optional)</a></li> <li><a href="?page=ServerAccess">Server Access Settings</a></li>
<li><a href="?page=seed">Seed Upload Settings</a></li> <li><a href="?page=crawler">Crawler Settings</a></li>
<li><a href="?page=messageForwarding">Message Forwarding (optional)</a></li> <li><a href="?page=seed">Seed Upload Settings</a></li>
</ul> <li><a href="?page=messageForwarding">Message Forwarding (optional)</a></li>
</ul>
</td>
<td valign="top">
<ul class="settingsMenu">
<li><a href="?page=ProxyAccess">Transparent Proxy Access Settings</a></li>
<li><a href="?page=UrlProxyAccess">URL/Web Proxy Access Settings</a></li>
<li><a href="?page=proxy">Remote Proxy (optional)</a></li>
</ul>
</td>
</tr>
</table>
#%[settingsTables]%# #%[settingsTables]%#
#%env/templates/footer.template%# #%env/templates/footer.template%#

@ -52,6 +52,9 @@ public final class Settings_p {
else if (page.equals("proxy")) { else if (page.equals("proxy")) {
prop.put("settingsTables", "Settings_Proxy.inc"); prop.put("settingsTables", "Settings_Proxy.inc");
} }
else if (page.equals("UrlProxyAccess")) {
prop.put("settingsTables", "Settings_UrlProxyAccess.inc");
}
else if (page.equals("ServerAccess")) { else if (page.equals("ServerAccess")) {
prop.put("settingsTables", "Settings_ServerAccess.inc"); prop.put("settingsTables", "Settings_ServerAccess.inc");
} }
@ -117,7 +120,13 @@ public final class Settings_p {
prop.put("proxyuser",s.substring(0, pos)); prop.put("proxyuser",s.substring(0, pos));
}*/ }*/
} }
// Url proxy settings
prop.putHTML("urlproxyfilter", env.getConfig("proxyURL.access", "127.0.0.1,0:0:0:0:0:0:0:1"));
prop.putHTML("urlproxydomains", env.getConfig("proxyURL.rewriteURLs", "domainlist"));
prop.put("urlproxyenabled_checked", env.getConfigBool("proxyURL", false) ? "1" : "0");
prop.put("urlproxyuseforresults_checked", env.getConfigBool("proxyURL.useforresults", false) ? "1" : "0");
// server access filter // server access filter
prop.putHTML("serverfilter", env.getConfig("serverClient", "*")); prop.putHTML("serverfilter", env.getConfig("serverClient", "*"));

@ -46,7 +46,7 @@
<dt>Proxy</dt> <dt>Proxy</dt>
<dd>Transparent <a href="Settings_p.html?page=ProxyAccess">#(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> URL <a href="Settings_p.html?page=UrlProxyAccess">#(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> <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> <dt>Auto-popup on start-up</dt>
<dd> <dd>

@ -10,10 +10,4 @@
</ul> </ul>
</div> </div>
<div class="SubMenugroup">
<h3>Augmented Content</h3>
<ul class="SubMenu">
<li><a href="AugmentedBrowsing_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Augmented Browsing</a></li>
</ul>
</div>
</div> </div>

@ -80,7 +80,7 @@ Access Dates==Zugriffszeiten
This is a list of searches that had been requested from remote peer search interface==Dies ist eine Liste aller Suchanfragen, die von einem anderen Peer gestellt wurden. This is a list of searches that had been requested from remote peer search interface==Dies ist eine Liste aller Suchanfragen, die von einem anderen Peer gestellt wurden.
#----------------------------- #-----------------------------
#File: AugmentedBrowsing_p.html #File: Settings_UrlProxyAccess.inc
#--------------------------- #---------------------------
Augmented Browsing<==Angereichertes Browsen< Augmented Browsing<==Angereichertes Browsen<
URL Proxy Settings<==URL Proxy Einstellungen< URL Proxy Settings<==URL Proxy Einstellungen<
@ -98,8 +98,6 @@ URL substitution:==Ersetzen von URLs:
Define URL substitution rules which allow navigating in proxy environment. Possible values: all, domainlist. Default: domainlist.==Definiere die Regeln zum Ersetzen von URLs die Navigation in der Proxy Umgebung erlauben. Mögliche Werte: all, domainlist. Standardeinstellung: domainlist. Define URL substitution rules which allow navigating in proxy environment. Possible values: all, domainlist. Default: domainlist.==Definiere die Regeln zum Ersetzen von URLs die Navigation in der Proxy Umgebung erlauben. Mögliche Werte: all, domainlist. Standardeinstellung: domainlist.
"Submit"=="Absenden" "Submit"=="Absenden"
Augmented Browsing Settings==Angereicherte Browser Einstellungen Augmented Browsing Settings==Angereicherte Browser Einstellungen
With this settings you can activate or deactivate augmented browsing which happens usually via the URL proxy.==Mit diesen Einstellungen können Sie das angereicherte Browsing an- oder abschalten das normalerweise über den URL Proxy passiert.
Augmented Browsing:==Angereichertes Browsing:
#>Enabled<==>Aktiviert< #>Enabled<==>Aktiviert<
Enables or disables augmented browsing. If enabled, all websites will be modified during loading.==Schaltet angereichertes Browsing an oder ab. Wenn aktiviert werden alle Webseite während des Ladens modifiziert. Enables or disables augmented browsing. If enabled, all websites will be modified during loading.==Schaltet angereichertes Browsing an oder ab. Wenn aktiviert werden alle Webseite während des Ladens modifiziert.
#----------------------------- #-----------------------------

@ -124,7 +124,7 @@ This file will not contain any additional information==Ce fichier ne contiendra
URL:==Une URL : URL:==Une URL :
#----------------------------- #-----------------------------
#File: AugmentedBrowsing_p.html #File: Settings_UrlProxyAccess.inc
#--------------------------- #---------------------------
Augmented Browsing<==Navigation augmentée< Augmented Browsing<==Navigation augmentée<
URL Proxy Settings<==Configuration du Proxy< URL Proxy Settings<==Configuration du Proxy<

@ -66,7 +66,7 @@ Access Dates==アクセスの日時
This is a list of searches that had been requested from remote peer search interface==これはリモート ピアの検索インターフェースからリクエストされた検索の一覧です. This is a list of searches that had been requested from remote peer search interface==これはリモート ピアの検索インターフェースからリクエストされた検索の一覧です.
#----------------------------- #-----------------------------
#File: AugmentedBrowsing_p.html #File: Settings_UrlProxyAccess.inc
#--------------------------- #---------------------------
Augmented Browsing<==増強されたブラウジング< Augmented Browsing<==増強されたブラウジング<
URL Proxy Settings<==URL プロキシ設定< URL Proxy Settings<==URL プロキシ設定<

@ -131,7 +131,7 @@
</body> </body>
</file> </file>
<file original="AugmentedBrowsing_p.html" source-language="en" datatype="html"> <file original="Settings_UrlProxyAccess.inc" source-language="en" datatype="html">
<body> <body>
<trans-unit id="1b8e9ae5" xml:space="preserve" approved="no" translate="yes"> <trans-unit id="1b8e9ae5" xml:space="preserve" approved="no" translate="yes">
<source>Augmented Browsing&lt;</source> <source>Augmented Browsing&lt;</source>
@ -7285,6 +7285,10 @@
<trans-unit id="aff61eb" xml:space="preserve" approved="no" translate="yes"> <trans-unit id="aff61eb" xml:space="preserve" approved="no" translate="yes">
<source>Your need to restart YaCy to activate the changes.</source> <source>Your need to restart YaCy to activate the changes.</source>
</trans-unit> </trans-unit>
<trans-unit id="0000033" xml:space="preserve" approved="no" translate="yes">
<source>URL Proxy settings have been saved.</source>
</trans-unit>
</body> </body>
</file> </file>

@ -80,7 +80,7 @@ Access Dates==Время доступа
This is a list of searches that had been requested from remote peer search interface==Это список поисковых запросов, которые были запрошены удалёнными узлами. This is a list of searches that had been requested from remote peer search interface==Это список поисковых запросов, которые были запрошены удалёнными узлами.
#----------------------------- #-----------------------------
#File: AugmentedBrowsing_p.html #File: Settings_UrlProxyAccess.inc
#--------------------------- #---------------------------
Augmented Browsing<==Расширенный просмотр< Augmented Browsing<==Расширенный просмотр<
URL Proxy Settings<==Настройки URL-прокси< URL Proxy Settings<==Настройки URL-прокси<

@ -98,7 +98,7 @@ public class UrlProxyServlet extends HttpServlet implements Servlet {
// 1 - check usser access rights // 1 - check usser access rights
if (!Switchboard.getSwitchboard().getConfigBool("proxyURL", false)) { if (!Switchboard.getSwitchboard().getConfigBool("proxyURL", false)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN,"proxy use not allowed. URL proxy globally switched off (see: Content Semantic -> Augmented Browsing -> URL proxy)"); response.sendError(HttpServletResponse.SC_FORBIDDEN,"proxy use not allowed. URL proxy globally switched off (see: System Administration -> Advanced Settings -> URL proxy)");
return; return;
} }
@ -106,7 +106,7 @@ public class UrlProxyServlet extends HttpServlet implements Servlet {
if (!Domains.isThisHostIP(remoteHost)) { if (!Domains.isThisHostIP(remoteHost)) {
if (!proxyippatternmatch(remoteHost)) { if (!proxyippatternmatch(remoteHost)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN, response.sendError(HttpServletResponse.SC_FORBIDDEN,
"proxy use not granted for IP " + remoteHost + " (see: Content Semantic -> Augmented Browsing -> Restrict URL proxy use filter)"); "proxy use not granted for IP " + remoteHost + " (see: System Administration -> Advanced Settings -> URL Proxy Access Settings -> Restrict URL proxy use filter)");
return; return;
} }
} }

@ -68,7 +68,7 @@ public class YaCyProxyServlet extends HttpServlet implements Servlet {
final HttpServletResponse response = (HttpServletResponse) res; final HttpServletResponse response = (HttpServletResponse) res;
if (!Switchboard.getSwitchboard().getConfigBool("proxyURL", false)) { if (!Switchboard.getSwitchboard().getConfigBool("proxyURL", false)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN,"proxy use not allowed. URL proxy globally switched off (see: Content Semantic -> Augmented Browsing -> URL proxy)"); response.sendError(HttpServletResponse.SC_FORBIDDEN,"proxy use not allowed. URL proxy globally switched off (see: System Administration -> Advanced Settings -> URL proxy)");
return; return;
} }
@ -76,7 +76,7 @@ public class YaCyProxyServlet extends HttpServlet implements Servlet {
if (!Domains.isThisHostIP(remoteHost)) { if (!Domains.isThisHostIP(remoteHost)) {
if (!proxyippatternmatch(remoteHost)) { if (!proxyippatternmatch(remoteHost)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN, response.sendError(HttpServletResponse.SC_FORBIDDEN,
"proxy use not granted for IP " + remoteHost + " (see: Content Semantic -> Augmented Browsing -> Restrict URL proxy use filter)"); "proxy use not granted for IP " + remoteHost + " (see: System Administration -> Advanced Settings -> Restrict URL proxy use filter)");
return; return;
} }
} }

Loading…
Cancel
Save