From b6ed7696529aada2d93b5c038b7187b44db8bddc Mon Sep 17 00:00:00 2001 From: Dimitry Kolyshev Date: Fri, 2 Aug 2024 09:10:19 +0300 Subject: [PATCH] Pull request: 5009-ecosia-safesearch Squashed commit of the following: commit 787b5d40394889510c24f4abc3a08410ecc96e5e Author: Dimitry Kolyshev Date: Wed Jul 31 15:09:18 2024 +0300 configmigrate: revert commit a036638c05967298d13ef435dc5b377103cfe163 Author: Dimitry Kolyshev Date: Wed Jul 31 09:37:25 2024 +0300 docs commit a3b2e8de4bab7214dd6b260655bba9f45eee6bd2 Author: Dimitry Kolyshev Date: Wed Jul 31 09:18:25 2024 +0300 locales commit a01a22019ef02ae77e9006dd9444da462419908f Author: Dimitry Kolyshev Date: Wed Jul 31 09:02:14 2024 +0300 filtering: imp code commit bc268cdd526c82cb605b1a474d51b79f593cd3da Merge: 5ad88d914 bc6d20ff1 Author: Dimitry Kolyshev Date: Wed Jul 31 08:00:05 2024 +0300 Merge remote-tracking branch 'origin/master' into 5009-ecosia-safesearch commit 5ad88d914cf9b03f399efd481ae39ebd56243e66 Author: Dimitry Kolyshev Date: Tue Jul 30 13:49:51 2024 +0300 all: ecosia safesearch --- CHANGELOG.md | 5 +++++ client/src/__locales/en.json | 2 +- internal/filtering/safesearch.go | 1 + internal/filtering/safesearch/rules.go | 4 ++++ internal/filtering/safesearch/rules/ecosia.txt | 1 + internal/filtering/safesearch/safesearch.go | 3 +++ internal/filtering/safesearch/safesearch_internal_test.go | 1 + internal/filtering/safesearch/safesearch_test.go | 1 + internal/home/clientshttp.go | 1 + internal/home/config.go | 1 + openapi/CHANGELOG.md | 8 ++++++++ openapi/openapi.yaml | 2 ++ 12 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 internal/filtering/safesearch/rules/ecosia.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index ebbcbdeb..b62a13d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,12 +27,17 @@ See also the [v0.107.53 GitHub milestone][ms-v0.107.53]. NOTE: Add new changes BELOW THIS COMMENT. --> +### Added + +- Ecosia search engine is now supported in safe search ([#5009]). + ### Fixed - Update Google safe search domains list ([#7155]). - Enforce Bing safe search from Edge sidebar ([#7154]). - Text overflow on the query log page ([#7119]). +[#5009]: https://github.com/AdguardTeam/AdGuardHome/issues/5009 [#7119]: https://github.com/AdguardTeam/AdGuardHome/issues/7119 [#7154]: https://github.com/AdguardTeam/AdGuardHome/pull/7154 [#7155]: https://github.com/AdguardTeam/AdGuardHome/pull/7155 diff --git a/client/src/__locales/en.json b/client/src/__locales/en.json index 00c94a58..c7428cdc 100644 --- a/client/src/__locales/en.json +++ b/client/src/__locales/en.json @@ -154,7 +154,7 @@ "use_adguard_parental": "Use AdGuard parental control web service", "use_adguard_parental_hint": "AdGuard Home will check if domain contains adult materials. It uses the same privacy-friendly API as the browsing security web service.", "enforce_safe_search": "Use Safe Search", - "enforce_save_search_hint": "AdGuard Home will enforce safe search in the following search engines: Google, YouTube, Bing, DuckDuckGo, Yandex, Pixabay.", + "enforce_save_search_hint": "AdGuard Home will enforce safe search in the following search engines: Google, YouTube, Bing, DuckDuckGo, Ecosia, Yandex, Pixabay.", "no_servers_specified": "No servers specified", "general_settings": "General settings", "dns_settings": "DNS settings", diff --git a/internal/filtering/safesearch.go b/internal/filtering/safesearch.go index 39c05140..50bba61d 100644 --- a/internal/filtering/safesearch.go +++ b/internal/filtering/safesearch.go @@ -22,6 +22,7 @@ type SafeSearchConfig struct { Bing bool `yaml:"bing" json:"bing"` DuckDuckGo bool `yaml:"duckduckgo" json:"duckduckgo"` + Ecosia bool `yaml:"ecosia" json:"ecosia"` Google bool `yaml:"google" json:"google"` Pixabay bool `yaml:"pixabay" json:"pixabay"` Yandex bool `yaml:"yandex" json:"yandex"` diff --git a/internal/filtering/safesearch/rules.go b/internal/filtering/safesearch/rules.go index 75e512e8..8a784ceb 100644 --- a/internal/filtering/safesearch/rules.go +++ b/internal/filtering/safesearch/rules.go @@ -14,6 +14,9 @@ var pixabay string //go:embed rules/duckduckgo.txt var duckduckgo string +//go:embed rules/ecosia.txt +var ecosia string + //go:embed rules/yandex.txt var yandex string @@ -27,6 +30,7 @@ var youtube string var safeSearchRules = map[Service]string{ Bing: bing, DuckDuckGo: duckduckgo, + Ecosia: ecosia, Google: google, Pixabay: pixabay, Yandex: yandex, diff --git a/internal/filtering/safesearch/rules/ecosia.txt b/internal/filtering/safesearch/rules/ecosia.txt new file mode 100644 index 00000000..d75b34d3 --- /dev/null +++ b/internal/filtering/safesearch/rules/ecosia.txt @@ -0,0 +1 @@ +|www.ecosia.org^$dnsrewrite=NOERROR;CNAME;strict-safe-search.ecosia.org diff --git a/internal/filtering/safesearch/safesearch.go b/internal/filtering/safesearch/safesearch.go index 7ea1e3ad..9417102f 100644 --- a/internal/filtering/safesearch/safesearch.go +++ b/internal/filtering/safesearch/safesearch.go @@ -28,6 +28,7 @@ type Service string const ( Bing Service = "bing" DuckDuckGo Service = "duckduckgo" + Ecosia Service = "ecosia" Google Service = "google" Pixabay Service = "pixabay" Yandex Service = "yandex" @@ -41,6 +42,8 @@ func isServiceProtected(s filtering.SafeSearchConfig, service Service) (ok bool) return s.Bing case DuckDuckGo: return s.DuckDuckGo + case Ecosia: + return s.Ecosia case Google: return s.Google case Pixabay: diff --git a/internal/filtering/safesearch/safesearch_internal_test.go b/internal/filtering/safesearch/safesearch_internal_test.go index c6790dc3..24282b75 100644 --- a/internal/filtering/safesearch/safesearch_internal_test.go +++ b/internal/filtering/safesearch/safesearch_internal_test.go @@ -25,6 +25,7 @@ var defaultSafeSearchConf = filtering.SafeSearchConfig{ Enabled: true, Bing: true, DuckDuckGo: true, + Ecosia: true, Google: true, Pixabay: true, Yandex: true, diff --git a/internal/filtering/safesearch/safesearch_test.go b/internal/filtering/safesearch/safesearch_test.go index 9526c791..bcd3534d 100644 --- a/internal/filtering/safesearch/safesearch_test.go +++ b/internal/filtering/safesearch/safesearch_test.go @@ -34,6 +34,7 @@ var testConf = filtering.SafeSearchConfig{ Bing: true, DuckDuckGo: true, + Ecosia: true, Google: true, Pixabay: true, Yandex: true, diff --git a/internal/home/clientshttp.go b/internal/home/clientshttp.go index a8b31835..aae8c34a 100644 --- a/internal/home/clientshttp.go +++ b/internal/home/clientshttp.go @@ -248,6 +248,7 @@ func copySafeSearch( if conf.Enabled { conf.Bing = true conf.DuckDuckGo = true + conf.Ecosia = true conf.Google = true conf.Pixabay = true conf.Yandex = true diff --git a/internal/home/config.go b/internal/home/config.go index 2c15740c..b8d69dae 100644 --- a/internal/home/config.go +++ b/internal/home/config.go @@ -423,6 +423,7 @@ var config = &configuration{ Enabled: false, Bing: true, DuckDuckGo: true, + Ecosia: true, Google: true, Pixabay: true, Yandex: true, diff --git a/openapi/CHANGELOG.md b/openapi/CHANGELOG.md index de87f6fa..e9894c37 100644 --- a/openapi/CHANGELOG.md +++ b/openapi/CHANGELOG.md @@ -4,6 +4,14 @@ ## v0.108.0: API changes +## v0.107.55: API changes + +### The new field `"ecosia"` in `SafeSearchConfig` + +* The new field `"ecosia"` in `PUT /control/safesearch/settings` and + `GET /control/safesearch/status` is true if safe search is enforced for Ecosia + search engine. + ## v0.107.44: API changes ### The field `"upstream_mode"` in `DNSConfig` diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 300311c1..32c691d1 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -2578,6 +2578,8 @@ 'type': 'boolean' 'duckduckgo': 'type': 'boolean' + 'ecosia': + 'type': 'boolean' 'google': 'type': 'boolean' 'pixabay':