Skip to content

Commit

Permalink
Added several blocked services
Browse files Browse the repository at this point in the history
Closes #2224
Closes #2401
  • Loading branch information
ameshkov committed Feb 4, 2021
1 parent 676f8c7 commit 724e0c2
Show file tree
Hide file tree
Showing 4 changed files with 188 additions and 39 deletions.
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
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
31 changes: 31 additions & 0 deletions internal/dnsfilter/blocked_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// +build ignore

package dnsfilter

import (
"fmt"
"sort"
"testing"
)

// TestPrintServices - this is a simple tool that takes a list of
// services and prints them to the output
// supposed to be used to update:
// client/src/helpers/constants.js
// client/src/components/ui/Icons.js
func TestPrintServices(t *testing.T) {
arr := make([]svc, len(serviceRulesArray))
copy(arr, serviceRulesArray)

sort.Slice(arr, func(i, j int) bool {
left := arr[i]
right := arr[j]
return left.name < right.name
})

fmt.Println("export const SERVICES = [")
for _, s := range arr {
fmt.Printf(" {\n id: '%s',\n name: '%s',\n },\n", s.name, s.name)
}
fmt.Println("];")
}

0 comments on commit 724e0c2

Please sign in to comment.