diff --git a/CHANGELOG.md b/CHANGELOG.md index b4af0e4a..858d11e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to ### Added +- Added more services to the "Blocked services" list ([#2224], [#2401]). - `ipset` subdomain matching, just like `dnsmasq` does ([#2179]). - Client ID support for DNS-over-HTTPS, DNS-over-QUIC, and DNS-over-TLS ([#1383]). @@ -33,10 +34,12 @@ and this project adheres to [#1383]: https://github.com/AdguardTeam/AdGuardHome/issues/1383 [#2102]: https://github.com/AdguardTeam/AdGuardHome/issues/2102 [#2179]: https://github.com/AdguardTeam/AdGuardHome/issues/2179 +[#2224]: https://github.com/AdguardTeam/AdGuardHome/issues/2224 [#2302]: https://github.com/AdguardTeam/AdGuardHome/issues/2302 [#2304]: https://github.com/AdguardTeam/AdGuardHome/issues/2304 [#2305]: https://github.com/AdguardTeam/AdGuardHome/issues/2305 [#2337]: https://github.com/AdguardTeam/AdGuardHome/issues/2337 +[#2401]: https://github.com/AdguardTeam/AdGuardHome/issues/2401 ### Changed diff --git a/README.md b/README.md index 41b5ab43..5402dc4c 100644 --- a/README.md +++ b/README.md @@ -303,7 +303,7 @@ Here is a link to AdGuard Home project: https://crowdin.com/project/adguard-appl Here's what you can also do to contribute: 1. [Look for issues](https://github.com/AdguardTeam/AdGuardHome/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22+) marked as "help wanted". -2. Actualize the list of *Blocked services*. It it can be found in [dnsfilter/blocked_services.go](https://github.com/AdguardTeam/AdGuardHome/blob/master/internal/dnsfilter/blocked_services.go). +2. Actualize the list of *Blocked services*. It it can be found in [dnsfilter/blocked.go](https://github.com/AdguardTeam/AdGuardHome/blob/master/internal/dnsfilter/blocked.go). 3. Actualize the list of known *trackers*. It it can be found in [client/src/helpers/trackers/adguard.json](https://github.com/AdguardTeam/AdGuardHome/blob/master/client/src/helpers/trackers/adguard.json). 4. Actualize the list of vetted *blocklists*. It it can be found in [client/src/helpers/filters/filters.json](https://github.com/AdguardTeam/AdGuardHome/blob/master/client/src/helpers/filters/filters.json). diff --git a/client/src/components/ui/Icons.js b/client/src/components/ui/Icons.js index ec5bf8a3..e2186529 100644 Binary files a/client/src/components/ui/Icons.js and b/client/src/components/ui/Icons.js differ diff --git a/client/src/helpers/constants.js b/client/src/helpers/constants.js index b50ed007..bab8c925 100644 --- a/client/src/helpers/constants.js +++ b/client/src/helpers/constants.js @@ -200,92 +200,144 @@ export const FILTERS_URLS = { export const SERVICES = [ { - id: 'facebook', - name: 'Facebook', - }, - { - id: 'whatsapp', - name: 'WhatsApp', - }, - { - id: 'instagram', - name: 'Instagram', - }, - { - id: 'twitter', - name: 'Twitter', - }, - { - id: 'youtube', - name: 'YouTube', - }, - { - id: 'netflix', - name: 'Netflix', - }, - { - id: 'snapchat', - name: 'Snapchat', - }, - { - id: 'twitch', - name: 'Twitch', - }, - { - id: 'discord', - name: 'Discord', - }, - { - id: 'skype', - name: 'Skype', + id: '9gag', + name: '9Gag', }, { id: 'amazon', name: 'Amazon', }, - { - id: 'ebay', - name: 'eBay', - }, - { - id: 'origin', - name: 'Origin', - }, { id: 'cloudflare', - name: 'Cloudflare', + name: 'CloudFlare', }, { - id: 'steam', - name: 'Steam', + id: 'dailymotion', + name: 'Dailymotion', + }, + { + id: 'discord', + name: 'Discord', + }, + { + id: 'disneyplus', + name: 'Disney+', + }, + { + id: 'ebay', + name: 'EBay', }, { id: 'epic_games', name: 'Epic Games', }, + { + id: 'facebook', + name: 'Facebook', + }, + { + id: 'hulu', + name: 'Hulu', + }, + { + id: 'imgur', + name: 'Imgur', + }, + { + id: 'instagram', + name: 'Instagram', + }, + { + id: 'mail_ru', + name: 'Mail.ru', + }, + { + id: 'netflix', + name: 'Netflix', + }, + { + id: 'ok', + name: 'OK.ru', + }, + { + id: 'origin', + name: 'Origin', + }, + { + id: 'pinterest', + name: 'Pinterest', + }, + { + id: 'qq', + name: 'QQ', + }, { id: 'reddit', name: 'Reddit', }, { - id: 'ok', - name: 'OK', + id: 'skype', + name: 'Skype', }, { - id: 'vk', - name: 'VK', + id: 'snapchat', + name: 'Snapchat', }, { - id: 'mail_ru', - name: 'mail.ru', + id: 'spotify', + name: 'Spotify', + }, + { + id: 'steam', + name: 'Steam', + }, + { + id: 'telegram', + name: 'Telegram', }, { id: 'tiktok', name: 'TikTok', }, { - id: 'qq', - name: 'QQ', + id: 'tinder', + name: 'Tinder', + }, + { + id: 'twitch', + name: 'Twitch', + }, + { + id: 'twitter', + name: 'Twitter', + }, + { + id: 'viber', + name: 'Viber', + }, + { + id: 'vimeo', + name: 'Vimeo', + }, + { + id: 'vk', + name: 'VK.com', + }, + { + id: 'wechat', + name: 'WeChat', + }, + { + id: 'weibo', + name: 'Weibo', + }, + { + id: 'whatsapp', + name: 'WhatsApp', + }, + { + id: 'youtube', + name: 'YouTube', }, ]; diff --git a/internal/dnsfilter/blocked.go b/internal/dnsfilter/blocked.go index 473010c0..0905933b 100644 --- a/internal/dnsfilter/blocked.go +++ b/internal/dnsfilter/blocked.go @@ -161,7 +161,73 @@ var serviceRulesArray = []svc{ "||douyin.com^", "||tiktokv.com^", }}, - {"qq", []string{"||qq.com^", "||qqzaixian.com^"}}, + {"vimeo", []string{ + "||vimeo.com^", + "||vimeocdn.com^", + "*vod-adaptive.akamaized.net^", + }}, + {"pinterest", []string{ + "||pinterest.*^", + "||pinimg.com^", + }}, + {"imgur", []string{ + "||imgur.com^", + }}, + {"dailymotion", []string{ + "||dailymotion.com^", + "||dm-event.net^", + "||dmcdn.net^", + }}, + {"qq", []string{ + // block qq.com and subdomains excluding WeChat domains + "^(?!weixin|wx)([^.]+\\.)?qq\\.com$", + "||qqzaixian.com^", + }}, + {"wechat", []string{ + "||wechat.com^", + "||weixin.qq.com^", + "||wx.qq.com^", + }}, + {"viber", []string{ + "||viber.com^", + }}, + {"weibo", []string{ + "||weibo.com^", + }}, + {"9gag", []string{ + "||9cache.com^", + "||gag.com^", + }}, + {"telegram", []string{ + "||t.me^", + "||telegram.me^", + "||telegram.org^", + }}, + {"disneyplus", []string{ + "||disney-plus.net^", + "||disneyplus.com^", + }}, + {"hulu", []string{ + "||hulu.com^", + }}, + {"spotify", []string{ + "/_spotify-connect._tcp.local/", + "||spotify.com^", + "||scdn.co^", + "||spotify.com.edgesuite.net^", + "||spotify.map.fastly.net^", + "||spotify.map.fastlylb.net^", + "||spotifycdn.net^", + "||audio-ak-spotify-com.akamaized.net^", + "||audio4-ak-spotify-com.akamaized.net^", + "||heads-ak-spotify-com.akamaized.net^", + "||heads4-ak-spotify-com.akamaized.net^", + }}, + {"tinder", []string{ + "||gotinder.com^", + "||tinder.com^", + "||tindersparks.com^", + }}, } // convert array to map diff --git a/internal/dnsfilter/blocked_test.go b/internal/dnsfilter/blocked_test.go new file mode 100644 index 00000000..5227da6b --- /dev/null +++ b/internal/dnsfilter/blocked_test.go @@ -0,0 +1,37 @@ +// +build ignore + +package dnsfilter + +import ( + "fmt" + "sort" + "testing" +) + +// This is a simple tool that takes a list of services and prints them to the output. +// It is supposed to be used to update: +// client/src/helpers/constants.js +// client/src/components/ui/Icons.js +// +// Usage: +// 1. go run ./internal/dnsfilter/blocked_test.go +// 2. Use the output to replace `SERVICES` array in "client/src/helpers/constants.js". +// 3. You'll need to enter services names manually. +// 4. Don't forget to add missing icons to "client/src/components/ui/Icons.js". +// +// TODO(ameshkov): Rework generator: have a JSON file with all the metadata we need +// then use this JSON file to generate JS and Go code +func TestGenServicesArray(t *testing.T) { + services := make([]svc, len(serviceRulesArray)) + copy(services, serviceRulesArray) + + sort.Slice(services, func(i, j int) bool { + return services[i].name < services[j].name + }) + + fmt.Println("export const SERVICES = [") + for _, s := range services { + fmt.Printf(" {\n id: '%s',\n name: '%s',\n },\n", s.name, s.name) + } + fmt.Println("];") +}