Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/filters-list-per-client'
Browse files Browse the repository at this point in the history
  • Loading branch information
hoang-rio committed Aug 4, 2024
2 parents a5d72cd + 9d49868 commit 0cc2ed6
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion client/src/__locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions internal/filtering/safesearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
4 changes: 4 additions & 0 deletions internal/filtering/safesearch/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -27,6 +30,7 @@ var youtube string
var safeSearchRules = map[Service]string{
Bing: bing,
DuckDuckGo: duckduckgo,
Ecosia: ecosia,
Google: google,
Pixabay: pixabay,
Yandex: yandex,
Expand Down
1 change: 1 addition & 0 deletions internal/filtering/safesearch/rules/ecosia.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
|www.ecosia.org^$dnsrewrite=NOERROR;CNAME;strict-safe-search.ecosia.org
3 changes: 3 additions & 0 deletions internal/filtering/safesearch/safesearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions internal/filtering/safesearch/safesearch_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var defaultSafeSearchConf = filtering.SafeSearchConfig{
Enabled: true,
Bing: true,
DuckDuckGo: true,
Ecosia: true,
Google: true,
Pixabay: true,
Yandex: true,
Expand Down
1 change: 1 addition & 0 deletions internal/filtering/safesearch/safesearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var testConf = filtering.SafeSearchConfig{

Bing: true,
DuckDuckGo: true,
Ecosia: true,
Google: true,
Pixabay: true,
Yandex: true,
Expand Down
1 change: 1 addition & 0 deletions internal/home/clientshttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ func copySafeSearch(
if conf.Enabled {
conf.Bing = true
conf.DuckDuckGo = true
conf.Ecosia = true
conf.Google = true
conf.Pixabay = true
conf.Yandex = true
Expand Down
1 change: 1 addition & 0 deletions internal/home/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ var config = &configuration{
Enabled: false,
Bing: true,
DuckDuckGo: true,
Ecosia: true,
Google: true,
Pixabay: true,
Yandex: true,
Expand Down
8 changes: 8 additions & 0 deletions openapi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 2 additions & 0 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2651,6 +2651,8 @@
'type': 'boolean'
'duckduckgo':
'type': 'boolean'
'ecosia':
'type': 'boolean'
'google':
'type': 'boolean'
'pixabay':
Expand Down

0 comments on commit 0cc2ed6

Please sign in to comment.