mirror of
https://github.com/v2fly/domain-list-community.git
synced 2026-01-09 16:24:05 +07:00
Compare commits
29 Commits
2026010510
...
maingo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cbd681a8fb | ||
|
|
2b031241a2 | ||
|
|
345d66ffa0 | ||
|
|
e7564e29d8 | ||
|
|
c823945856 | ||
|
|
2ad6b58045 | ||
|
|
4c6ab37622 | ||
|
|
e5c3408a13 | ||
|
|
67389b37cc | ||
|
|
39431a9e8f | ||
|
|
b8fc0cd9d7 | ||
|
|
9f59a5e666 | ||
|
|
07f769cf85 | ||
|
|
6833d994c0 | ||
|
|
b150c66d47 | ||
|
|
248c0f7b86 | ||
|
|
de2c5cf208 | ||
|
|
44d511e74e | ||
|
|
5928f612ba | ||
|
|
246b6150af | ||
|
|
ffb25af399 | ||
|
|
f96f3d1abd | ||
|
|
8fc66473ff | ||
|
|
49101e3aab | ||
|
|
d2c662bf5e | ||
|
|
7a6e4cb1f5 | ||
|
|
511577436c | ||
|
|
8a2718204b | ||
|
|
e3b3197a42 |
13
data/apple
13
data/apple
@@ -1,5 +1,5 @@
|
|||||||
include:apple-ads
|
include:apple-ads
|
||||||
include:apple-dev
|
include:apple-dev # swift inside
|
||||||
# Not include:apple-intelligence
|
# Not include:apple-intelligence
|
||||||
include:apple-pki
|
include:apple-pki
|
||||||
include:apple-tvplus
|
include:apple-tvplus
|
||||||
@@ -7,7 +7,6 @@ include:apple-update
|
|||||||
include:beats
|
include:beats
|
||||||
include:icloud
|
include:icloud
|
||||||
include:itunes
|
include:itunes
|
||||||
include:swift
|
|
||||||
|
|
||||||
# All .apple domains
|
# All .apple domains
|
||||||
apple
|
apple
|
||||||
@@ -856,7 +855,7 @@ full:s4.mzstatic.com @cn
|
|||||||
full:s5.mzstatic.com @cn
|
full:s5.mzstatic.com @cn
|
||||||
|
|
||||||
# The rules below are from https://github.com/felixonmars/dnsmasq-china-list/blob/master/apple.china.conf
|
# The rules below are from https://github.com/felixonmars/dnsmasq-china-list/blob/master/apple.china.conf
|
||||||
# Revision: 4d392cc0a822ac5626bb97fef3fe5e04e86b28b0
|
# Revision: f6a2093b254a7d2baca959bd16581666ca394303
|
||||||
# Duplicates removed
|
# Duplicates removed
|
||||||
# According to the consensus in #503, do not include the domain name apps.apple.com directly.
|
# According to the consensus in #503, do not include the domain name apps.apple.com directly.
|
||||||
# Use in config file like this: "geosite:apple@cn"
|
# Use in config file like this: "geosite:apple@cn"
|
||||||
@@ -874,7 +873,6 @@ full:cds-cdn.v.aaplimg.com @cn
|
|||||||
full:cds.apple.com @cn
|
full:cds.apple.com @cn
|
||||||
full:cds.apple.com.akadns.net @cn
|
full:cds.apple.com.akadns.net @cn
|
||||||
full:cdsassets.apple.com @cn
|
full:cdsassets.apple.com @cn
|
||||||
full:certs.apple.com @cn
|
|
||||||
full:cl2-cn.apple.com @cn
|
full:cl2-cn.apple.com @cn
|
||||||
full:cl4-cn.apple.com @cn
|
full:cl4-cn.apple.com @cn
|
||||||
full:clientflow.apple.com @cn
|
full:clientflow.apple.com @cn
|
||||||
@@ -882,7 +880,6 @@ full:clientflow.apple.com.akadns.net @cn
|
|||||||
full:cn-smp-paymentservices.apple.com @cn
|
full:cn-smp-paymentservices.apple.com @cn
|
||||||
full:configuration.apple.com @cn
|
full:configuration.apple.com @cn
|
||||||
full:configuration.apple.com.akadns.net @cn
|
full:configuration.apple.com.akadns.net @cn
|
||||||
full:crl.apple.com @cn
|
|
||||||
full:cstat.apple.com @cn
|
full:cstat.apple.com @cn
|
||||||
full:cstat.cdn-apple.com @cn
|
full:cstat.cdn-apple.com @cn
|
||||||
full:dd-cdn.origin-apple.com.akadns.net @cn
|
full:dd-cdn.origin-apple.com.akadns.net @cn
|
||||||
@@ -935,10 +932,6 @@ full:mesu-china.apple.com.akadns.net @cn
|
|||||||
full:mesu.apple.com @cn
|
full:mesu.apple.com @cn
|
||||||
full:ml.cdn-apple.com @cn
|
full:ml.cdn-apple.com @cn
|
||||||
full:music.apple.com @cn
|
full:music.apple.com @cn
|
||||||
full:ocsp-lb.apple.com.akadns.net @cn
|
|
||||||
full:ocsp.apple.com @cn
|
|
||||||
full:ocsp2-lb.apple.com.akadns.net @cn
|
|
||||||
full:ocsp2.apple.com @cn
|
|
||||||
full:oscdn.apple.com @cn
|
full:oscdn.apple.com @cn
|
||||||
full:oscdn.origin-apple.com.akadns.net @cn
|
full:oscdn.origin-apple.com.akadns.net @cn
|
||||||
full:osxapps.itunes.g.aaplimg.com @cn
|
full:osxapps.itunes.g.aaplimg.com @cn
|
||||||
@@ -981,8 +974,6 @@ full:tj-pod1-smp-device.apple.com @cn
|
|||||||
full:updates-http.cdn-apple.com @cn
|
full:updates-http.cdn-apple.com @cn
|
||||||
full:updates-http.cdn-apple.com.akadns.net @cn
|
full:updates-http.cdn-apple.com.akadns.net @cn
|
||||||
full:updates.cdn-apple.com @cn
|
full:updates.cdn-apple.com @cn
|
||||||
full:valid.apple.com @cn
|
|
||||||
full:valid.origin-apple.com.akadns.net @cn
|
|
||||||
full:weather-data.apple.com @cn
|
full:weather-data.apple.com @cn
|
||||||
full:weather-data.apple.com.akadns.net @cn
|
full:weather-data.apple.com.akadns.net @cn
|
||||||
full:weather-map.apple.com @cn
|
full:weather-map.apple.com @cn
|
||||||
|
|||||||
@@ -7,3 +7,4 @@ full:ocsp.apple.com @cn
|
|||||||
full:ocsp2-lb.apple.com.akadns.net @cn
|
full:ocsp2-lb.apple.com.akadns.net @cn
|
||||||
full:ocsp2.apple.com @cn
|
full:ocsp2.apple.com @cn
|
||||||
full:valid.apple.com @cn
|
full:valid.apple.com @cn
|
||||||
|
full:valid.origin-apple.com.akadns.net @cn
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ orayimg.com
|
|||||||
sunlogin.net
|
sunlogin.net
|
||||||
|
|
||||||
## ToDesk
|
## ToDesk
|
||||||
|
todesk.cn
|
||||||
todesk.com
|
todesk.com
|
||||||
|
|
||||||
## 连连控
|
## 连连控
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ include:spaceship
|
|||||||
include:st
|
include:st
|
||||||
include:synology
|
include:synology
|
||||||
include:symantec
|
include:symantec
|
||||||
include:tailscale
|
|
||||||
include:theboringcompany
|
include:theboringcompany
|
||||||
include:tonec
|
include:tonec
|
||||||
include:uber
|
include:uber
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ include:zb
|
|||||||
|
|
||||||
1inch.io
|
1inch.io
|
||||||
aave.com
|
aave.com
|
||||||
|
bingx.com
|
||||||
bitbank.cc
|
bitbank.cc
|
||||||
bitcoin.org
|
bitcoin.org
|
||||||
bitfinex.com
|
bitfinex.com
|
||||||
|
|||||||
@@ -114,7 +114,9 @@ mobatek.net
|
|||||||
mpv.io
|
mpv.io
|
||||||
mysql.com
|
mysql.com
|
||||||
neovim.io
|
neovim.io
|
||||||
|
netfilter.org
|
||||||
newpipe.net
|
newpipe.net
|
||||||
|
nftables.org
|
||||||
nixos.org
|
nixos.org
|
||||||
nodesource.com
|
nodesource.com
|
||||||
notepad-plus-plus.org
|
notepad-plus-plus.org
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
include:category-ecommerce-ru
|
||||||
|
|
||||||
include:adidas
|
include:adidas
|
||||||
include:bestbuy
|
include:bestbuy
|
||||||
include:booking
|
include:booking
|
||||||
@@ -19,7 +21,6 @@ include:momo
|
|||||||
include:muji
|
include:muji
|
||||||
include:nike
|
include:nike
|
||||||
include:nordstrom
|
include:nordstrom
|
||||||
include:ozon
|
|
||||||
include:pchome
|
include:pchome
|
||||||
include:rakuten
|
include:rakuten
|
||||||
include:ruten
|
include:ruten
|
||||||
@@ -27,6 +28,7 @@ include:shopee
|
|||||||
include:shopify
|
include:shopify
|
||||||
include:suruga-ya
|
include:suruga-ya
|
||||||
include:target
|
include:target
|
||||||
|
include:technogym
|
||||||
include:walmart
|
include:walmart
|
||||||
include:wish
|
include:wish
|
||||||
|
|
||||||
|
|||||||
2
data/category-ecommerce-ru
Normal file
2
data/category-ecommerce-ru
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include:ozon
|
||||||
|
include:wildberries
|
||||||
@@ -5,6 +5,7 @@ include:applysquare
|
|||||||
include:hugecore
|
include:hugecore
|
||||||
include:hujiang
|
include:hujiang
|
||||||
include:koolearn
|
include:koolearn
|
||||||
|
include:schoopia
|
||||||
include:shanbay
|
include:shanbay
|
||||||
include:xueersi
|
include:xueersi
|
||||||
include:yuanfudao
|
include:yuanfudao
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# This list contains services related to entertainment & games & music & podcasts & videos outside China mainland.
|
# This list contains services related to entertainment & games & music & podcasts & videos outside China mainland.
|
||||||
|
|
||||||
|
include:category-entertainment-ru
|
||||||
include:category-games-!cn
|
include:category-games-!cn
|
||||||
include:category-novel
|
include:category-novel
|
||||||
|
|
||||||
@@ -46,7 +47,6 @@ include:mytvsuper
|
|||||||
include:netflix
|
include:netflix
|
||||||
include:niconico
|
include:niconico
|
||||||
include:now
|
include:now
|
||||||
include:okko
|
|
||||||
include:olevod
|
include:olevod
|
||||||
include:pbs
|
include:pbs
|
||||||
include:pixiv
|
include:pixiv
|
||||||
@@ -54,7 +54,6 @@ include:plutotv
|
|||||||
include:pocketcasts
|
include:pocketcasts
|
||||||
include:primevideo
|
include:primevideo
|
||||||
include:roku
|
include:roku
|
||||||
include:rutube
|
|
||||||
include:showtimeanytime
|
include:showtimeanytime
|
||||||
include:sling
|
include:sling
|
||||||
include:sonypictures
|
include:sonypictures
|
||||||
|
|||||||
3
data/category-entertainment-ru
Normal file
3
data/category-entertainment-ru
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
include:okko
|
||||||
|
include:rutube
|
||||||
|
include:wink
|
||||||
@@ -2,6 +2,7 @@ include:agilebits # 1password
|
|||||||
include:bitwarden
|
include:bitwarden
|
||||||
include:lastpass
|
include:lastpass
|
||||||
|
|
||||||
|
authpass.app
|
||||||
authy.com
|
authy.com
|
||||||
dashlane.com
|
dashlane.com
|
||||||
enpass.io
|
enpass.io
|
||||||
|
|||||||
3
data/category-proxy-tunnels
Normal file
3
data/category-proxy-tunnels
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
include:ngrok
|
||||||
|
include:pinggy
|
||||||
|
include:tailscale
|
||||||
@@ -411,34 +411,6 @@ full:udp.tracker.projectk.org
|
|||||||
full:wepzone.net
|
full:wepzone.net
|
||||||
full:wg.mortis.me
|
full:wg.mortis.me
|
||||||
full:ws.peer.ooo
|
full:ws.peer.ooo
|
||||||
full:www.all4nothin.net
|
|
||||||
full:www.bit-hdtv.com
|
|
||||||
full:www.bitseduce.com
|
|
||||||
full:www.biztorrents.com
|
|
||||||
full:www.blackcats-games.net
|
|
||||||
full:www.elitezones.ro
|
|
||||||
full:www.freerainbowtables.com
|
|
||||||
full:www.genesis-sp.org
|
|
||||||
full:www.learnbits.me
|
|
||||||
full:www.legittorrents.info
|
|
||||||
full:www.megatorrents.kg
|
|
||||||
full:www.mvgroup.org
|
|
||||||
full:www.peckservers.com
|
|
||||||
full:www.shnflac.net
|
|
||||||
full:www.siambt.com
|
|
||||||
full:www.thegeeks.bz
|
|
||||||
full:www.theoccult.bz
|
|
||||||
full:www.theplace.bz
|
|
||||||
full:www.thetradersden.org
|
|
||||||
full:www.thevault.bz
|
|
||||||
full:www.torrent.eu.org
|
|
||||||
full:www.torrentsnipe.info
|
|
||||||
full:www.tribalmixes.com
|
|
||||||
full:www.tvnihon.com
|
|
||||||
full:www.worldboxingvideoarchive.com
|
|
||||||
full:www.xwt-classics.net
|
|
||||||
full:www.yuwabits.net
|
|
||||||
full:www.zone-torrent.net
|
|
||||||
full:xbtrutor.com
|
full:xbtrutor.com
|
||||||
full:xtremewrestlingtorrents.net
|
full:xtremewrestlingtorrents.net
|
||||||
full:y.paranoid.agency
|
full:y.paranoid.agency
|
||||||
@@ -447,3 +419,32 @@ full:yggtracker.i2p.rocks
|
|||||||
full:yolo.liberbear.com
|
full:yolo.liberbear.com
|
||||||
full:z.paranoid.agency
|
full:z.paranoid.agency
|
||||||
full:zupix.online
|
full:zupix.online
|
||||||
|
|
||||||
|
all4nothin.net
|
||||||
|
bit-hdtv.com
|
||||||
|
bitseduce.com
|
||||||
|
biztorrents.com
|
||||||
|
blackcats-games.net
|
||||||
|
elitezones.ro
|
||||||
|
freerainbowtables.com
|
||||||
|
genesis-sp.org
|
||||||
|
learnbits.me
|
||||||
|
legittorrents.info
|
||||||
|
megatorrents.kg
|
||||||
|
mvgroup.org
|
||||||
|
peckservers.com
|
||||||
|
shnflac.net
|
||||||
|
siambt.com
|
||||||
|
thegeeks.bz
|
||||||
|
theoccult.bz
|
||||||
|
theplace.bz
|
||||||
|
thetradersden.org
|
||||||
|
thevault.bz
|
||||||
|
torrent.eu.org
|
||||||
|
torrentsnipe.info
|
||||||
|
tribalmixes.com
|
||||||
|
tvnihon.com
|
||||||
|
worldboxingvideoarchive.com
|
||||||
|
xwt-classics.net
|
||||||
|
yuwabits.net
|
||||||
|
zone-torrent.net
|
||||||
|
|||||||
6
data/category-retail-ru
Normal file
6
data/category-retail-ru
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# Fix Price
|
||||||
|
fix-price.com
|
||||||
|
|
||||||
|
# Lenta
|
||||||
|
lenta.com
|
||||||
|
lenta.tech
|
||||||
@@ -16,18 +16,31 @@ xn--p1ai
|
|||||||
ru.com
|
ru.com
|
||||||
ru.net
|
ru.net
|
||||||
|
|
||||||
|
include:category-ecommerce-ru
|
||||||
|
include:category-entertainment-ru
|
||||||
include:category-gov-ru
|
include:category-gov-ru
|
||||||
|
include:category-retail-ru
|
||||||
|
|
||||||
|
# Public transportation
|
||||||
|
include:mosmetro
|
||||||
|
|
||||||
include:avito
|
include:avito
|
||||||
include:mailru-group
|
include:mailru-group
|
||||||
include:okko
|
|
||||||
include:ozon
|
|
||||||
include:rutube
|
|
||||||
include:wildberries
|
|
||||||
include:wink
|
|
||||||
include:x5
|
include:x5
|
||||||
include:yandex
|
include:yandex
|
||||||
|
|
||||||
# Anime
|
# Dodo Pizza
|
||||||
animevost.org
|
dodopizza.ru
|
||||||
seasonvar.ru
|
dodopizza.com
|
||||||
|
dodostatic.net
|
||||||
|
dodois.com
|
||||||
|
dodois.io
|
||||||
|
|
||||||
|
# Rostics
|
||||||
|
rostics.ru
|
||||||
|
uni.rest
|
||||||
|
unirest.tech
|
||||||
|
|
||||||
|
trbcdn.net
|
||||||
|
tbank-online.com
|
||||||
|
taxsee.com
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ include:taboola
|
|||||||
|
|
||||||
# Anti-censorship & Anti-GFW & Privacy protection & VPN tools
|
# Anti-censorship & Anti-GFW & Privacy protection & VPN tools
|
||||||
include:category-anticensorship
|
include:category-anticensorship
|
||||||
|
include:category-proxy-tunnels
|
||||||
|
|
||||||
# Art & Design & Photography
|
# Art & Design & Photography
|
||||||
include:artstation
|
include:artstation
|
||||||
|
|||||||
@@ -108,6 +108,8 @@ include:ziroom
|
|||||||
|
|
||||||
## 无忧易售
|
## 无忧易售
|
||||||
51selling.com
|
51selling.com
|
||||||
|
## 爱回收
|
||||||
|
aihuishou.com
|
||||||
## 唯品会
|
## 唯品会
|
||||||
appsimg.com
|
appsimg.com
|
||||||
appvipshop.com
|
appvipshop.com
|
||||||
@@ -176,6 +178,7 @@ znds.com # 智能电视网
|
|||||||
|
|
||||||
423down.com # 423Down
|
423down.com # 423Down
|
||||||
acwifi.net # 路由器技术分享
|
acwifi.net # 路由器技术分享
|
||||||
|
appinn.com # 小众软件
|
||||||
chongdiantou.com # 充电头网
|
chongdiantou.com # 充电头网
|
||||||
ghxi.com # 果核剥壳
|
ghxi.com # 果核剥壳
|
||||||
iplaysoft.com # 异次元软件世界
|
iplaysoft.com # 异次元软件世界
|
||||||
@@ -314,12 +317,16 @@ include:zhubajie
|
|||||||
7moor.com
|
7moor.com
|
||||||
## 安兔兔
|
## 安兔兔
|
||||||
antutu.com
|
antutu.com
|
||||||
|
antutu.net
|
||||||
## 拓竹科技
|
## 拓竹科技
|
||||||
bambulab.com
|
bambulab.com
|
||||||
bblmw.com
|
bblmw.com
|
||||||
## BOSS 直聘
|
## BOSS 直聘
|
||||||
bosszhipin.com
|
bosszhipin.com
|
||||||
zhipin.com
|
zhipin.com
|
||||||
|
## 下厨房
|
||||||
|
chuimg.com
|
||||||
|
xiachufang.com
|
||||||
## 天润融通 AI外呼 客服
|
## 天润融通 AI外呼 客服
|
||||||
clink.cn
|
clink.cn
|
||||||
## 当贝
|
## 当贝
|
||||||
@@ -429,6 +436,10 @@ suzuki-china.com # 铃木中国官网
|
|||||||
udesk.cn # 沃丰科技
|
udesk.cn # 沃丰科技
|
||||||
ysjf.com # 影视飓风
|
ysjf.com # 影视飓风
|
||||||
|
|
||||||
|
# 飞牛
|
||||||
|
fnnas.com
|
||||||
|
fnnas.net
|
||||||
|
fnos.net
|
||||||
# 稿定(厦门)信息服务有限公司
|
# 稿定(厦门)信息服务有限公司
|
||||||
## 花瓣网 闽ICP备2021013850号
|
## 花瓣网 闽ICP备2021013850号
|
||||||
huaban.com
|
huaban.com
|
||||||
@@ -645,7 +656,6 @@ apk3.com
|
|||||||
apk8.com
|
apk8.com
|
||||||
aplaybox.com
|
aplaybox.com
|
||||||
appchina.com
|
appchina.com
|
||||||
appinn.com
|
|
||||||
arpun.com
|
arpun.com
|
||||||
asklib.com
|
asklib.com
|
||||||
babytree.com
|
babytree.com
|
||||||
@@ -1351,7 +1361,6 @@ xdqtech.com # 上邻 | 新渡桥科技 浙ICP备2020031247号-1
|
|||||||
xdtool.com # 闽ICP备2024056202号-4
|
xdtool.com # 闽ICP备2024056202号-4
|
||||||
xdwan.com
|
xdwan.com
|
||||||
xfdown.com
|
xfdown.com
|
||||||
xiachufang.com
|
|
||||||
xiaobaixitong.com
|
xiaobaixitong.com
|
||||||
xiaoe-tech.com
|
xiaoe-tech.com
|
||||||
xiaogouh5.com
|
xiaogouh5.com
|
||||||
|
|||||||
14
data/google
14
data/google
@@ -544,11 +544,13 @@ full:google-ohttp-relay-safebrowsing.fastly-edge.com
|
|||||||
|
|
||||||
# Domains and services below are available in China mainland
|
# Domains and services below are available in China mainland
|
||||||
# Use in config file like this: "geosite:google@cn"
|
# Use in config file like this: "geosite:google@cn"
|
||||||
|
gvt1-cn.com @cn
|
||||||
|
gvt2-cn.com @cn
|
||||||
full:www.recaptcha.net @cn
|
full:www.recaptcha.net @cn
|
||||||
full:safebrowsing-cache.google.com @cn
|
|
||||||
|
|
||||||
# The rules below are from https://github.com/felixonmars/dnsmasq-china-list/blob/master/google.china.conf
|
# The rules below are from https://github.com/felixonmars/dnsmasq-china-list/blob/master/google.china.conf
|
||||||
# Revision: 1f28a2d5789f411c13de69837bb354f4b21e58ff
|
# Revision: 1c2d107d4e7eaa0b192e08bb0beddde4aab247f6
|
||||||
|
# Duplicates removed
|
||||||
# Use in config file like this: "geosite:google@cn"
|
# Use in config file like this: "geosite:google@cn"
|
||||||
full:265.com @cn
|
full:265.com @cn
|
||||||
full:2mdn-cn.net @cn
|
full:2mdn-cn.net @cn
|
||||||
@@ -578,7 +580,6 @@ full:cnappinstall.googleadapis.com @cn
|
|||||||
full:connectivitycheck.gstatic.com @cn
|
full:connectivitycheck.gstatic.com @cn
|
||||||
full:content.googleadapis.com @cn
|
full:content.googleadapis.com @cn
|
||||||
full:crashlyticsreports-pa.googleapis.com @cn
|
full:crashlyticsreports-pa.googleapis.com @cn
|
||||||
full:crl.pki.goog @cn
|
|
||||||
full:csi.gstatic.com @cn
|
full:csi.gstatic.com @cn
|
||||||
full:dartsearch-cn.net @cn
|
full:dartsearch-cn.net @cn
|
||||||
full:dg-meta.video.google.com @cn
|
full:dg-meta.video.google.com @cn
|
||||||
@@ -590,7 +591,6 @@ full:download.mlcc.google.com @cn
|
|||||||
full:download.qatp1.net @cn
|
full:download.qatp1.net @cn
|
||||||
full:download.tensorflow.google.com @cn
|
full:download.tensorflow.google.com @cn
|
||||||
full:emmapplecodevice.googleapis.com @cn
|
full:emmapplecodevice.googleapis.com @cn
|
||||||
full:firebase-settings.crashlytics.com @cn
|
|
||||||
full:fontfiles.googleapis.com @cn
|
full:fontfiles.googleapis.com @cn
|
||||||
full:fonts.googleapis.com @cn
|
full:fonts.googleapis.com @cn
|
||||||
full:fonts.gstatic.com @cn
|
full:fonts.gstatic.com @cn
|
||||||
@@ -629,10 +629,8 @@ full:logger-dev.corp.google.com @cn
|
|||||||
full:logger.corp.google.com @cn
|
full:logger.corp.google.com @cn
|
||||||
full:login.corp.google.com @cn
|
full:login.corp.google.com @cn
|
||||||
full:monitoring.qpdp1.net @cn
|
full:monitoring.qpdp1.net @cn
|
||||||
full:ocsp.pki.goog @cn
|
|
||||||
full:pagead-googlehosted.l.google.com @cn
|
full:pagead-googlehosted.l.google.com @cn
|
||||||
full:performanceparameters.googleapis.com @cn
|
full:performanceparameters.googleapis.com @cn
|
||||||
full:pki-goog.l.google.com @cn
|
|
||||||
full:prod-controlbe.floonet.goog @cn
|
full:prod-controlbe.floonet.goog @cn
|
||||||
full:prod-databe.floonet.goog @cn
|
full:prod-databe.floonet.goog @cn
|
||||||
full:prod.databe.floonet.goog @cn
|
full:prod.databe.floonet.goog @cn
|
||||||
@@ -651,7 +649,6 @@ full:redirector.bdn.dev @cn
|
|||||||
full:redirector.c.chat.google.com @cn
|
full:redirector.c.chat.google.com @cn
|
||||||
full:redirector.c.mail.google.com @cn
|
full:redirector.c.mail.google.com @cn
|
||||||
full:redirector.c.pack.google.com @cn
|
full:redirector.c.pack.google.com @cn
|
||||||
full:redirector.c.play.google.com @cn
|
|
||||||
full:redirector.c.youtubeeducation.com @cn
|
full:redirector.c.youtubeeducation.com @cn
|
||||||
full:redirector.gcpcdn.gvt1.com @cn
|
full:redirector.gcpcdn.gvt1.com @cn
|
||||||
full:redirector.gvt1.com @cn
|
full:redirector.gvt1.com @cn
|
||||||
@@ -690,6 +687,3 @@ full:www.destinationurl.com @cn
|
|||||||
full:www.gstatic.com @cn
|
full:www.gstatic.com @cn
|
||||||
full:www.pxcc.com @cn
|
full:www.pxcc.com @cn
|
||||||
full:xn--flw351e.com @cn
|
full:xn--flw351e.com @cn
|
||||||
|
|
||||||
gvt1-cn.com @cn
|
|
||||||
gvt2-cn.com @cn
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ jules.google.com
|
|||||||
|
|
||||||
# Google AI Labs
|
# Google AI Labs
|
||||||
labs.google
|
labs.google
|
||||||
|
labs.google.com
|
||||||
aisandbox-pa.googleapis.com
|
aisandbox-pa.googleapis.com
|
||||||
|
|
||||||
# Android Studio Gemini Code Assist
|
# Android Studio Gemini Code Assist
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
5566ua.com
|
5566ua.com
|
||||||
aurorapush.cn
|
aurorapush.cn
|
||||||
e0n.cn
|
e0n.cn
|
||||||
|
easytomessage.com
|
||||||
japps.cn
|
japps.cn
|
||||||
jchat.io
|
jchat.io
|
||||||
jiguang.cn
|
jiguang.cn
|
||||||
|
|||||||
@@ -6,3 +6,4 @@ include:vk
|
|||||||
boosty.to
|
boosty.to
|
||||||
donationalerts.com
|
donationalerts.com
|
||||||
memealerts.com
|
memealerts.com
|
||||||
|
tamtam.chat
|
||||||
|
|||||||
2
data/mosmetro
Normal file
2
data/mosmetro
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
mosmetro.ru
|
||||||
|
mosmetro.tech
|
||||||
9
data/ngrok
Normal file
9
data/ngrok
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
ngrok-free.app
|
||||||
|
ngrok-free.dev
|
||||||
|
ngrok-free.pizza
|
||||||
|
ngrok.app
|
||||||
|
ngrok.com
|
||||||
|
ngrok.dev
|
||||||
|
ngrok.io
|
||||||
|
ngrok.pizza
|
||||||
|
ngrok.pro
|
||||||
2
data/pinggy
Normal file
2
data/pinggy
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
pinggy.io
|
||||||
|
pinggy.link
|
||||||
4
data/schoopia
Normal file
4
data/schoopia
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# 翻转校园 河南昱荣教育科技有限公司 豫ICP备2021021028号
|
||||||
|
schoopia.com
|
||||||
|
# 同学派 翻转校园app内置服务
|
||||||
|
tongxuepie.com
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
tapapks.com
|
||||||
tapimg.com
|
tapimg.com
|
||||||
tapimg.net
|
tapimg.net
|
||||||
taptap.cn
|
taptap.cn
|
||||||
|
|||||||
9
data/technogym
Normal file
9
data/technogym
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# data source: https://crt.sh/?id=17424181
|
||||||
|
letsmoveforabetterworld.com
|
||||||
|
technogym.bg
|
||||||
|
technogym.ch
|
||||||
|
technogym.com
|
||||||
|
technogym.com.br
|
||||||
|
technogym.ru
|
||||||
|
technogym.su
|
||||||
|
wellnessinstitute.com
|
||||||
@@ -6,4 +6,4 @@ wb.ru
|
|||||||
wbbasket.ru
|
wbbasket.ru
|
||||||
wbpay.ru
|
wbpay.ru
|
||||||
wibes.ru
|
wibes.ru
|
||||||
wildberries.ru
|
wildberries.ru
|
||||||
|
|||||||
441
main.go
441
main.go
@@ -29,10 +29,29 @@ const (
|
|||||||
RuleTypeInclude string = "include"
|
RuleTypeInclude string = "include"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
TypeChecker = regexp.MustCompile(`^(domain|full|keyword|regexp|include)$`)
|
||||||
|
ValueChecker = regexp.MustCompile(`^[a-z0-9!\.-]+$`)
|
||||||
|
AttrChecker = regexp.MustCompile(`^[a-z0-9!-]+$`)
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
refMap = make(map[string]*List)
|
||||||
|
plMap = make(map[string]*ParsedList)
|
||||||
|
finalMap = make(map[string][]Entry)
|
||||||
|
cirIncMap = make(map[string]bool) // Used for circular inclusion detection
|
||||||
|
)
|
||||||
|
|
||||||
type Entry struct {
|
type Entry struct {
|
||||||
Type string
|
Type string
|
||||||
Value string
|
Value string
|
||||||
Attrs []*router.Domain_Attribute
|
Attrs []string
|
||||||
|
}
|
||||||
|
|
||||||
|
type Inclusion struct {
|
||||||
|
Source string
|
||||||
|
MustAttrs []string
|
||||||
|
BannedAttrs []string
|
||||||
}
|
}
|
||||||
|
|
||||||
type List struct {
|
type List struct {
|
||||||
@@ -41,150 +60,108 @@ type List struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ParsedList struct {
|
type ParsedList struct {
|
||||||
Name string
|
Name string
|
||||||
Inclusion map[string]bool
|
Inclusions []Inclusion
|
||||||
Entry []Entry
|
Entry []Entry
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *ParsedList) toPlainText(listName string) error {
|
func makeProtoList(listName string, entries []Entry) (*router.GeoSite, error) {
|
||||||
var entryBytes []byte
|
|
||||||
for _, entry := range l.Entry {
|
|
||||||
var attrString string
|
|
||||||
if entry.Attrs != nil {
|
|
||||||
for _, attr := range entry.Attrs {
|
|
||||||
attrString += "@" + attr.GetKey() + ","
|
|
||||||
}
|
|
||||||
attrString = strings.TrimRight(":"+attrString, ",")
|
|
||||||
}
|
|
||||||
// Entry output format is: type:domain.tld:@attr1,@attr2
|
|
||||||
entryBytes = append(entryBytes, []byte(entry.Type+":"+entry.Value+attrString+"\n")...)
|
|
||||||
}
|
|
||||||
if err := os.WriteFile(filepath.Join(*outputDir, listName+".txt"), entryBytes, 0644); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (l *ParsedList) toProto() (*router.GeoSite, error) {
|
|
||||||
site := &router.GeoSite{
|
site := &router.GeoSite{
|
||||||
CountryCode: l.Name,
|
CountryCode: listName,
|
||||||
}
|
}
|
||||||
for _, entry := range l.Entry {
|
for _, entry := range entries {
|
||||||
|
pdomain := &router.Domain{Value: entry.Value}
|
||||||
|
for _, attr := range entry.Attrs {
|
||||||
|
pdomain.Attribute = append(pdomain.Attribute, &router.Domain_Attribute{
|
||||||
|
Key: attr,
|
||||||
|
TypedValue: &router.Domain_Attribute_BoolValue{BoolValue: true},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
switch entry.Type {
|
switch entry.Type {
|
||||||
case RuleTypeDomain:
|
case RuleTypeDomain:
|
||||||
site.Domain = append(site.Domain, &router.Domain{
|
pdomain.Type = router.Domain_RootDomain
|
||||||
Type: router.Domain_RootDomain,
|
|
||||||
Value: entry.Value,
|
|
||||||
Attribute: entry.Attrs,
|
|
||||||
})
|
|
||||||
|
|
||||||
case RuleTypeRegexp:
|
case RuleTypeRegexp:
|
||||||
// check regexp validity to avoid runtime error
|
pdomain.Type = router.Domain_Regex
|
||||||
_, err := regexp.Compile(entry.Value)
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("invalid regexp in list %s: %s", l.Name, entry.Value)
|
|
||||||
}
|
|
||||||
site.Domain = append(site.Domain, &router.Domain{
|
|
||||||
Type: router.Domain_Regex,
|
|
||||||
Value: entry.Value,
|
|
||||||
Attribute: entry.Attrs,
|
|
||||||
})
|
|
||||||
|
|
||||||
case RuleTypeKeyword:
|
case RuleTypeKeyword:
|
||||||
site.Domain = append(site.Domain, &router.Domain{
|
pdomain.Type = router.Domain_Plain
|
||||||
Type: router.Domain_Plain,
|
|
||||||
Value: entry.Value,
|
|
||||||
Attribute: entry.Attrs,
|
|
||||||
})
|
|
||||||
|
|
||||||
case RuleTypeFullDomain:
|
case RuleTypeFullDomain:
|
||||||
site.Domain = append(site.Domain, &router.Domain{
|
pdomain.Type = router.Domain_Full
|
||||||
Type: router.Domain_Full,
|
|
||||||
Value: entry.Value,
|
|
||||||
Attribute: entry.Attrs,
|
|
||||||
})
|
|
||||||
|
|
||||||
default:
|
|
||||||
return nil, fmt.Errorf("unknown domain type: %s", entry.Type)
|
|
||||||
}
|
}
|
||||||
|
site.Domain = append(site.Domain, pdomain)
|
||||||
}
|
}
|
||||||
return site, nil
|
return site, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func exportPlainTextList(list []string, refName string, pl *ParsedList) {
|
func writePlainList(exportedName string) error {
|
||||||
for _, listName := range list {
|
targetList, exist := finalMap[strings.ToUpper(exportedName)]
|
||||||
if strings.EqualFold(refName, listName) {
|
if !exist || len(targetList) == 0 {
|
||||||
if err := pl.toPlainText(strings.ToLower(refName)); err != nil {
|
return fmt.Errorf("'%s' list does not exist or is empty.", exportedName)
|
||||||
fmt.Println("Failed:", err)
|
}
|
||||||
continue
|
file, err := os.Create(filepath.Join(*outputDir, strings.ToLower(exportedName) + ".txt"))
|
||||||
}
|
if err != nil {
|
||||||
fmt.Printf("'%s' has been generated successfully.\n", listName)
|
return err
|
||||||
|
}
|
||||||
|
defer file.Close()
|
||||||
|
w := bufio.NewWriter(file)
|
||||||
|
for _, entry := range targetList {
|
||||||
|
// Entry output format is: type:domain.tld:@attr1,@attr2
|
||||||
|
var attrString string
|
||||||
|
if entry.Attrs != nil {
|
||||||
|
attrString = ":@" + strings.Join(entry.Attrs, ",@")
|
||||||
}
|
}
|
||||||
|
fmt.Fprintln(w, entry.Type + ":" + entry.Value + attrString)
|
||||||
}
|
}
|
||||||
|
return w.Flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
func removeComment(line string) string {
|
func parseEntry(line string) (Entry, error) {
|
||||||
idx := strings.Index(line, "#")
|
var entry Entry
|
||||||
if idx == -1 {
|
parts := strings.Fields(line)
|
||||||
return line
|
|
||||||
}
|
|
||||||
return strings.TrimSpace(line[:idx])
|
|
||||||
}
|
|
||||||
|
|
||||||
func parseDomain(domain string, entry *Entry) error {
|
// Parse type and value
|
||||||
kv := strings.Split(domain, ":")
|
rawTypeVal := parts[0]
|
||||||
|
kv := strings.Split(rawTypeVal, ":")
|
||||||
if len(kv) == 1 {
|
if len(kv) == 1 {
|
||||||
entry.Type = RuleTypeDomain
|
entry.Type = RuleTypeDomain // Default type
|
||||||
entry.Value = strings.ToLower(kv[0])
|
entry.Value = strings.ToLower(rawTypeVal)
|
||||||
return nil
|
} else if len(kv) == 2 {
|
||||||
}
|
|
||||||
|
|
||||||
if len(kv) == 2 {
|
|
||||||
entry.Type = strings.ToLower(kv[0])
|
entry.Type = strings.ToLower(kv[0])
|
||||||
|
if entry.Type == RuleTypeRegexp {
|
||||||
if strings.EqualFold(entry.Type, RuleTypeRegexp) {
|
|
||||||
entry.Value = kv[1]
|
entry.Value = kv[1]
|
||||||
} else {
|
} else {
|
||||||
entry.Value = strings.ToLower(kv[1])
|
entry.Value = strings.ToLower(kv[1])
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
return nil
|
return entry, fmt.Errorf("invalid format: %s", line)
|
||||||
|
}
|
||||||
|
// Check type and value
|
||||||
|
if !TypeChecker.MatchString(entry.Type) {
|
||||||
|
return entry, fmt.Errorf("invalid type: %s", entry.Type)
|
||||||
|
}
|
||||||
|
if entry.Type == RuleTypeRegexp {
|
||||||
|
if _, err := regexp.Compile(entry.Value); err != nil {
|
||||||
|
return entry, fmt.Errorf("invalid regexp: %s", entry.Value)
|
||||||
|
}
|
||||||
|
} else if !ValueChecker.MatchString(entry.Value) {
|
||||||
|
return entry, fmt.Errorf("invalid value: %s", entry.Value)
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Errorf("invalid format: %s", domain)
|
// Parse/Check attributes
|
||||||
}
|
for _, part := range parts[1:] {
|
||||||
|
if !strings.HasPrefix(part, "@") {
|
||||||
func parseAttribute(attr string) (*router.Domain_Attribute, error) {
|
return entry, fmt.Errorf("invalid attribute: %s", part)
|
||||||
var attribute router.Domain_Attribute
|
}
|
||||||
if len(attr) == 0 || attr[0] != '@' {
|
attr := strings.ToLower(part[1:]) // Trim attribute prefix `@` character
|
||||||
return &attribute, fmt.Errorf("invalid attribute: %s", attr)
|
if !AttrChecker.MatchString(attr) {
|
||||||
}
|
return entry, fmt.Errorf("invalid attribute key: %s", attr)
|
||||||
|
|
||||||
attribute.Key = strings.ToLower(attr[1:]) // Trim attribute prefix `@` character
|
|
||||||
attribute.TypedValue = &router.Domain_Attribute_BoolValue{BoolValue: true}
|
|
||||||
return &attribute, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func parseEntry(line string) (Entry, error) {
|
|
||||||
line = strings.TrimSpace(line)
|
|
||||||
parts := strings.Split(line, " ")
|
|
||||||
|
|
||||||
var entry Entry
|
|
||||||
if len(parts) == 0 {
|
|
||||||
return entry, fmt.Errorf("empty entry")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := parseDomain(parts[0], &entry); err != nil {
|
|
||||||
return entry, err
|
|
||||||
}
|
|
||||||
|
|
||||||
for i := 1; i < len(parts); i++ {
|
|
||||||
attr, err := parseAttribute(parts[i])
|
|
||||||
if err != nil {
|
|
||||||
return entry, err
|
|
||||||
}
|
}
|
||||||
entry.Attrs = append(entry.Attrs, attr)
|
entry.Attrs = append(entry.Attrs, attr)
|
||||||
}
|
}
|
||||||
|
// Sort attributes
|
||||||
|
sort.Slice(entry.Attrs, func(i, j int) bool {
|
||||||
|
return entry.Attrs[i] < entry.Attrs[j]
|
||||||
|
})
|
||||||
|
|
||||||
return entry, nil
|
return entry, nil
|
||||||
}
|
}
|
||||||
@@ -201,9 +178,13 @@ func Load(path string) (*List, error) {
|
|||||||
}
|
}
|
||||||
scanner := bufio.NewScanner(file)
|
scanner := bufio.NewScanner(file)
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
line := strings.TrimSpace(scanner.Text())
|
line := scanner.Text()
|
||||||
line = removeComment(line)
|
// Remove comments
|
||||||
if len(line) == 0 {
|
if idx := strings.Index(line, "#"); idx != -1 {
|
||||||
|
line = line[:idx]
|
||||||
|
}
|
||||||
|
line = strings.TrimSpace(line)
|
||||||
|
if line == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
entry, err := parseEntry(line)
|
entry, err := parseEntry(line)
|
||||||
@@ -216,99 +197,80 @@ func Load(path string) (*List, error) {
|
|||||||
return list, nil
|
return list, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func isMatchAttr(Attrs []*router.Domain_Attribute, includeKey string) bool {
|
func ParseList(refList *List) error {
|
||||||
isMatch := false
|
//TODO: one Entry -> multiple ParsedLists
|
||||||
mustMatch := true
|
pl := &ParsedList{Name: refList.Name}
|
||||||
matchName := includeKey
|
for _, entry := range refList.Entry {
|
||||||
if strings.HasPrefix(includeKey, "!") {
|
if entry.Type == RuleTypeInclude {
|
||||||
isMatch = true
|
inc := Inclusion{Source: strings.ToUpper(entry.Value)}
|
||||||
mustMatch = false
|
for _, attr := range entry.Attrs {
|
||||||
matchName = strings.TrimLeft(includeKey, "!")
|
if strings.HasPrefix(attr, "-") {
|
||||||
}
|
inc.BannedAttrs = append(inc.BannedAttrs, attr[1:]) // Trim attribute prefix `-` character
|
||||||
|
|
||||||
for _, Attr := range Attrs {
|
|
||||||
attrName := Attr.Key
|
|
||||||
if mustMatch {
|
|
||||||
if matchName == attrName {
|
|
||||||
isMatch = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if matchName == attrName {
|
|
||||||
isMatch = false
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return isMatch
|
|
||||||
}
|
|
||||||
|
|
||||||
func createIncludeAttrEntrys(list *List, matchAttr *router.Domain_Attribute) []Entry {
|
|
||||||
newEntryList := make([]Entry, 0, len(list.Entry))
|
|
||||||
matchName := matchAttr.Key
|
|
||||||
for _, entry := range list.Entry {
|
|
||||||
matched := isMatchAttr(entry.Attrs, matchName)
|
|
||||||
if matched {
|
|
||||||
newEntryList = append(newEntryList, entry)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return newEntryList
|
|
||||||
}
|
|
||||||
|
|
||||||
func ParseList(list *List, ref map[string]*List) (*ParsedList, error) {
|
|
||||||
pl := &ParsedList{
|
|
||||||
Name: list.Name,
|
|
||||||
Inclusion: make(map[string]bool),
|
|
||||||
}
|
|
||||||
entryList := list.Entry
|
|
||||||
for {
|
|
||||||
newEntryList := make([]Entry, 0, len(entryList))
|
|
||||||
hasInclude := false
|
|
||||||
for _, entry := range entryList {
|
|
||||||
if entry.Type == RuleTypeInclude {
|
|
||||||
refName := strings.ToUpper(entry.Value)
|
|
||||||
if entry.Attrs != nil {
|
|
||||||
for _, attr := range entry.Attrs {
|
|
||||||
InclusionName := strings.ToUpper(refName + "@" + attr.Key)
|
|
||||||
if pl.Inclusion[InclusionName] {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
pl.Inclusion[InclusionName] = true
|
|
||||||
|
|
||||||
refList := ref[refName]
|
|
||||||
if refList == nil {
|
|
||||||
return nil, fmt.Errorf("list not found: %s", entry.Value)
|
|
||||||
}
|
|
||||||
attrEntrys := createIncludeAttrEntrys(refList, attr)
|
|
||||||
if len(attrEntrys) != 0 {
|
|
||||||
newEntryList = append(newEntryList, attrEntrys...)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
InclusionName := refName
|
inc.MustAttrs = append(inc.MustAttrs, attr)
|
||||||
if pl.Inclusion[InclusionName] {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
pl.Inclusion[InclusionName] = true
|
|
||||||
refList := ref[refName]
|
|
||||||
if refList == nil {
|
|
||||||
return nil, fmt.Errorf("list not found: %s", entry.Value)
|
|
||||||
}
|
|
||||||
newEntryList = append(newEntryList, refList.Entry...)
|
|
||||||
}
|
}
|
||||||
hasInclude = true
|
|
||||||
} else {
|
|
||||||
newEntryList = append(newEntryList, entry)
|
|
||||||
}
|
}
|
||||||
}
|
pl.Inclusions = append(pl.Inclusions, inc)
|
||||||
entryList = newEntryList
|
} else {
|
||||||
if !hasInclude {
|
pl.Entry = append(pl.Entry, entry)
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pl.Entry = entryList
|
plMap[refList.Name] = pl
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
return pl, nil
|
func ResolveList(pl *ParsedList) error {
|
||||||
|
if _, pldone := finalMap[pl.Name]; pldone { return nil }
|
||||||
|
|
||||||
|
if cirIncMap[pl.Name] {
|
||||||
|
return fmt.Errorf("circular inclusion in: %s", pl.Name)
|
||||||
|
}
|
||||||
|
cirIncMap[pl.Name] = true
|
||||||
|
defer delete(cirIncMap, pl.Name)
|
||||||
|
|
||||||
|
entry2String := func(e Entry) string { // Attributes already sorted
|
||||||
|
return e.Type + ":" + e.Value + "@" + strings.Join(e.Attrs, "@")
|
||||||
|
}
|
||||||
|
isMatchAttrFilters := func(entry Entry, incFilter Inclusion) bool {
|
||||||
|
if len(incFilter.MustAttrs) == 0 && len(incFilter.BannedAttrs) == 0 { return true }
|
||||||
|
|
||||||
|
attrMap := make(map[string]bool)
|
||||||
|
for _, attr := range entry.Attrs {
|
||||||
|
attrMap[attr] = true
|
||||||
|
}
|
||||||
|
for _, m := range incFilter.MustAttrs {
|
||||||
|
if !attrMap[m] { return false }
|
||||||
|
}
|
||||||
|
for _, b := range incFilter.BannedAttrs {
|
||||||
|
if attrMap[b] { return false }
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
bscDupMap := make(map[string]bool) // Used for basic duplicates detection
|
||||||
|
var finalList []Entry
|
||||||
|
for _, dentry := range pl.Entry {
|
||||||
|
if dstring := entry2String(dentry); !bscDupMap[dstring] {
|
||||||
|
bscDupMap[dstring] = true
|
||||||
|
finalList = append(finalList, dentry)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, inc := range pl.Inclusions {
|
||||||
|
if err := ResolveList(plMap[inc.Source]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for _, ientry := range finalMap[inc.Source] {
|
||||||
|
if isMatchAttrFilters(ientry, inc) {
|
||||||
|
if istring := entry2String(ientry); !bscDupMap[istring] {
|
||||||
|
bscDupMap[istring] = true
|
||||||
|
finalList = append(finalList, ientry)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finalMap[pl.Name] = finalList
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -317,7 +279,7 @@ func main() {
|
|||||||
dir := *dataPath
|
dir := *dataPath
|
||||||
fmt.Println("Use domain lists in", dir)
|
fmt.Println("Use domain lists in", dir)
|
||||||
|
|
||||||
ref := make(map[string]*List)
|
// Generate refMap
|
||||||
err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
|
err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -329,7 +291,7 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
ref[list.Name] = list
|
refMap[list.Name] = list
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -337,6 +299,22 @@ func main() {
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Generate plMap
|
||||||
|
for _, refList := range refMap {
|
||||||
|
if err := ParseList(refList); err != nil {
|
||||||
|
fmt.Println("Failed to ParseList:", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generate finalMap
|
||||||
|
for _, pl := range plMap {
|
||||||
|
if err := ResolveList(pl); err != nil {
|
||||||
|
fmt.Println("Failed to ResolveList:", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Create output directory if not exist
|
// Create output directory if not exist
|
||||||
if _, err := os.Stat(*outputDir); os.IsNotExist(err) {
|
if _, err := os.Stat(*outputDir); os.IsNotExist(err) {
|
||||||
if mkErr := os.MkdirAll(*outputDir, 0755); mkErr != nil {
|
if mkErr := os.MkdirAll(*outputDir, 0755); mkErr != nil {
|
||||||
@@ -345,43 +323,28 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protoList := new(router.GeoSiteList)
|
// Export plaintext list
|
||||||
var existList []string
|
if *exportLists != "" {
|
||||||
for refName, list := range ref {
|
exportedListSlice := strings.Split(*exportLists, ",")
|
||||||
pl, err := ParseList(list, ref)
|
for _, exportedList := range exportedListSlice {
|
||||||
if err != nil {
|
if err := writePlainList(exportedList); err != nil {
|
||||||
fmt.Println("Failed:", err)
|
fmt.Println("Failed to write list:", err)
|
||||||
os.Exit(1)
|
continue
|
||||||
|
}
|
||||||
|
fmt.Printf("list: '%s' has been generated successfully.\n", exportedList)
|
||||||
}
|
}
|
||||||
site, err := pl.toProto()
|
}
|
||||||
|
|
||||||
|
// Generate dat file
|
||||||
|
protoList := new(router.GeoSiteList)
|
||||||
|
for siteName, siteEntries := range finalMap {
|
||||||
|
site, err := makeProtoList(siteName, siteEntries)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Failed:", err)
|
fmt.Println("Failed:", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
protoList.Entry = append(protoList.Entry, site)
|
protoList.Entry = append(protoList.Entry, site)
|
||||||
|
|
||||||
// Flatten and export plaintext list
|
|
||||||
if *exportLists != "" {
|
|
||||||
if existList != nil {
|
|
||||||
exportPlainTextList(existList, refName, pl)
|
|
||||||
} else {
|
|
||||||
exportedListSlice := strings.Split(*exportLists, ",")
|
|
||||||
for _, exportedListName := range exportedListSlice {
|
|
||||||
fileName := filepath.Join(dir, exportedListName)
|
|
||||||
_, err := os.Stat(fileName)
|
|
||||||
if err == nil || os.IsExist(err) {
|
|
||||||
existList = append(existList, exportedListName)
|
|
||||||
} else {
|
|
||||||
fmt.Printf("'%s' list does not exist in '%s' directory.\n", exportedListName, dir)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if existList != nil {
|
|
||||||
exportPlainTextList(existList, refName, pl)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort protoList so the marshaled list is reproducible
|
// Sort protoList so the marshaled list is reproducible
|
||||||
sort.SliceStable(protoList.Entry, func(i, j int) bool {
|
sort.SliceStable(protoList.Entry, func(i, j int) bool {
|
||||||
return protoList.Entry[i].CountryCode < protoList.Entry[j].CountryCode
|
return protoList.Entry[i].CountryCode < protoList.Entry[j].CountryCode
|
||||||
@@ -389,11 +352,11 @@ func main() {
|
|||||||
|
|
||||||
protoBytes, err := proto.Marshal(protoList)
|
protoBytes, err := proto.Marshal(protoList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Failed:", err)
|
fmt.Println("Failed to marshal:", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
if err := os.WriteFile(filepath.Join(*outputDir, *outputName), protoBytes, 0644); err != nil {
|
if err := os.WriteFile(filepath.Join(*outputDir, *outputName), protoBytes, 0644); err != nil {
|
||||||
fmt.Println("Failed:", err)
|
fmt.Println("Failed to write output:", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
} else {
|
} else {
|
||||||
fmt.Println(*outputName, "has been generated successfully.")
|
fmt.Println(*outputName, "has been generated successfully.")
|
||||||
|
|||||||
Reference in New Issue
Block a user