Pull request: 5009-ecosia-safesearch

Squashed commit of the following:

commit 787b5d4039
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Wed Jul 31 15:09:18 2024 +0300

    configmigrate: revert

commit a036638c05
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Wed Jul 31 09:37:25 2024 +0300

    docs

commit a3b2e8de4b
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Wed Jul 31 09:18:25 2024 +0300

    locales

commit a01a22019e
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Wed Jul 31 09:02:14 2024 +0300

    filtering: imp code

commit bc268cdd52
Merge: 5ad88d914 bc6d20ff1
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Wed Jul 31 08:00:05 2024 +0300

    Merge remote-tracking branch 'origin/master' into 5009-ecosia-safesearch

commit 5ad88d914c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Tue Jul 30 13:49:51 2024 +0300

    all: ecosia safesearch
This commit is contained in:
Dimitry Kolyshev 2024-08-02 09:10:19 +03:00
parent bc6d20ff10
commit b6ed769652
12 changed files with 29 additions and 1 deletions

View File

@ -27,12 +27,17 @@ See also the [v0.107.53 GitHub milestone][ms-v0.107.53].
NOTE: Add new changes BELOW THIS COMMENT. NOTE: Add new changes BELOW THIS COMMENT.
--> -->
### Added
- Ecosia search engine is now supported in safe search ([#5009]).
### Fixed ### Fixed
- Update Google safe search domains list ([#7155]). - Update Google safe search domains list ([#7155]).
- Enforce Bing safe search from Edge sidebar ([#7154]). - Enforce Bing safe search from Edge sidebar ([#7154]).
- Text overflow on the query log page ([#7119]). - Text overflow on the query log page ([#7119]).
[#5009]: https://github.com/AdguardTeam/AdGuardHome/issues/5009
[#7119]: https://github.com/AdguardTeam/AdGuardHome/issues/7119 [#7119]: https://github.com/AdguardTeam/AdGuardHome/issues/7119
[#7154]: https://github.com/AdguardTeam/AdGuardHome/pull/7154 [#7154]: https://github.com/AdguardTeam/AdGuardHome/pull/7154
[#7155]: https://github.com/AdguardTeam/AdGuardHome/pull/7155 [#7155]: https://github.com/AdguardTeam/AdGuardHome/pull/7155

View File

@ -154,7 +154,7 @@
"use_adguard_parental": "Use AdGuard parental control web service", "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.", "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_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", "no_servers_specified": "No servers specified",
"general_settings": "General settings", "general_settings": "General settings",
"dns_settings": "DNS settings", "dns_settings": "DNS settings",

View File

@ -22,6 +22,7 @@ type SafeSearchConfig struct {
Bing bool `yaml:"bing" json:"bing"` Bing bool `yaml:"bing" json:"bing"`
DuckDuckGo bool `yaml:"duckduckgo" json:"duckduckgo"` DuckDuckGo bool `yaml:"duckduckgo" json:"duckduckgo"`
Ecosia bool `yaml:"ecosia" json:"ecosia"`
Google bool `yaml:"google" json:"google"` Google bool `yaml:"google" json:"google"`
Pixabay bool `yaml:"pixabay" json:"pixabay"` Pixabay bool `yaml:"pixabay" json:"pixabay"`
Yandex bool `yaml:"yandex" json:"yandex"` Yandex bool `yaml:"yandex" json:"yandex"`

View File

@ -14,6 +14,9 @@ var pixabay string
//go:embed rules/duckduckgo.txt //go:embed rules/duckduckgo.txt
var duckduckgo string var duckduckgo string
//go:embed rules/ecosia.txt
var ecosia string
//go:embed rules/yandex.txt //go:embed rules/yandex.txt
var yandex string var yandex string
@ -27,6 +30,7 @@ var youtube string
var safeSearchRules = map[Service]string{ var safeSearchRules = map[Service]string{
Bing: bing, Bing: bing,
DuckDuckGo: duckduckgo, DuckDuckGo: duckduckgo,
Ecosia: ecosia,
Google: google, Google: google,
Pixabay: pixabay, Pixabay: pixabay,
Yandex: yandex, Yandex: yandex,

View File

@ -0,0 +1 @@
|www.ecosia.org^$dnsrewrite=NOERROR;CNAME;strict-safe-search.ecosia.org

View File

@ -28,6 +28,7 @@ type Service string
const ( const (
Bing Service = "bing" Bing Service = "bing"
DuckDuckGo Service = "duckduckgo" DuckDuckGo Service = "duckduckgo"
Ecosia Service = "ecosia"
Google Service = "google" Google Service = "google"
Pixabay Service = "pixabay" Pixabay Service = "pixabay"
Yandex Service = "yandex" Yandex Service = "yandex"
@ -41,6 +42,8 @@ func isServiceProtected(s filtering.SafeSearchConfig, service Service) (ok bool)
return s.Bing return s.Bing
case DuckDuckGo: case DuckDuckGo:
return s.DuckDuckGo return s.DuckDuckGo
case Ecosia:
return s.Ecosia
case Google: case Google:
return s.Google return s.Google
case Pixabay: case Pixabay:

View File

@ -25,6 +25,7 @@ var defaultSafeSearchConf = filtering.SafeSearchConfig{
Enabled: true, Enabled: true,
Bing: true, Bing: true,
DuckDuckGo: true, DuckDuckGo: true,
Ecosia: true,
Google: true, Google: true,
Pixabay: true, Pixabay: true,
Yandex: true, Yandex: true,

View File

@ -34,6 +34,7 @@ var testConf = filtering.SafeSearchConfig{
Bing: true, Bing: true,
DuckDuckGo: true, DuckDuckGo: true,
Ecosia: true,
Google: true, Google: true,
Pixabay: true, Pixabay: true,
Yandex: true, Yandex: true,

View File

@ -248,6 +248,7 @@ func copySafeSearch(
if conf.Enabled { if conf.Enabled {
conf.Bing = true conf.Bing = true
conf.DuckDuckGo = true conf.DuckDuckGo = true
conf.Ecosia = true
conf.Google = true conf.Google = true
conf.Pixabay = true conf.Pixabay = true
conf.Yandex = true conf.Yandex = true

View File

@ -423,6 +423,7 @@ var config = &configuration{
Enabled: false, Enabled: false,
Bing: true, Bing: true,
DuckDuckGo: true, DuckDuckGo: true,
Ecosia: true,
Google: true, Google: true,
Pixabay: true, Pixabay: true,
Yandex: true, Yandex: true,

View File

@ -4,6 +4,14 @@
## v0.108.0: API changes ## 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 ## v0.107.44: API changes
### The field `"upstream_mode"` in `DNSConfig` ### The field `"upstream_mode"` in `DNSConfig`

View File

@ -2578,6 +2578,8 @@
'type': 'boolean' 'type': 'boolean'
'duckduckgo': 'duckduckgo':
'type': 'boolean' 'type': 'boolean'
'ecosia':
'type': 'boolean'
'google': 'google':
'type': 'boolean' 'type': 'boolean'
'pixabay': 'pixabay':