diff options
| -rw-r--r-- | htroot/AugmentedBrowsing_p.java | 47 | ||||
| -rw-r--r-- | htroot/ConfigSearchPage_p.html | 4 | ||||
| -rw-r--r-- | htroot/SettingsAck_p.html | 2 | ||||
| -rw-r--r-- | htroot/SettingsAck_p.java | 10 | ||||
| -rw-r--r-- | htroot/Settings_UrlProxyAccess.inc (renamed from htroot/AugmentedBrowsing_p.html) | 62 | ||||
| -rw-r--r-- | htroot/Settings_p.html | 27 | ||||
| -rw-r--r-- | htroot/Settings_p.java | 11 | ||||
| -rw-r--r-- | htroot/Status_p.inc | 2 | ||||
| -rw-r--r-- | htroot/env/templates/submenuSemantic.template | 6 | ||||
| -rw-r--r-- | locales/de.lng | 4 | ||||
| -rw-r--r-- | locales/fr.lng | 2 | ||||
| -rw-r--r-- | locales/ja.lng | 2 | ||||
| -rw-r--r-- | locales/master.lng.xlf | 6 | ||||
| -rw-r--r-- | locales/ru.lng | 2 | ||||
| -rw-r--r-- | source/net/yacy/http/servlets/UrlProxyServlet.java | 4 | ||||
| -rw-r--r-- | source/net/yacy/http/servlets/YaCyProxyServlet.java | 4 |
16 files changed, 81 insertions, 114 deletions
diff --git a/htroot/AugmentedBrowsing_p.java b/htroot/AugmentedBrowsing_p.java deleted file mode 100644 index 1361a8a68..000000000 --- a/htroot/AugmentedBrowsing_p.java +++ /dev/null @@ -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;
- }
-
-}
diff --git a/htroot/ConfigSearchPage_p.html b/htroot/ConfigSearchPage_p.html index c90139891..9a576f440 100644 --- a/htroot/ConfigSearchPage_p.html +++ b/htroot/ConfigSearchPage_p.html @@ -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)# /> <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> - see <a href="AugmentedBrowsing_p.html">AugmentedBrowsing_p.html</a><br> - menu: Content Semantic > Augmented Browsing + see <a href="Settings_p.html?page=UrlProxyAccess">Settings_p.html</a><br> + menu: System Administration > Advanced Settings </span></span> </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> diff --git a/htroot/SettingsAck_p.html b/htroot/SettingsAck_p.html index 7b80cde3d..e0e190029 100644 --- a/htroot/SettingsAck_p.html +++ b/htroot/SettingsAck_p.html @@ -189,6 +189,8 @@ <p>HTTPS port is now: <span class="settingsValue">#[port.ssl]#</span></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>
+ ::<!-- 33: Url/Web proxy settings changed -->
+ <p>URL Proxy settings have been saved.</p>
#(/info)#
<p></p>
#(needsRestart)#
diff --git a/htroot/SettingsAck_p.java b/htroot/SettingsAck_p.java index e2253adcd..a377574cc 100644 --- a/htroot/SettingsAck_p.java +++ b/htroot/SettingsAck_p.java @@ -287,6 +287,16 @@ public class SettingsAck_p { 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")) { String error; if ((error = Network.saveSeedList(sb)) == null) { diff --git a/htroot/AugmentedBrowsing_p.html b/htroot/Settings_UrlProxyAccess.inc index a4cbe241c..fa357140b 100644 --- a/htroot/AugmentedBrowsing_p.html +++ b/htroot/Settings_UrlProxyAccess.inc @@ -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> - - <dt>URL proxy:</dt> - <dd> +<form id="urlproxysettings" action="SettingsAck_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> + <dt>URL proxy:</dt> + <dd> <input type="checkbox" name="urlproxyenabled" id="urlproxyenabled" #(urlproxyenabled_checked)#:: checked="checked"#(/urlproxyenabled_checked)# />Enabled<br/> <p class="help"> Globally enables or disables URL proxy via http://yourpeer:yourport/proxy.html?url=http://externalurl/ </p> - </dd> + </dd> - <dt>Show search results via URL proxy:</dt> - <dd> + <dt>Show search results via URL proxy:</dt> + <dd> <input type="checkbox" name="urlproxyuseforresults" id="urlproxyuseforresults" #(urlproxyuseforresults_checked)#:: checked="checked"#(/urlproxyuseforresults_checked)# />Enabled<br/> <p class="help"> 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> 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> - </dd> + </dd> - <dt>Restrict URL proxy use:</dt> - <dd> + <dt>Restrict URL proxy use:</dt> + <dd> <input type="text" name="urlproxyfilter" value="#[urlproxyfilter]#" size="60" /><br/><br/> <p class="help"> Define client filter. Default: 127.0.0.1,0:0:0:0:0:0:0:1. </p> - </dd> - <dt>URL substitution:</dt> - <dd> + </dd> + <dt>URL substitution:</dt> + <dd> <input type="text" name="urlproxydomains" value="#[urlproxydomains]#" size="60" /><br/><br/> <p class="help"> Define URL substitution rules which allow navigating in proxy environment. Possible values: all, domainlist. Default: domainlist. </p> - </dd> + </dd> - </dl> - <dl><dt></dt><dd><input type="submit" name="urlproxySettings" value="Submit" class="btn btn-primary"/></dd></dl> -</fieldset> + </dl> + <dl><dt></dt><dd><input type="submit" name="urlproxySettings" value="Submit" class="btn btn-primary"/></dd></dl> + </fieldset> </form> - - #%env/templates/footer.template%# - </body> -</html> + diff --git a/htroot/Settings_p.html b/htroot/Settings_p.html index b26ba33de..993f6f5ea 100644 --- a/htroot/Settings_p.html +++ b/htroot/Settings_p.html @@ -12,14 +12,25 @@ 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. </p> - <ul class="settingsMenu"> - <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=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> - </ul> + <table> + <tr> + <td valign="top"> + <ul class="settingsMenu"> + <li><a href="?page=ServerAccess">Server Access Settings</a></li> + <li><a href="?page=crawler">Crawler Settings</a></li> + <li><a href="?page=seed">Seed Upload Settings</a></li> + <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]%# #%env/templates/footer.template%# diff --git a/htroot/Settings_p.java b/htroot/Settings_p.java index e349e8c42..028708a34 100644 --- a/htroot/Settings_p.java +++ b/htroot/Settings_p.java @@ -52,6 +52,9 @@ public final class Settings_p { else if (page.equals("proxy")) { prop.put("settingsTables", "Settings_Proxy.inc"); } + else if (page.equals("UrlProxyAccess")) { + prop.put("settingsTables", "Settings_UrlProxyAccess.inc"); + } else if (page.equals("ServerAccess")) { prop.put("settingsTables", "Settings_ServerAccess.inc"); } @@ -117,7 +120,13 @@ public final class Settings_p { 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 prop.putHTML("serverfilter", env.getConfig("serverClient", "*")); diff --git a/htroot/Status_p.inc b/htroot/Status_p.inc index c7b89dbec..90c427f7b 100644 --- a/htroot/Status_p.inc +++ b/htroot/Status_p.inc @@ -46,7 +46,7 @@ <dt>Proxy</dt>
<dd>Transparent <a href="Settings_p.html?page=ProxyAccess">#(info_isTransparentProxy)#on::off#(/info_isTransparentProxy)#</a>
- 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>
<dt>Auto-popup on start-up</dt>
<dd>
diff --git a/htroot/env/templates/submenuSemantic.template b/htroot/env/templates/submenuSemantic.template index e4efc52bb..fa87e5522 100644 --- a/htroot/env/templates/submenuSemantic.template +++ b/htroot/env/templates/submenuSemantic.template @@ -10,10 +10,4 @@ </ul> </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>
\ No newline at end of file diff --git a/locales/de.lng b/locales/de.lng index c141ee12d..0b821de1f 100644 --- a/locales/de.lng +++ b/locales/de.lng @@ -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. #----------------------------- -#File: AugmentedBrowsing_p.html +#File: Settings_UrlProxyAccess.inc #--------------------------- Augmented Browsing<==Angereichertes Browsen< 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. "Submit"=="Absenden" 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< 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. #----------------------------- diff --git a/locales/fr.lng b/locales/fr.lng index 018ef5818..513e60dbc 100644 --- a/locales/fr.lng +++ b/locales/fr.lng @@ -124,7 +124,7 @@ This file will not contain any additional information==Ce fichier ne contiendra URL:==Une URL : #----------------------------- -#File: AugmentedBrowsing_p.html +#File: Settings_UrlProxyAccess.inc #--------------------------- Augmented Browsing<==Navigation augmentée< URL Proxy Settings<==Configuration du Proxy< diff --git a/locales/ja.lng b/locales/ja.lng index 9f309b040..85f557a5f 100644 --- a/locales/ja.lng +++ b/locales/ja.lng @@ -66,7 +66,7 @@ Access Dates==アクセスの日時 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<==増強されたブラウジング< URL Proxy Settings<==URL プロキシ設定< diff --git a/locales/master.lng.xlf b/locales/master.lng.xlf index 31beb5954..4fa2c2f30 100644 --- a/locales/master.lng.xlf +++ b/locales/master.lng.xlf @@ -131,7 +131,7 @@ </body> </file> -<file original="AugmentedBrowsing_p.html" source-language="en" datatype="html"> +<file original="Settings_UrlProxyAccess.inc" source-language="en" datatype="html"> <body> <trans-unit id="1b8e9ae5" xml:space="preserve" approved="no" translate="yes"> <source>Augmented Browsing<</source> @@ -7285,6 +7285,10 @@ <trans-unit id="aff61eb" xml:space="preserve" approved="no" translate="yes"> <source>Your need to restart YaCy to activate the changes.</source> </trans-unit> + <trans-unit id="0000033" xml:space="preserve" approved="no" translate="yes"> + <source>URL Proxy settings have been saved.</source> + </trans-unit> + </body> </file> diff --git a/locales/ru.lng b/locales/ru.lng index 31af2a4a8..659111de4 100644 --- a/locales/ru.lng +++ b/locales/ru.lng @@ -80,7 +80,7 @@ Access Dates==Время доступа 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<==Расширенный просмотр< URL Proxy Settings<==Настройки URL-прокси< diff --git a/source/net/yacy/http/servlets/UrlProxyServlet.java b/source/net/yacy/http/servlets/UrlProxyServlet.java index 7a7740669..74a2e3289 100644 --- a/source/net/yacy/http/servlets/UrlProxyServlet.java +++ b/source/net/yacy/http/servlets/UrlProxyServlet.java @@ -98,7 +98,7 @@ public class UrlProxyServlet extends HttpServlet implements Servlet { // 1 - check usser access rights 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; } @@ -106,7 +106,7 @@ public class UrlProxyServlet extends HttpServlet implements Servlet { if (!Domains.isThisHostIP(remoteHost)) { if (!proxyippatternmatch(remoteHost)) { 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; } } diff --git a/source/net/yacy/http/servlets/YaCyProxyServlet.java b/source/net/yacy/http/servlets/YaCyProxyServlet.java index 05df2288d..f259cfd4c 100644 --- a/source/net/yacy/http/servlets/YaCyProxyServlet.java +++ b/source/net/yacy/http/servlets/YaCyProxyServlet.java @@ -68,7 +68,7 @@ public class YaCyProxyServlet extends HttpServlet implements Servlet { final HttpServletResponse response = (HttpServletResponse) res; 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; } @@ -76,7 +76,7 @@ public class YaCyProxyServlet extends HttpServlet implements Servlet { if (!Domains.isThisHostIP(remoteHost)) { if (!proxyippatternmatch(remoteHost)) { 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; } } |
