Skip to content

Commit

Permalink
Added several blocked services
Browse files Browse the repository at this point in the history
Closes AdguardTeam#2224
Closes AdguardTeam#2401

Squashed commit of the following:

commit 8d42209
Merge: 7a8f598 fa33568
Author: Andrey Meshkov <am@adguard.com>
Date:   Thu Feb 4 17:57:32 2021 +0300

    Merge branch 'master' into fix-2224

commit 7a8f598
Author: Andrey Meshkov <am@adguard.com>
Date:   Thu Feb 4 17:34:53 2021 +0300

    Review comments

commit 181db86
Author: Andrey Meshkov <am@adguard.com>
Date:   Thu Feb 4 17:20:20 2021 +0300

    fixed review comments

commit fd5b081
Author: Ildar Kamalov <ik@adguard.com>
Date:   Thu Feb 4 16:10:29 2021 +0300

    + client: add service icons

commit 724e0c2
Author: Andrey Meshkov <am@adguard.com>
Date:   Thu Feb 4 15:42:53 2021 +0300

    Added several blocked services

    Closes AdguardTeam#2224
    Closes AdguardTeam#2401
  • Loading branch information
ameshkov authored and heyxkhoa committed Mar 17, 2023
1 parent ea44a84 commit 96af554
Show file tree
Hide file tree
Showing 6 changed files with 251 additions and 47 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]).
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
62 changes: 54 additions & 8 deletions client/src/components/ui/Icons.js

Large diffs are not rendered by default.

126 changes: 89 additions & 37 deletions client/src/helpers/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,93 +199,145 @@ export const FILTERS_URLS = {
};

export const SERVICES = [
{
id: '9gag',
name: '9Gag',
},
{
id: 'amazon',
name: 'Amazon',
},
{
id: 'cloudflare',
name: 'CloudFlare',
},
{
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: 'whatsapp',
name: 'WhatsApp',
id: 'hulu',
name: 'Hulu',
},
{
id: 'instagram',
name: 'Instagram',
id: 'imgur',
name: 'Imgur',
},
{
id: 'twitter',
name: 'Twitter',
id: 'instagram',
name: 'Instagram',
},
{
id: 'youtube',
name: 'YouTube',
id: 'mail_ru',
name: 'Mail.ru',
},
{
id: 'netflix',
name: 'Netflix',
},
{
id: 'snapchat',
name: 'Snapchat',
id: 'ok',
name: 'OK.ru',
},
{
id: 'twitch',
name: 'Twitch',
id: 'origin',
name: 'Origin',
},
{
id: 'discord',
name: 'Discord',
id: 'pinterest',
name: 'Pinterest',
},
{
id: 'skype',
name: 'Skype',
id: 'qq',
name: 'QQ',
},
{
id: 'amazon',
name: 'Amazon',
id: 'reddit',
name: 'Reddit',
},
{
id: 'ebay',
name: 'eBay',
id: 'skype',
name: 'Skype',
},
{
id: 'origin',
name: 'Origin',
id: 'snapchat',
name: 'Snapchat',
},
{
id: 'cloudflare',
name: 'Cloudflare',
id: 'spotify',
name: 'Spotify',
},
{
id: 'steam',
name: 'Steam',
},
{
id: 'epic_games',
name: 'Epic Games',
id: 'telegram',
name: 'Telegram',
},
{
id: 'reddit',
name: 'Reddit',
id: 'tiktok',
name: 'TikTok',
},
{
id: 'ok',
name: 'OK',
id: 'tinder',
name: 'Tinder',
},
{
id: 'twitch',
name: 'Twitch',
},
{
id: 'twitter',
name: 'Twitter',
},
{
id: 'viber',
name: 'Viber',
},
{
id: 'vimeo',
name: 'Vimeo',
},
{
id: 'vk',
name: 'VK',
name: 'VK.com',
},
{
id: 'mail_ru',
name: 'mail.ru',
id: 'wechat',
name: 'WeChat',
},
{
id: 'tiktok',
name: 'TikTok',
id: 'weibo',
name: 'Weibo',
},
{
id: 'qq',
name: 'QQ',
id: 'whatsapp',
name: 'WhatsApp',
},
{
id: 'youtube',
name: 'YouTube',
},
];

Expand Down
68 changes: 67 additions & 1 deletion internal/dnsfilter/blocked.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 37 additions & 0 deletions internal/dnsfilter/blocked_test.go
Original file line number Diff line number Diff line change
@@ -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("];")
}

0 comments on commit 96af554

Please sign in to comment.