Pull request: filtering: fix qq regex legacy

Merge in DNS/adguard-home from qq-rule to master

Updates #3717.

Squashed commit of the following:

commit 1e2d50077067e5f95da645091686349ce9c8a6bc
Merge: 7290a1c4 b16b1d1d
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Wed Mar 23 14:14:10 2022 +0300

    Merge branch 'master' into qq-rule

commit 7290a1c456a7f47e91cc9485f5e112b92cb595ba
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Mar 18 20:36:17 2022 +0300

    filtering: fix qq regex legacy
This commit is contained in:
Eugene Burkov 2022-03-23 14:19:45 +03:00
parent b16b1d1d24
commit beb674ecbc
1 changed files with 132 additions and 81 deletions

View File

@ -19,9 +19,12 @@ type svc struct {
// Keep in sync with: // Keep in sync with:
// client/src/helpers/constants.js // client/src/helpers/constants.js
// client/src/components/ui/Icons.js // client/src/components/ui/Icons.js
var serviceRulesArray = []svc{ var serviceRulesArray = []svc{{
{"whatsapp", []string{"||whatsapp.net^", "||whatsapp.com^"}}, name: "whatsapp",
{"facebook", []string{ rules: []string{"||whatsapp.net^", "||whatsapp.com^"},
}, {
name: "facebook",
rules: []string{
"||facebook.com^", "||facebook.com^",
"||facebook.net^", "||facebook.net^",
"||fbcdn.net^", "||fbcdn.net^",
@ -33,9 +36,13 @@ var serviceRulesArray = []svc{
"||facebookcorewwwi.onion^", "||facebookcorewwwi.onion^",
"||fbcdn.com^", "||fbcdn.com^",
"||fb.watch^", "||fb.watch^",
}}, },
{"twitter", []string{"||twitter.com^", "||twttr.com^", "||t.co^", "||twimg.com^"}}, }, {
{"youtube", []string{ name: "twitter",
rules: []string{"||twitter.com^", "||twttr.com^", "||t.co^", "||twimg.com^"},
}, {
name: "youtube",
rules: []string{
"||youtube.com^", "||youtube.com^",
"||ytimg.com^", "||ytimg.com^",
"||youtu.be^", "||youtu.be^",
@ -43,35 +50,75 @@ var serviceRulesArray = []svc{
"||youtubei.googleapis.com^", "||youtubei.googleapis.com^",
"||youtube-nocookie.com^", "||youtube-nocookie.com^",
"||youtube", "||youtube",
}}, },
{"twitch", []string{"||twitch.tv^", "||ttvnw.net^", "||jtvnw.net^", "||twitchcdn.net^"}}, }, {
{"netflix", []string{"||nflxext.com^", "||netflix.com^", "||nflximg.net^", "||nflxvideo.net^", "||nflxso.net^"}}, name: "twitch",
{"instagram", []string{"||instagram.com^", "||cdninstagram.com^"}}, rules: []string{"||twitch.tv^", "||ttvnw.net^", "||jtvnw.net^", "||twitchcdn.net^"},
{"snapchat", []string{ }, {
name: "netflix",
rules: []string{
"||nflxext.com^",
"||netflix.com^",
"||nflximg.net^",
"||nflxvideo.net^",
"||nflxso.net^",
},
}, {
name: "instagram",
rules: []string{"||instagram.com^", "||cdninstagram.com^"},
}, {
name: "snapchat",
rules: []string{
"||snapchat.com^", "||snapchat.com^",
"||sc-cdn.net^", "||sc-cdn.net^",
"||snap-dev.net^", "||snap-dev.net^",
"||snapkit.co", "||snapkit.co",
"||snapads.com^", "||snapads.com^",
"||impala-media-production.s3.amazonaws.com^", "||impala-media-production.s3.amazonaws.com^",
}}, },
{"discord", []string{"||discord.gg^", "||discordapp.net^", "||discordapp.com^", "||discord.com^", "||discord.media^"}}, }, {
{"ok", []string{"||ok.ru^"}}, name: "discord",
{"skype", []string{"||skype.com^", "||skypeassets.com^"}}, rules: []string{
{"vk", []string{"||vk.com^", "||userapi.com^", "||vk-cdn.net^", "||vkuservideo.net^"}}, "||discord.gg^",
{"origin", []string{"||origin.com^", "||signin.ea.com^", "||accounts.ea.com^"}}, "||discordapp.net^",
{"steam", []string{ "||discordapp.com^",
"||discord.com^",
"||discord.media^",
},
}, {
name: "ok",
rules: []string{"||ok.ru^"},
}, {
name: "skype",
rules: []string{"||skype.com^", "||skypeassets.com^"},
}, {
name: "vk",
rules: []string{"||vk.com^", "||userapi.com^", "||vk-cdn.net^", "||vkuservideo.net^"},
}, {
name: "origin",
rules: []string{"||origin.com^", "||signin.ea.com^", "||accounts.ea.com^"},
}, {
name: "steam",
rules: []string{
"||steam.com^", "||steam.com^",
"||steampowered.com^", "||steampowered.com^",
"||steamcommunity.com^", "||steamcommunity.com^",
"||steamstatic.com^", "||steamstatic.com^",
"||steamstore-a.akamaihd.net^", "||steamstore-a.akamaihd.net^",
"||steamcdn-a.akamaihd.net^", "||steamcdn-a.akamaihd.net^",
}}, },
{"epic_games", []string{"||epicgames.com^", "||easyanticheat.net^", "||easy.ac^", "||eac-cdn.com^"}}, }, {
{"reddit", []string{"||reddit.com^", "||redditstatic.com^", "||redditmedia.com^", "||redd.it^"}}, name: "epic_games",
{"mail_ru", []string{"||mail.ru^"}}, rules: []string{"||epicgames.com^", "||easyanticheat.net^", "||easy.ac^", "||eac-cdn.com^"},
{"cloudflare", []string{ }, {
name: "reddit",
rules: []string{"||reddit.com^", "||redditstatic.com^", "||redditmedia.com^", "||redd.it^"},
}, {
name: "mail_ru",
rules: []string{"||mail.ru^"},
}, {
name: "cloudflare",
rules: []string{
"||cloudflare.com^", "||cloudflare.com^",
"||cloudflare-dns.com^", "||cloudflare-dns.com^",
"||cloudflare.net^", "||cloudflare.net^",
@ -86,8 +133,10 @@ var serviceRulesArray = []svc{
"||warp.plus^", "||warp.plus^",
"||1.1.1.1^", "||1.1.1.1^",
"||dns4torpnlfs2ifuz2s2yf3fc7rdmsbhm6rw75euj35pac6ap25zgqad.onion^", "||dns4torpnlfs2ifuz2s2yf3fc7rdmsbhm6rw75euj35pac6ap25zgqad.onion^",
}}, },
{"amazon", []string{ }, {
name: "amazon",
rules: []string{
"||amazon.com^", "||amazon.com^",
"||media-amazon.com^", "||media-amazon.com^",
"||primevideo.com^", "||primevideo.com^",
@ -114,8 +163,10 @@ var serviceRulesArray = []svc{
"||amazon.co.uk^", "||amazon.co.uk^",
"||createspace.com^", "||createspace.com^",
"||aws", "||aws",
}}, },
{"ebay", []string{ }, {
name: "ebay",
rules: []string{
"||ebay.com^", "||ebay.com^",
"||ebayimg.com^", "||ebayimg.com^",
"||ebaystatic.com^", "||ebaystatic.com^",
@ -141,8 +192,10 @@ var serviceRulesArray = []svc{
"||ebay.com.my^", "||ebay.com.my^",
"||ebay.com.sg^", "||ebay.com.sg^",
"||ebay.co.uk^", "||ebay.co.uk^",
}}, },
{"tiktok", []string{ }, {
name: "tiktok",
rules: []string{
"||tiktok.com^", "||tiktok.com^",
"||tiktokcdn.com^", "||tiktokcdn.com^",
"||musical.ly^", "||musical.ly^",
@ -162,59 +215,55 @@ var serviceRulesArray = []svc{
"||bytedance.map.fastly.net^", "||bytedance.map.fastly.net^",
"||douyin.com^", "||douyin.com^",
"||tiktokv.com^", "||tiktokv.com^",
}}, },
{"vimeo", []string{ }, {
"||vimeo.com^", name: "vimeo",
"||vimeocdn.com^", rules: []string{"||vimeo.com^", "||vimeocdn.com^", "*vod-adaptive.akamaized.net^"},
"*vod-adaptive.akamaized.net^", }, {
}}, name: "pinterest",
{"pinterest", []string{ rules: []string{"||pinterest.*^", "||pinimg.com^"},
"||pinterest.*^", }, {
"||pinimg.com^", name: "imgur",
}}, rules: []string{"||imgur.com^"},
{"imgur", []string{ }, {
"||imgur.com^", name: "dailymotion",
}}, rules: []string{"||dailymotion.com^", "||dm-event.net^", "||dmcdn.net^"},
{"dailymotion", []string{ }, {
"||dailymotion.com^", name: "qq",
"||dm-event.net^", rules: []string{
"||dmcdn.net^", // Block qq.com and subdomains excluding WeChat's domains.
}}, "||qq.com^$denyallow=wx.qq.com|weixin.qq.com",
{"qq", []string{
// block qq.com and subdomains excluding WeChat domains
"||qq.com^$denyallow=wx*.qq.com|weixin.qq.com",
"||qqzaixian.com^", "||qqzaixian.com^",
}}, },
{"wechat", []string{ }, {
"||wechat.com^", name: "wechat",
"||weixin.qq.com^", rules: []string{"||wechat.com^", "||weixin.qq.com^", "||wx.qq.com^"},
"||wx.qq.com^", }, {
}}, name: "viber",
{"viber", []string{ rules: []string{"||viber.com^"},
"||viber.com^", }, {
}}, name: "weibo",
{"weibo", []string{ rules: []string{"||weibo.com^"},
"||weibo.com^", }, {
}}, name: "9gag",
{"9gag", []string{ rules: []string{"||9cache.com^", "||9gag.com^"},
"||9cache.com^", }, {
"||9gag.com^", name: "telegram",
}}, rules: []string{"||t.me^", "||telegram.me^", "||telegram.org^"},
{"telegram", []string{ }, {
"||t.me^", name: "disneyplus",
"||telegram.me^", rules: []string{
"||telegram.org^",
}},
{"disneyplus", []string{
"||disney-plus.net^", "||disney-plus.net^",
"||disneyplus.com^", "||disneyplus.com^",
"||disney.playback.edge.bamgrid.com^", "||disney.playback.edge.bamgrid.com^",
"||media.dssott.com^", "||media.dssott.com^",
}}, },
{"hulu", []string{ }, {
"||hulu.com^", name: "hulu",
}}, rules: []string{"||hulu.com^"},
{"spotify", []string{ }, {
name: "spotify",
rules: []string{
"/_spotify-connect._tcp.local/", "/_spotify-connect._tcp.local/",
"||spotify.com^", "||spotify.com^",
"||scdn.co^", "||scdn.co^",
@ -226,13 +275,15 @@ var serviceRulesArray = []svc{
"||audio4-ak-spotify-com.akamaized.net^", "||audio4-ak-spotify-com.akamaized.net^",
"||heads-ak-spotify-com.akamaized.net^", "||heads-ak-spotify-com.akamaized.net^",
"||heads4-ak-spotify-com.akamaized.net^", "||heads4-ak-spotify-com.akamaized.net^",
}}, },
{"tinder", []string{ }, {
name: "tinder",
rules: []string{
"||gotinder.com^", "||gotinder.com^",
"||tinder.com^", "||tinder.com^",
"||tindersparks.com^", "||tindersparks.com^",
}}, },
} }}
// convert array to map // convert array to map
func initBlockedServices() { func initBlockedServices() {