From e61ee180a7044498df39d9cf5c87e4f8b2667df4 Mon Sep 17 00:00:00 2001 From: reger Date: Sun, 22 Jan 2017 23:58:46 +0100 Subject: [PATCH] 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. --- htroot/AugmentedBrowsing_p.java | 47 -------------- htroot/ConfigSearchPage_p.html | 4 +- htroot/SettingsAck_p.html | 2 + htroot/SettingsAck_p.java | 10 +++ ...ing_p.html => Settings_UrlProxyAccess.inc} | 62 +++++++------------ htroot/Settings_p.html | 27 +++++--- htroot/Settings_p.java | 11 +++- htroot/Status_p.inc | 2 +- htroot/env/templates/submenuSemantic.template | 6 -- locales/de.lng | 4 +- locales/fr.lng | 2 +- locales/ja.lng | 2 +- locales/master.lng.xlf | 6 +- locales/ru.lng | 2 +- .../yacy/http/servlets/UrlProxyServlet.java | 4 +- .../yacy/http/servlets/YaCyProxyServlet.java | 4 +- 16 files changed, 81 insertions(+), 114 deletions(-) delete mode 100644 htroot/AugmentedBrowsing_p.java rename htroot/{AugmentedBrowsing_p.html => Settings_UrlProxyAccess.inc} (59%) 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= info For this option URL proxy must be enabled.
- see AugmentedBrowsing_p.html
- menu: Content Semantic > Augmented Browsing + see Settings_p.html
+ menu: System Administration > Advanced Settings
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 @@

HTTPS port is now: #[port.ssl]#

the change will take effect after restart.

Note: the SSL option must be switched on, see Basic Configuration

+ :: +

URL Proxy settings have been saved.

#(/info)#

#(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 similarity index 59% rename from htroot/AugmentedBrowsing_p.html rename to htroot/Settings_UrlProxyAccess.inc index a4cbe241c..fa357140b 100644 --- a/htroot/AugmentedBrowsing_p.html +++ b/htroot/Settings_UrlProxyAccess.inc @@ -1,33 +1,22 @@ - - - - YaCy '#[clientname]#': Augmented Browsing - #%env/templates/metas.template%# - - - #%env/templates/header.template%# - #%env/templates/submenuSemantic.template%# -

Web Proxy Browsing

- -
-
URL Proxy Settings -

- 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. -

-
- -
URL proxy:
-
+ +
URL Proxy Settings +

+ 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. +

+ +
+
URL proxy:
+
Enabled

Globally enables or disables URL proxy via http://yourpeer:yourport/proxy.html?url=http://externalurl/

-
+
-
Show search results via URL proxy:
-
+
Show search results via URL proxy:
+
Enabled

Enables or disables URL proxy for all search results. If enabled, all search results will be tunneled through URL proxy. @@ -38,28 +27,25 @@ javascript: window.location.href = ('http://localhost:8090/proxy.html?url=' + location.href); or right-click this link and add to favorites: YaCy proxy start

-
+ -
Restrict URL proxy use:
-
+
Restrict URL proxy use:
+


Define client filter. Default: 127.0.0.1,0:0:0:0:0:0:0:1.

-
-
URL substitution:
-
+
+
URL substitution:
+


Define URL substitution rules which allow navigating in proxy environment. Possible values: all, domainlist. Default: domainlist.

-
+ -
-
-
+ +
+
- - #%env/templates/footer.template%# - - + 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 forgot your administration password, you must stop the proxy, delete the file 'DATA/SETTINGS/yacy.conf' in the YaCy application root folder and start YaCy again.

- + + + + + +
+ + + +
#%[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 @@
Proxy
Transparent #(info_isTransparentProxy)#on::off#(/info_isTransparentProxy)#   - URL #(info_proxyURL)#on::off#(/info_proxyURL)#
+ URL #(info_proxyURL)#on::off#(/info_proxyURL)#
Remote: #(remoteProxy)#not used::#[host]#:#[port]# | Used for YaCy -> YaCy communication: #(4Yacy)#Yes::No #(/4Yacy)# #(/remoteProxy)#
Auto-popup on start-up
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 @@ - \ 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 @@ - + Augmented Browsing< @@ -7285,6 +7285,10 @@ Your need to restart YaCy to activate the changes. + + URL Proxy settings have been saved. + + 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; } }