mirror of
https://github.com/v2fly/domain-list-community.git
synced 2026-01-01 20:40:31 +07:00
Compare commits
36 Commits
2025121810
...
maingo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d73db400e | ||
|
|
c83bb86d06 | ||
|
|
58f79fa579 | ||
|
|
969e6baad8 | ||
|
|
bbd5b64219 | ||
|
|
6b10d69246 | ||
|
|
fd4895c71e | ||
|
|
f105486f25 | ||
|
|
75f8ac0b8a | ||
|
|
12711270a8 | ||
|
|
6ab293c1dc | ||
|
|
f050db51f0 | ||
|
|
645014d31e | ||
|
|
4b1cef4329 | ||
|
|
234cc35db2 | ||
|
|
9b1f374455 | ||
|
|
e526975cd9 | ||
|
|
f7aba5f55e | ||
|
|
edffb486d1 | ||
|
|
1f80a8e387 | ||
|
|
9249e915a6 | ||
|
|
fefa540df1 | ||
|
|
5aad950410 | ||
|
|
42dc9593dd | ||
|
|
9807b5b0a9 | ||
|
|
920ea4a055 | ||
|
|
9f6800b6b2 | ||
|
|
d014f46c20 | ||
|
|
6f3acc3ba9 | ||
|
|
24c2f80f91 | ||
|
|
c9cdb42bf0 | ||
|
|
425c41c171 | ||
|
|
7ab6c29b3c | ||
|
|
c8cd35ba7d | ||
|
|
6ff83936c8 | ||
|
|
29b004bf5d |
5
.github/workflows/build.yml
vendored
5
.github/workflows/build.yml
vendored
@@ -5,6 +5,11 @@ on:
|
|||||||
- master
|
- master
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "**/README.md"
|
- "**/README.md"
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
|
|||||||
10
data/archive
10
data/archive
@@ -1,8 +1,2 @@
|
|||||||
include:4plebs
|
# For compatibility only
|
||||||
|
include:category-web-archive
|
||||||
archive-it.org
|
|
||||||
archive.md
|
|
||||||
archive.org
|
|
||||||
archive.ph
|
|
||||||
archive.today
|
|
||||||
openlibrary.org
|
|
||||||
|
|||||||
8
data/archivetoday
Normal file
8
data/archivetoday
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
archive.today
|
||||||
|
|
||||||
|
archive.fo
|
||||||
|
archive.is
|
||||||
|
archive.li
|
||||||
|
archive.md
|
||||||
|
archive.ph
|
||||||
|
archive.vn
|
||||||
@@ -1,2 +1,5 @@
|
|||||||
archlinux.org
|
archlinux.org
|
||||||
archlinuxarm.org
|
archlinuxarm.org
|
||||||
|
|
||||||
|
# Unofficial
|
||||||
|
archlinuxcn.org
|
||||||
|
|||||||
3
data/askdiandian
Normal file
3
data/askdiandian
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# 点点 Ai
|
||||||
|
askdiandian.com
|
||||||
|
diandianlife.top
|
||||||
2
data/avito
Normal file
2
data/avito
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
avito.ru
|
||||||
|
avito.st
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
include:zuoyebang-ads
|
||||||
|
|
||||||
adscdn.baidu.com @ads
|
adscdn.baidu.com @ads
|
||||||
adx.xiaodutv.com @ads
|
adx.xiaodutv.com @ads
|
||||||
afd.baidu.com @ads
|
afd.baidu.com @ads
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
include:askdiandian
|
||||||
include:deepseek
|
include:deepseek
|
||||||
include:doubao
|
include:doubao
|
||||||
include:trae # MarsCode
|
include:trae # MarsCode
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ include:comodo
|
|||||||
include:corel
|
include:corel
|
||||||
include:dell
|
include:dell
|
||||||
include:digitalocean
|
include:digitalocean
|
||||||
|
include:dmit
|
||||||
include:drweb
|
include:drweb
|
||||||
include:duolingo
|
include:duolingo
|
||||||
include:faronics
|
include:faronics
|
||||||
|
|||||||
@@ -70,10 +70,7 @@ apache.org
|
|||||||
artixlinux.org
|
artixlinux.org
|
||||||
atom.io
|
atom.io
|
||||||
badgen.net
|
badgen.net
|
||||||
|
|
||||||
# Bitvise official website.
|
|
||||||
bitvise.com
|
bitvise.com
|
||||||
|
|
||||||
cdnjs.com
|
cdnjs.com
|
||||||
centos.org
|
centos.org
|
||||||
chocolatey.org
|
chocolatey.org
|
||||||
@@ -94,6 +91,7 @@ getcomposer.org
|
|||||||
getzola.org
|
getzola.org
|
||||||
git-scm.com
|
git-scm.com
|
||||||
gnu.org
|
gnu.org
|
||||||
|
godbolt.org
|
||||||
|
|
||||||
# PuTTY and some software official websites.
|
# PuTTY and some software official websites.
|
||||||
greenend.org.uk
|
greenend.org.uk
|
||||||
@@ -112,13 +110,11 @@ lua.org
|
|||||||
macports.org
|
macports.org
|
||||||
mariadb.org
|
mariadb.org
|
||||||
mingw.org
|
mingw.org
|
||||||
|
|
||||||
# Mobatek official website.
|
|
||||||
mobatek.net
|
mobatek.net
|
||||||
|
|
||||||
mpv.io
|
mpv.io
|
||||||
mysql.com
|
mysql.com
|
||||||
neovim.io
|
neovim.io
|
||||||
|
newpipe.net
|
||||||
nixos.org
|
nixos.org
|
||||||
nodesource.com
|
nodesource.com
|
||||||
notepad-plus-plus.org
|
notepad-plus-plus.org
|
||||||
@@ -129,11 +125,8 @@ packagist.org
|
|||||||
pcre.org
|
pcre.org
|
||||||
phantomjs.org
|
phantomjs.org
|
||||||
php.net
|
php.net
|
||||||
|
|
||||||
# PuTTY unofficial website, owned by Bitvise.
|
|
||||||
putty.org
|
|
||||||
|
|
||||||
postgresql.org
|
postgresql.org
|
||||||
|
putty.org
|
||||||
r-project.org
|
r-project.org
|
||||||
raspberrypi.org
|
raspberrypi.org
|
||||||
raspbian.org
|
raspbian.org
|
||||||
@@ -145,15 +138,14 @@ shellcheck.net
|
|||||||
shields.io
|
shields.io
|
||||||
sqlite.org
|
sqlite.org
|
||||||
sublimetext.com
|
sublimetext.com
|
||||||
|
|
||||||
# Termius official website.
|
|
||||||
termius.com
|
termius.com
|
||||||
|
|
||||||
unpkg.com
|
unpkg.com
|
||||||
videojs.com
|
videojs.com
|
||||||
videolan.org
|
videolan.org
|
||||||
wapm.io
|
wapm.io
|
||||||
wasmer.io
|
wasmer.io
|
||||||
|
webflow.com
|
||||||
|
weblate.org
|
||||||
wireshark.org
|
wireshark.org
|
||||||
x.org
|
x.org
|
||||||
xposed.info
|
xposed.info
|
||||||
|
|||||||
@@ -83,6 +83,22 @@ dearedu.com
|
|||||||
dgjy.net
|
dgjy.net
|
||||||
# 在职研究生教育信息网
|
# 在职研究生教育信息网
|
||||||
eduei.com
|
eduei.com
|
||||||
|
# 中公
|
||||||
|
eoffcn.com
|
||||||
|
jinrongren.net
|
||||||
|
offcn.com
|
||||||
|
zggqzp.com
|
||||||
|
zgsydw.com
|
||||||
|
# 高考100
|
||||||
|
gk100.com
|
||||||
|
# 华图
|
||||||
|
huatu.com
|
||||||
|
sydw8.com
|
||||||
|
# 中科大数据研究院,豫ICP备19023555号
|
||||||
|
ictbda.cn
|
||||||
|
ictbda.com
|
||||||
|
modex.com.cn
|
||||||
|
xir.cn
|
||||||
# 日语测试
|
# 日语测试
|
||||||
j-test.com
|
j-test.com
|
||||||
nattest-china.com
|
nattest-china.com
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ include:copymanga
|
|||||||
include:dailymotion
|
include:dailymotion
|
||||||
include:dandanzan
|
include:dandanzan
|
||||||
include:dazn
|
include:dazn
|
||||||
|
include:deezer
|
||||||
include:deviantart
|
include:deviantart
|
||||||
include:discoveryplus
|
include:discoveryplus
|
||||||
include:disney
|
include:disney
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ yeshen.com
|
|||||||
17k.com
|
17k.com
|
||||||
# https://github.com/supzhang/epg
|
# https://github.com/supzhang/epg
|
||||||
51zmt.top
|
51zmt.top
|
||||||
|
# 广东南方新媒体
|
||||||
|
aisee.tv
|
||||||
# 暴风影音
|
# 暴风影音
|
||||||
baofeng.com
|
baofeng.com
|
||||||
baofeng.net
|
baofeng.net
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ include:steam
|
|||||||
include:steamunlocked
|
include:steamunlocked
|
||||||
include:supercell
|
include:supercell
|
||||||
include:ubisoft
|
include:ubisoft
|
||||||
|
include:vrchat
|
||||||
include:wbgames
|
include:wbgames
|
||||||
include:xbox
|
include:xbox
|
||||||
include:ynoproject
|
include:ynoproject
|
||||||
|
|||||||
@@ -96,6 +96,9 @@ iresearch.cn
|
|||||||
jianyuweb.com
|
jianyuweb.com
|
||||||
wallstcn.com
|
wallstcn.com
|
||||||
wallstreetcn.com
|
wallstreetcn.com
|
||||||
|
# 上观新闻/解放日报
|
||||||
|
jfdaily.com
|
||||||
|
shobserver.com
|
||||||
# 机器之心
|
# 机器之心
|
||||||
jiqizhixin.com
|
jiqizhixin.com
|
||||||
# 金融界
|
# 金融界
|
||||||
@@ -144,6 +147,8 @@ ql1d.com
|
|||||||
qingdaonews.com
|
qingdaonews.com
|
||||||
# 前瞻网
|
# 前瞻网
|
||||||
qianzhan.com
|
qianzhan.com
|
||||||
|
# 青岛之窗
|
||||||
|
qingdaochina.org
|
||||||
# 四川手机报
|
# 四川手机报
|
||||||
scsjb.cn
|
scsjb.cn
|
||||||
# 安全内参
|
# 安全内参
|
||||||
@@ -154,6 +159,8 @@ sfccn.com
|
|||||||
shangyexinzhi.com
|
shangyexinzhi.com
|
||||||
# 奇客资讯网
|
# 奇客资讯网
|
||||||
solidot.org
|
solidot.org
|
||||||
|
# 南方新闻网
|
||||||
|
southcn.com
|
||||||
# 少数派
|
# 少数派
|
||||||
sspai.com
|
sspai.com
|
||||||
# 证券之星
|
# 证券之星
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
# This list contains organizations outside China mainland.
|
# This list contains organizations outside China mainland.
|
||||||
|
|
||||||
include:archive
|
|
||||||
include:creativecommons
|
include:creativecommons
|
||||||
include:csis
|
include:csis
|
||||||
include:emojipedia
|
include:emojipedia
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ ru.net
|
|||||||
|
|
||||||
include:category-gov-ru
|
include:category-gov-ru
|
||||||
|
|
||||||
include:habr
|
include:avito
|
||||||
include:mailru-group
|
include:mailru-group
|
||||||
include:okko
|
include:okko
|
||||||
include:ozon
|
include:ozon
|
||||||
|
|||||||
@@ -11,7 +11,11 @@ ancientbooks.cn # 籍合网
|
|||||||
|
|
||||||
apabi.com
|
apabi.com
|
||||||
bjinfobank.com # 高校数据财经库
|
bjinfobank.com # 高校数据财经库
|
||||||
blyun.com # 百链
|
|
||||||
|
# 北京百链网源信息技术有限公司
|
||||||
|
blyun.com # 百链云图书馆
|
||||||
|
medalink.cn # 百链学术搜索
|
||||||
|
|
||||||
chinabooktrading.com # 中国历代典籍总目
|
chinabooktrading.com # 中国历代典籍总目
|
||||||
cidp.com.cn # CIDP制造业数字资源平台
|
cidp.com.cn # CIDP制造业数字资源平台
|
||||||
cnbksy.com # 全国报刊索引
|
cnbksy.com # 全国报刊索引
|
||||||
|
|||||||
10
data/category-web-archive
Normal file
10
data/category-web-archive
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
include:4plebs
|
||||||
|
include:archivetoday
|
||||||
|
include:internet-archive
|
||||||
|
|
||||||
|
eotarchive.org
|
||||||
|
ghostarchive.org
|
||||||
|
megalodon.jp
|
||||||
|
mementoweb.org
|
||||||
|
perma.cc
|
||||||
|
webcitation.org
|
||||||
17
data/cctv
17
data/cctv
@@ -1,22 +1,24 @@
|
|||||||
cctv.cn
|
cctv.cn
|
||||||
cctv.com
|
cctv.com
|
||||||
|
cctvlib.cn
|
||||||
|
cctvlib.com.cn
|
||||||
|
cctvlibrary.cn
|
||||||
|
cctvlibrary.com.cn
|
||||||
cctvpic.com
|
cctvpic.com
|
||||||
|
cctvpro.cn
|
||||||
|
cctvpro.com.cn
|
||||||
chinaepg.cn
|
chinaepg.cn
|
||||||
chinalive.com
|
chinalive.com
|
||||||
|
chinaott.com
|
||||||
citv.net.cn
|
citv.net.cn
|
||||||
cnms.net.cn
|
cnms.net.cn
|
||||||
cntv.cn
|
cntv.cn
|
||||||
cntv.com.cn
|
cntv.com.cn
|
||||||
cctvlib.cn
|
|
||||||
cctvlibrary.cn
|
|
||||||
cctvlib.com.cn
|
|
||||||
cctvlibrary.com.cn
|
|
||||||
cctvpro.cn
|
|
||||||
cctvpro.com.cn
|
|
||||||
cntvwb.cn
|
cntvwb.cn
|
||||||
gjgbdszt.cn
|
gjgbdszt.cn
|
||||||
gjgbdszt.com.cn
|
gjgbdszt.com.cn
|
||||||
gjgbdszt.net.cn
|
gjgbdszt.net.cn
|
||||||
|
icntvcdn.com
|
||||||
ipanda.cn
|
ipanda.cn
|
||||||
ipanda.com
|
ipanda.com
|
||||||
ipanda.com.cn
|
ipanda.com.cn
|
||||||
@@ -24,11 +26,12 @@ ipanda.net
|
|||||||
livechina.cn
|
livechina.cn
|
||||||
livechina.com
|
livechina.com
|
||||||
olympicchannelchina.cn
|
olympicchannelchina.cn
|
||||||
|
ottcn.com
|
||||||
tvcc.cn
|
tvcc.cn
|
||||||
tvcc.com.cn
|
tvcc.com.cn
|
||||||
xn--fiq53l6wcx3kp9bc7joo6apn8a.cn # 中国广播电视总台.cn
|
xn--fiq53l6wcx3kp9bc7joo6apn8a.cn # 中国广播电视总台.cn
|
||||||
xn--fiq53l90et9fpncc7joo6apn8a.cn # 中央广播电视总台.cn
|
|
||||||
xn--fiq53l6wcx3kp9bc7joo6apn8a.xn--fiqs8s # 中国广播电视总台.中国
|
xn--fiq53l6wcx3kp9bc7joo6apn8a.xn--fiqs8s # 中国广播电视总台.中国
|
||||||
|
xn--fiq53l90et9fpncc7joo6apn8a.cn # 中央广播电视总台.cn
|
||||||
xn--kprv4ewxfr9cpxcc7joo6apn8a.cn # 国家广播电视总台.cn
|
xn--kprv4ewxfr9cpxcc7joo6apn8a.cn # 国家广播电视总台.cn
|
||||||
xn--kprv4ewxfr9cpxcc7joo6apn8a.xn--fiqs8s # 国家广播电视总台.中国
|
xn--kprv4ewxfr9cpxcc7joo6apn8a.xn--fiqs8s # 国家广播电视总台.中国
|
||||||
yangshipin.cn
|
yangshipin.cn
|
||||||
|
|||||||
@@ -6,9 +6,11 @@ speedtest.hk.chinamobile.com @!cn
|
|||||||
speedtestbb.hk.chinamobile.com @!cn
|
speedtestbb.hk.chinamobile.com @!cn
|
||||||
|
|
||||||
# Migu
|
# Migu
|
||||||
migucloud.com
|
cmread.com
|
||||||
migu.cn
|
|
||||||
cmvideo.cn
|
cmvideo.cn
|
||||||
|
migu.cn
|
||||||
|
migucloud.com
|
||||||
|
migufun.com
|
||||||
miguvideo.com
|
miguvideo.com
|
||||||
|
|
||||||
# 中移互联
|
# 中移互联
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ xn--8y0a063a
|
|||||||
|
|
||||||
10010.com
|
10010.com
|
||||||
10010.com.cn
|
10010.com.cn
|
||||||
|
10155.com
|
||||||
114menhu.com
|
114menhu.com
|
||||||
169ol.com
|
169ol.com
|
||||||
chinaunicom.cn
|
chinaunicom.cn
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
# ArchLinux
|
|
||||||
ping.archlinux.org
|
|
||||||
|
|
||||||
# Apple
|
# Apple
|
||||||
captive.apple.com
|
captive.apple.com
|
||||||
|
|
||||||
# Android
|
# Arch Linux
|
||||||
connectivitycheck.gstatic.com
|
full:ping.archlinux.org
|
||||||
|
full:redirect.archlinux.org # Canonical Name of ping.archlinux.org
|
||||||
|
|
||||||
# Cloudflare
|
# Cloudflare
|
||||||
cp.cloudflare.com
|
cp.cloudflare.com
|
||||||
@@ -16,6 +14,9 @@ network-test.debian.org
|
|||||||
# Firefox
|
# Firefox
|
||||||
detectportal.firefox.com
|
detectportal.firefox.com
|
||||||
|
|
||||||
|
# Google
|
||||||
|
connectivitycheck.gstatic.com
|
||||||
|
|
||||||
# Honor
|
# Honor
|
||||||
full:connectivitycheck.platform.hihonorcloud.com
|
full:connectivitycheck.platform.hihonorcloud.com
|
||||||
|
|
||||||
@@ -28,6 +29,9 @@ networkcheck.kde.org
|
|||||||
# MIUI
|
# MIUI
|
||||||
full:connect.rom.miui.com
|
full:connect.rom.miui.com
|
||||||
|
|
||||||
|
# Ubuntu
|
||||||
|
full:connectivity-check.ubuntu.com
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
msftconnecttest.com
|
msftconnecttest.com
|
||||||
msftncsi.com
|
msftncsi.com
|
||||||
|
|||||||
2
data/deezer
Normal file
2
data/deezer
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
deezer.com
|
||||||
|
dzcdn.net
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
# 富途证券
|
# 富途证券
|
||||||
futuesop.com
|
futuesop.com @cn
|
||||||
futufin.com
|
futufin.com
|
||||||
futuhk.com
|
futuhk.com
|
||||||
|
futuhkapp.com
|
||||||
futuhn.com
|
futuhn.com
|
||||||
futuholdings.com
|
futuholdings.com
|
||||||
futuniuniu.com
|
futuniuniu.com @cn
|
||||||
futunn.com
|
futunn.com @cn
|
||||||
futustatic.com
|
futustatic.com @cn
|
||||||
|
|
||||||
# 富途 moomoo 证券
|
# 富途 moomoo 证券
|
||||||
moomoo.com
|
moomoo.com
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ include:pagecdn
|
|||||||
include:quantil
|
include:quantil
|
||||||
include:scaleflex
|
include:scaleflex
|
||||||
include:stackpath
|
include:stackpath
|
||||||
|
include:vrcdn
|
||||||
include:wistia
|
include:wistia
|
||||||
|
|
||||||
# Certificate authorities
|
# Certificate authorities
|
||||||
@@ -163,6 +164,7 @@ include:category-enhance-gaming
|
|||||||
include:category-mobile-repair
|
include:category-mobile-repair
|
||||||
include:category-ntp
|
include:category-ntp
|
||||||
include:category-password-management
|
include:category-password-management
|
||||||
|
include:category-web-archive
|
||||||
include:decryptipastore # iOS
|
include:decryptipastore # iOS
|
||||||
|
|
||||||
include:rsshub
|
include:rsshub
|
||||||
@@ -207,7 +209,6 @@ include:jwplayer
|
|||||||
include:kindle4rss
|
include:kindle4rss
|
||||||
include:kodi
|
include:kodi
|
||||||
include:liberapay
|
include:liberapay
|
||||||
include:linguee
|
|
||||||
include:localizejs
|
include:localizejs
|
||||||
include:madshi
|
include:madshi
|
||||||
include:mapbox
|
include:mapbox
|
||||||
@@ -246,7 +247,6 @@ include:trello
|
|||||||
include:tumblr
|
include:tumblr
|
||||||
include:tutanota
|
include:tutanota
|
||||||
include:vercel
|
include:vercel
|
||||||
include:webflow
|
|
||||||
include:wix
|
include:wix
|
||||||
include:wordpress
|
include:wordpress
|
||||||
include:zendesk
|
include:zendesk
|
||||||
@@ -263,6 +263,13 @@ originlab.com
|
|||||||
cloudlatex.io
|
cloudlatex.io
|
||||||
overleaf.com
|
overleaf.com
|
||||||
|
|
||||||
|
# Translator & Dictionary
|
||||||
|
include:linguee
|
||||||
|
|
||||||
|
collinsdictionary.com
|
||||||
|
ldoceonline.com
|
||||||
|
immersivetranslate.com # 沉浸式翻译 (国际版)
|
||||||
|
|
||||||
# Aurora Open Source Software (https://gitlab.com/AuroraOSS)
|
# Aurora Open Source Software (https://gitlab.com/AuroraOSS)
|
||||||
auroraoss.com
|
auroraoss.com
|
||||||
|
|
||||||
@@ -284,6 +291,7 @@ include:demonoid
|
|||||||
include:nyaa
|
include:nyaa
|
||||||
include:piratebay
|
include:piratebay
|
||||||
include:rarbg
|
include:rarbg
|
||||||
|
dmhy.org
|
||||||
|
|
||||||
# User scripts
|
# User scripts
|
||||||
greasyfork.org
|
greasyfork.org
|
||||||
@@ -321,6 +329,3 @@ include:tsquare
|
|||||||
include:windy
|
include:windy
|
||||||
include:xdty
|
include:xdty
|
||||||
include:xingrz
|
include:xingrz
|
||||||
|
|
||||||
# 沉浸式翻译
|
|
||||||
immersivetranslate.com
|
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ hsqh.net
|
|||||||
lu.com
|
lu.com
|
||||||
lufax.com
|
lufax.com
|
||||||
lufaxcdn.com
|
lufaxcdn.com
|
||||||
|
## 银豹收银系统
|
||||||
|
pospal.cn
|
||||||
|
|
||||||
# CDN or SDWAN
|
# CDN or SDWAN
|
||||||
include:aws-cn
|
include:aws-cn
|
||||||
@@ -87,6 +89,8 @@ yunaq.com
|
|||||||
## 即刻雾联(北京)
|
## 即刻雾联(北京)
|
||||||
## https://github.com/v2fly/domain-list-community/pull/1352#issuecomment-1345476790
|
## https://github.com/v2fly/domain-list-community/pull/1352#issuecomment-1345476790
|
||||||
jikeiot.cloud
|
jikeiot.cloud
|
||||||
|
## JSDMirror前端公共资源站
|
||||||
|
jsdmirror.com
|
||||||
## 开普云
|
## 开普云
|
||||||
kaipuyun.cn
|
kaipuyun.cn
|
||||||
kaipuyun.com
|
kaipuyun.com
|
||||||
@@ -196,6 +200,8 @@ winos.me # WINOS 精简社区
|
|||||||
|
|
||||||
# Healthcare
|
# Healthcare
|
||||||
include:category-hospital-cn
|
include:category-hospital-cn
|
||||||
|
## 安徽药品人才网
|
||||||
|
ahfda.com
|
||||||
## 丁香园
|
## 丁香园
|
||||||
biomart.cn
|
biomart.cn
|
||||||
dxy.com
|
dxy.com
|
||||||
@@ -328,6 +334,8 @@ bblmw.com
|
|||||||
## BOSS 直聘
|
## BOSS 直聘
|
||||||
bosszhipin.com
|
bosszhipin.com
|
||||||
zhipin.com
|
zhipin.com
|
||||||
|
## 天润融通 AI外呼 客服
|
||||||
|
clink.cn
|
||||||
## 当贝
|
## 当贝
|
||||||
dangbei.com
|
dangbei.com
|
||||||
dangbei.net
|
dangbei.net
|
||||||
@@ -348,6 +356,8 @@ i8tq.com
|
|||||||
tq121.com.cn
|
tq121.com.cn
|
||||||
weather.com.cn
|
weather.com.cn
|
||||||
weatherdt.com
|
weatherdt.com
|
||||||
|
## 沉浸式翻译 (中国版)
|
||||||
|
immersivetranslate.cn
|
||||||
## 掌阅
|
## 掌阅
|
||||||
ireader.com
|
ireader.com
|
||||||
zhangyue.com
|
zhangyue.com
|
||||||
@@ -392,6 +402,7 @@ include:dingdatech # 叮哒出行(杭州金通互联科技有限公司)
|
|||||||
include:dji
|
include:dji
|
||||||
include:gree
|
include:gree
|
||||||
include:haier
|
include:haier
|
||||||
|
include:hikvision
|
||||||
include:honor
|
include:honor
|
||||||
include:huawei
|
include:huawei
|
||||||
include:hupun # 杭州湖畔网络技术有限公司
|
include:hupun # 杭州湖畔网络技术有限公司
|
||||||
@@ -420,12 +431,17 @@ include:zte
|
|||||||
|
|
||||||
51togic.com # 泰捷WEBOX
|
51togic.com # 泰捷WEBOX
|
||||||
avlyun.com # 安天移动安全
|
avlyun.com # 安天移动安全
|
||||||
|
dreame.tech # 追觅科技
|
||||||
hisensehitachi.com # 海信日立官网
|
hisensehitachi.com # 海信日立官网
|
||||||
|
insta360.com # 影石Insta360
|
||||||
jamcz.com # 晨钟网络科技
|
jamcz.com # 晨钟网络科技
|
||||||
|
jmgo.com # 坚果投影
|
||||||
|
mediastory.cc # 闪电分镜
|
||||||
roborock.com # 石头科技
|
roborock.com # 石头科技
|
||||||
socpk.com # 极客湾移动芯片排行
|
socpk.com # 极客湾移动芯片排行
|
||||||
suzuki-china.com # 铃木中国官网
|
suzuki-china.com # 铃木中国官网
|
||||||
udesk.cn # 沃丰科技
|
udesk.cn # 沃丰科技
|
||||||
|
ysjf.com # 影视飓风
|
||||||
|
|
||||||
# 稿定(厦门)信息服务有限公司
|
# 稿定(厦门)信息服务有限公司
|
||||||
## 花瓣网 闽ICP备2021013850号
|
## 花瓣网 闽ICP备2021013850号
|
||||||
@@ -629,7 +645,6 @@ aiops.com
|
|||||||
aipai.com
|
aipai.com
|
||||||
airchangan.com
|
airchangan.com
|
||||||
airguilin.com
|
airguilin.com
|
||||||
aisee.tv # 粤ICP备10217959号-12
|
|
||||||
aiskycn.com
|
aiskycn.com
|
||||||
aizhan.com
|
aizhan.com
|
||||||
aldwx.com # 京ICP备17030349号-1
|
aldwx.com # 京ICP备17030349号-1
|
||||||
@@ -925,7 +940,6 @@ houdao.com
|
|||||||
houyuantuan.com
|
houyuantuan.com
|
||||||
hteacher.net
|
hteacher.net
|
||||||
huashengdaili.com
|
huashengdaili.com
|
||||||
huatu.com
|
|
||||||
huize.com
|
huize.com
|
||||||
hujia.org
|
hujia.org
|
||||||
huochepiao.com
|
huochepiao.com
|
||||||
@@ -976,7 +990,6 @@ jiazhao.com
|
|||||||
jiemeng8.com
|
jiemeng8.com
|
||||||
jikexueyuan.com
|
jikexueyuan.com
|
||||||
jinianbi.com
|
jinianbi.com
|
||||||
jinrongren.net
|
|
||||||
jinse.com
|
jinse.com
|
||||||
jinti.com
|
jinti.com
|
||||||
jisuxia.com
|
jisuxia.com
|
||||||
@@ -1119,7 +1132,6 @@ nxog.top # 湘ICP备2022006601号-1
|
|||||||
nzbdw.com
|
nzbdw.com
|
||||||
oadz.com
|
oadz.com
|
||||||
oeeee.com
|
oeeee.com
|
||||||
offcn.com
|
|
||||||
officese.com
|
officese.com
|
||||||
oicq88.com
|
oicq88.com
|
||||||
okooo.com
|
okooo.com
|
||||||
@@ -1132,7 +1144,6 @@ onlinedown.net
|
|||||||
onlinesjtu.com
|
onlinesjtu.com
|
||||||
onlylady.com
|
onlylady.com
|
||||||
opdown.com
|
opdown.com
|
||||||
ottcn.com # 津ICP备12004891号-2
|
|
||||||
oupeng.com
|
oupeng.com
|
||||||
p2peye.com
|
p2peye.com
|
||||||
p5w.net
|
p5w.net
|
||||||
@@ -1164,7 +1175,6 @@ qiaobutang.com
|
|||||||
qie.tv
|
qie.tv
|
||||||
qifeiye.com
|
qifeiye.com
|
||||||
qijiayoudao.net
|
qijiayoudao.net
|
||||||
qingdaochina.org
|
|
||||||
qingsongchou.com
|
qingsongchou.com
|
||||||
qiumibao.com
|
qiumibao.com
|
||||||
qizuang.com
|
qizuang.com
|
||||||
|
|||||||
@@ -7,11 +7,13 @@ adsense.com @ads
|
|||||||
adsensecustomsearchads.com @ads
|
adsensecustomsearchads.com @ads
|
||||||
adsenseformobileapps.com @ads
|
adsenseformobileapps.com @ads
|
||||||
adservice.google.com @ads
|
adservice.google.com @ads
|
||||||
|
adtrafficquality.google @ads
|
||||||
advertisercommunity.com @ads
|
advertisercommunity.com @ads
|
||||||
advertiserscommunity.com @ads
|
advertiserscommunity.com @ads
|
||||||
adwords-community.com @ads
|
adwords-community.com @ads
|
||||||
adwords.com @ads
|
adwords.com @ads
|
||||||
adwordsexpress.com @ads
|
adwordsexpress.com @ads
|
||||||
|
analytics-alv.google.com @ads
|
||||||
app-analytics-services.com @ads
|
app-analytics-services.com @ads
|
||||||
app-analytics-services-att.com @ads
|
app-analytics-services-att.com @ads
|
||||||
app-measurement-cn.com @ads
|
app-measurement-cn.com @ads
|
||||||
@@ -20,6 +22,7 @@ doubleclick-cn.net @ads
|
|||||||
doubleclick.cn @ads
|
doubleclick.cn @ads
|
||||||
doubleclick.com @ads
|
doubleclick.com @ads
|
||||||
doubleclick.net @ads
|
doubleclick.net @ads
|
||||||
|
fcmatch.google.com @ads
|
||||||
google-analytics-cn.com @ads
|
google-analytics-cn.com @ads
|
||||||
google-analytics.com @ads
|
google-analytics.com @ads
|
||||||
googleadapis.com @ads
|
googleadapis.com @ads
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
first-ns.de
|
first-ns.de
|
||||||
|
hetzner-cloud.de
|
||||||
hetzner.cloud
|
hetzner.cloud
|
||||||
hetzner.com
|
hetzner.com
|
||||||
hetzner.company
|
hetzner.company
|
||||||
|
|||||||
11
data/hikvision
Normal file
11
data/hikvision
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# 海康威视
|
||||||
|
hik-cloud.com
|
||||||
|
hik-express.com
|
||||||
|
hikiot.com
|
||||||
|
hikmall.com
|
||||||
|
hikvision.com
|
||||||
|
|
||||||
|
# 萤石
|
||||||
|
eziot.com
|
||||||
|
ezviz.com
|
||||||
|
ys7.com
|
||||||
3
data/internet-archive
Normal file
3
data/internet-archive
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
archive-it.org
|
||||||
|
archive.org
|
||||||
|
openlibrary.org
|
||||||
@@ -1,7 +1,13 @@
|
|||||||
# TGC Taiwan Inc.
|
# TGC Taiwan Inc.
|
||||||
litv.tv
|
litv.tv
|
||||||
litvfreepc.akamaized.net
|
litvfreepc.akamaized.net
|
||||||
|
full:ntdfreemobile-tgc.cdn.hinet.net
|
||||||
|
full:ntdfreepc-tgc.cdn.hinet.net
|
||||||
|
full:ntdfreetv-tgc.cdn.hinet.net
|
||||||
|
full:ntdfreevcpc-tgc.cdn.hinet.net
|
||||||
|
|
||||||
ofiii.com
|
ofiii.com
|
||||||
|
full:ntdofifreemobile-tgc.cdn.hinet.net
|
||||||
full:ntdofifreepc-tgc.cdn.hinet.net
|
full:ntdofifreepc-tgc.cdn.hinet.net
|
||||||
|
full:ntdofifreetv-tgc.cdn.hinet.net
|
||||||
full:ntdofifreevcpc-tgc.cdn.hinet.net
|
full:ntdofifreevcpc-tgc.cdn.hinet.net
|
||||||
|
|||||||
@@ -24,6 +24,11 @@ ttlivecdn.com @!cn
|
|||||||
ttoverseaus.net @!cn
|
ttoverseaus.net @!cn
|
||||||
ttwstatic.com @!cn
|
ttwstatic.com @!cn
|
||||||
|
|
||||||
|
tiktokcdn-us.com.edgesuite.net @!cn
|
||||||
|
tiktokcdn.com.akamaized.net @!cn
|
||||||
|
tiktokcdn.com.edgesuite.net @!cn
|
||||||
|
tiktokv.com.edgekey.net @!cn
|
||||||
|
tiktokv.com.edgesuite.net @!cn
|
||||||
full:p16-tiktokcdn-com.akamaized.net @!cn
|
full:p16-tiktokcdn-com.akamaized.net @!cn
|
||||||
full:roovza-launches.appsflyersdk.com @!cn
|
full:roovza-launches.appsflyersdk.com @!cn
|
||||||
full:roovza.inapps.appsflyersdk.com @!cn
|
full:roovza.inapps.appsflyersdk.com @!cn
|
||||||
|
|||||||
3
data/vrcdn
Normal file
3
data/vrcdn
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
vrcdn.cloud
|
||||||
|
vrcdn.live
|
||||||
|
vrcdn.video
|
||||||
3
data/vrchat
Normal file
3
data/vrchat
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
vrchat.cloud
|
||||||
|
vrchat.com
|
||||||
|
vrchat.net
|
||||||
@@ -1 +0,0 @@
|
|||||||
webflow.com
|
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
include:askdiandian
|
||||||
|
|
||||||
xhscdn.com
|
xhscdn.com
|
||||||
xhscdn.net
|
xhscdn.net
|
||||||
|
xhslink.com
|
||||||
xiaohongshu.com
|
xiaohongshu.com
|
||||||
|
|||||||
@@ -6,8 +6,12 @@ ad1.xiaomi.com @ads
|
|||||||
admob.xiaomi.com @ads
|
admob.xiaomi.com @ads
|
||||||
adv.sec.intl.miui.com @ads
|
adv.sec.intl.miui.com @ads
|
||||||
adv.sec.miui.com @ads
|
adv.sec.miui.com @ads
|
||||||
|
data.mistat.india.xiaomi.com @ads
|
||||||
|
data.mistat.intl.xiaomi.com @ads
|
||||||
|
data.mistat.rus.xiaomi.com @ads
|
||||||
|
data.mistat.xiaomi.com @ads
|
||||||
|
logupdate.avlyun.sec.miui.com @ads
|
||||||
misc.in.duokanbox.com @ads
|
misc.in.duokanbox.com @ads
|
||||||
mistat.xiaomi.com @ads
|
|
||||||
sentry.d.mi.com @ads
|
sentry.d.mi.com @ads
|
||||||
sentry.d.xiaomi.net @ads
|
sentry.d.xiaomi.net @ads
|
||||||
tjqonline.cn @ads
|
tjqonline.cn @ads
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
include:zuoyebang-ads
|
||||||
|
|
||||||
zuoyebang.cc
|
zuoyebang.cc
|
||||||
zuoyebang.com
|
zuoyebang.com
|
||||||
zybang.com
|
zybang.com
|
||||||
|
|||||||
1
data/zuoyebang-ads
Normal file
1
data/zuoyebang-ads
Normal file
@@ -0,0 +1 @@
|
|||||||
|
syh.zybang.com @ads
|
||||||
345
main.go
345
main.go
@@ -8,7 +8,6 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
router "github.com/v2fly/v2ray-core/v5/app/router/routercommon"
|
router "github.com/v2fly/v2ray-core/v5/app/router/routercommon"
|
||||||
@@ -30,6 +29,19 @@ 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]*List)
|
||||||
|
cirIncMap = make(map[string]bool) // Used for circular inclusion detection
|
||||||
|
)
|
||||||
|
|
||||||
type Entry struct {
|
type Entry struct {
|
||||||
Type string
|
Type string
|
||||||
Value string
|
Value string
|
||||||
@@ -41,15 +53,21 @@ type List struct {
|
|||||||
Entry []Entry
|
Entry []Entry
|
||||||
}
|
}
|
||||||
|
|
||||||
type ParsedList struct {
|
type Inclusion struct {
|
||||||
Name string
|
Source string
|
||||||
Inclusion map[string]bool
|
MustAttrs []*router.Domain_Attribute
|
||||||
Entry []Entry
|
BannedAttrs []*router.Domain_Attribute
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *ParsedList) toPlainText(listName string) error {
|
type ParsedList struct {
|
||||||
|
Name string
|
||||||
|
Inclusions []Inclusion
|
||||||
|
Entry []Entry
|
||||||
|
}
|
||||||
|
|
||||||
|
func (entryList *List) toPlainText() error {
|
||||||
var entryBytes []byte
|
var entryBytes []byte
|
||||||
for _, entry := range l.Entry {
|
for _, entry := range entryList.Entry {
|
||||||
var attrString string
|
var attrString string
|
||||||
if entry.Attrs != nil {
|
if entry.Attrs != nil {
|
||||||
for _, attr := range entry.Attrs {
|
for _, attr := range entry.Attrs {
|
||||||
@@ -60,13 +78,13 @@ func (l *ParsedList) toPlainText(listName string) error {
|
|||||||
// Entry output format is: type:domain.tld:@attr1,@attr2
|
// Entry output format is: type:domain.tld:@attr1,@attr2
|
||||||
entryBytes = append(entryBytes, []byte(entry.Type+":"+entry.Value+attrString+"\n")...)
|
entryBytes = append(entryBytes, []byte(entry.Type+":"+entry.Value+attrString+"\n")...)
|
||||||
}
|
}
|
||||||
if err := os.WriteFile(filepath.Join(*outputDir, listName+".txt"), entryBytes, 0644); err != nil {
|
if err := os.WriteFile(filepath.Join(*outputDir, strings.ToLower(entryList.Name)+".txt"), entryBytes, 0644); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *ParsedList) toProto() (*router.GeoSite, error) {
|
func (l *List) toProto() (*router.GeoSite, error) {
|
||||||
site := &router.GeoSite{
|
site := &router.GeoSite{
|
||||||
CountryCode: l.Name,
|
CountryCode: l.Name,
|
||||||
}
|
}
|
||||||
@@ -80,11 +98,6 @@ func (l *ParsedList) toProto() (*router.GeoSite, error) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
case RuleTypeRegexp:
|
case RuleTypeRegexp:
|
||||||
// check regexp validity to avoid runtime error
|
|
||||||
_, 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{
|
site.Domain = append(site.Domain, &router.Domain{
|
||||||
Type: router.Domain_Regex,
|
Type: router.Domain_Regex,
|
||||||
Value: entry.Value,
|
Value: entry.Value,
|
||||||
@@ -104,100 +117,72 @@ func (l *ParsedList) toProto() (*router.GeoSite, error) {
|
|||||||
Value: entry.Value,
|
Value: entry.Value,
|
||||||
Attribute: entry.Attrs,
|
Attribute: entry.Attrs,
|
||||||
})
|
})
|
||||||
|
|
||||||
default:
|
|
||||||
return nil, fmt.Errorf("unknown domain type: %s", entry.Type)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return site, nil
|
return site, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func exportPlainTextList(list []string, refName string, pl *ParsedList) {
|
func exportPlainTextList(exportFiles []string, entryList *List) {
|
||||||
for _, listName := range list {
|
for _, exportfilename := range exportFiles {
|
||||||
if strings.EqualFold(refName, listName) {
|
if strings.EqualFold(entryList.Name, exportfilename) {
|
||||||
if err := pl.toPlainText(strings.ToLower(refName)); err != nil {
|
if err := entryList.toPlainText(); err != nil {
|
||||||
fmt.Println("Failed:", err)
|
fmt.Println("Failed to exportPlainTextList:", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fmt.Printf("'%s' has been generated successfully.\n", listName)
|
fmt.Printf("'%s' has been generated successfully.\n", exportfilename)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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/Check 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])
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return fmt.Errorf("invalid format: %s", domain)
|
|
||||||
}
|
|
||||||
|
|
||||||
func parseAttribute(attr string) (*router.Domain_Attribute, error) {
|
|
||||||
var attribute router.Domain_Attribute
|
|
||||||
if len(attr) == 0 || attr[0] != '@' {
|
|
||||||
return &attribute, fmt.Errorf("invalid attribute: %s", attr)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Trim attribute prefix `@` character
|
|
||||||
attr = attr[1:]
|
|
||||||
parts := strings.Split(attr, "=")
|
|
||||||
if len(parts) == 1 {
|
|
||||||
attribute.Key = strings.ToLower(parts[0])
|
|
||||||
attribute.TypedValue = &router.Domain_Attribute_BoolValue{BoolValue: true}
|
|
||||||
} else {
|
} else {
|
||||||
attribute.Key = strings.ToLower(parts[0])
|
return entry, fmt.Errorf("invalid format: %s", line)
|
||||||
intv, err := strconv.Atoi(parts[1])
|
}
|
||||||
if err != nil {
|
if !TypeChecker.MatchString(entry.Type) {
|
||||||
return &attribute, fmt.Errorf("invalid attribute: %s: %v", attr, err)
|
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)
|
||||||
}
|
}
|
||||||
attribute.TypedValue = &router.Domain_Attribute_IntValue{IntValue: int64(intv)}
|
} else if !ValueChecker.MatchString(entry.Value) {
|
||||||
}
|
return entry, fmt.Errorf("invalid value: %s", entry.Value)
|
||||||
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 {
|
// Parse/Check attributes
|
||||||
return entry, err
|
for _, part := range parts[1:] {
|
||||||
}
|
if !strings.HasPrefix(part, "@") {
|
||||||
|
return entry, fmt.Errorf("invalid attribute: %s", part)
|
||||||
for i := 1; i < len(parts); i++ {
|
|
||||||
attr, err := parseAttribute(parts[i])
|
|
||||||
if err != nil {
|
|
||||||
return entry, err
|
|
||||||
}
|
}
|
||||||
entry.Attrs = append(entry.Attrs, attr)
|
attrKey := strings.ToLower(part[1:]) // Trim attribute prefix `@` character
|
||||||
|
if !AttrChecker.MatchString(attrKey) {
|
||||||
|
return entry, fmt.Errorf("invalid attribute key: %s", attrKey)
|
||||||
|
}
|
||||||
|
entry.Attrs = append(entry.Attrs, &router.Domain_Attribute{
|
||||||
|
Key: attrKey,
|
||||||
|
TypedValue: &router.Domain_Attribute_BoolValue{BoolValue: true},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
// Sort attributes
|
||||||
|
sort.Slice(entry.Attrs, func(i, j int) bool {
|
||||||
|
return entry.Attrs[i].Key < entry.Attrs[j].Key
|
||||||
|
})
|
||||||
|
|
||||||
return entry, nil
|
return entry, nil
|
||||||
}
|
}
|
||||||
@@ -214,9 +199,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)
|
||||||
@@ -229,108 +218,77 @@ 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) (*ParsedList, error) {
|
||||||
isMatch := false
|
pl := &ParsedList{Name: refList.Name}
|
||||||
mustMatch := true
|
for _, entry := range refList.Entry {
|
||||||
matchName := includeKey
|
if entry.Type == RuleTypeInclude {
|
||||||
if strings.HasPrefix(includeKey, "!") {
|
inc := Inclusion{Source: strings.ToUpper(entry.Value)}
|
||||||
isMatch = true
|
for _, attr := range entry.Attrs {
|
||||||
mustMatch = false
|
if strings.HasPrefix(attr.Key, "-") {
|
||||||
matchName = strings.TrimLeft(includeKey, "!")
|
inc.BannedAttrs = append(inc.BannedAttrs, &router.Domain_Attribute{
|
||||||
}
|
Key: attr.Key[1:], // Trim attribute prefix `-` character
|
||||||
|
TypedValue: &router.Domain_Attribute_BoolValue{BoolValue: true},
|
||||||
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
|
|
||||||
|
|
||||||
return pl, nil
|
return pl, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isMatchAttrFilters(entry Entry, incFilter Inclusion) bool {
|
||||||
|
attrMap := make(map[string]bool)
|
||||||
|
for _, attr := range entry.Attrs {
|
||||||
|
attrMap[attr.Key] = true
|
||||||
|
}
|
||||||
|
for _, m := range incFilter.MustAttrs {
|
||||||
|
if !attrMap[m.Key] { return false }
|
||||||
|
}
|
||||||
|
for _, b := range incFilter.BannedAttrs {
|
||||||
|
if attrMap[b.Key] { return false }
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func ResolveList(pl *ParsedList) error {
|
||||||
|
//TODO: deduplicate
|
||||||
|
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)
|
||||||
|
|
||||||
|
finalList := &List{Name: pl.Name}
|
||||||
|
finalList.Entry = append(finalList.Entry, pl.Entry...)
|
||||||
|
|
||||||
|
for _, inc := range pl.Inclusions {
|
||||||
|
if err := ResolveList(plMap[inc.Source]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for _, entry := range finalMap[inc.Source].Entry {
|
||||||
|
if isMatchAttrFilters(entry, inc) {
|
||||||
|
finalList.Entry = append(finalList.Entry, entry)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finalMap[pl.Name] = finalList
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
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
|
||||||
@@ -342,7 +300,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 {
|
||||||
@@ -350,6 +308,24 @@ func main() {
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Generate plMap
|
||||||
|
for refName, refList := range refMap {
|
||||||
|
pl, err := ParseList(refList)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to ParseList:", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
plMap[refName] = pl
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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 {
|
||||||
@@ -360,13 +336,8 @@ func main() {
|
|||||||
|
|
||||||
protoList := new(router.GeoSiteList)
|
protoList := new(router.GeoSiteList)
|
||||||
var existList []string
|
var existList []string
|
||||||
for refName, list := range ref {
|
for _, siteEntries := range finalMap {
|
||||||
pl, err := ParseList(list, ref)
|
site, err := siteEntries.toProto()
|
||||||
if err != nil {
|
|
||||||
fmt.Println("Failed:", err)
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
site, err := pl.toProto()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Failed:", err)
|
fmt.Println("Failed:", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
@@ -376,7 +347,7 @@ func main() {
|
|||||||
// Flatten and export plaintext list
|
// Flatten and export plaintext list
|
||||||
if *exportLists != "" {
|
if *exportLists != "" {
|
||||||
if existList != nil {
|
if existList != nil {
|
||||||
exportPlainTextList(existList, refName, pl)
|
exportPlainTextList(existList, siteEntries)
|
||||||
} else {
|
} else {
|
||||||
exportedListSlice := strings.Split(*exportLists, ",")
|
exportedListSlice := strings.Split(*exportLists, ",")
|
||||||
for _, exportedListName := range exportedListSlice {
|
for _, exportedListName := range exportedListSlice {
|
||||||
@@ -389,7 +360,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if existList != nil {
|
if existList != nil {
|
||||||
exportPlainTextList(existList, refName, pl)
|
exportPlainTextList(existList, siteEntries)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -402,11 +373,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