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 --- a/client/src/components/ui/Icons.js +++ b/client/src/components/ui/Icons.js @@ -104,14 +104,8 @@ const Icons = () => ( d="M16.2,4c-3.3,0-6.9,1.2-7.7,5.3C8.4,9.7,8.7,10,9,10l3.3,0.3c0.3,0,0.6-0.3,0.6-0.6c0.3-1.4,1.5-2.1,2.8-2.1c0.7,0,1.5,0.3,1.9,0.9c0.5,0.7,0.4,1.7,0.4,2.5v0.5c-2,0.2-4.6,0.4-6.5,1.2c-2.2,0.9-3.7,2.8-3.7,5.7c0,3.6,2.3,5.4,5.2,5.4c2.5,0,3.8-0.6,5.7-2.5c0.6,0.9,0.9,1.4,2,2.3c0.3,0.1,0.6,0.1,0.8-0.1v0c0.7-0.6,2-1.7,2.7-2.3c0.3-0.2,0.2-0.6,0-0.9c-0.6-0.9-1.3-1.6-1.3-3.2v-5.4c0-2.3,0.2-4.4-1.5-6C20.1,4.4,17.9,4,16.2,4z M17.1,14.3c0.3,0,0.6,0,0.9,0v0.8c0,1.3,0.1,2.5-0.6,3.7c-0.5,1-1.4,1.6-2.4,1.6c-1.3,0-2.1-1-2.1-2.5C12.9,15.2,14.9,14.5,17.1,14.3z M26.7,22.4c-0.9,0-1.9,0.2-2.7,0.8c-0.2,0.2-0.2,0.4,0.1,0.4c0.9-0.1,2.8-0.4,3.2,0.1s-0.4,2.3-0.7,3.1c-0.1,0.2,0.1,0.3,0.3,0.2c1.5-1.2,1.9-3.8,1.6-4.2C28.3,22.5,27.6,22.4,26.7,22.4z M3.7,22.8c-0.2,0-0.3,0.3-0.1,0.4c3.3,3,7.6,4.7,12.4,4.7c3.4,0,7.4-1.1,10.2-3.1c0.5-0.3,0.1-0.9-0.4-0.7c-3.1,1.3-6.4,1.9-9.5,1.9c-4.5,0-8.8-1.2-12.4-3.3C3.8,22.9,3.7,22.8,3.7,22.8z" /> - - - - - - + + ( d="M8.036 10.93l3.93 4.07 4.068-3.93" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); 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("];") +}