Compare commits

...

15 Commits

Author SHA1 Message Date
Loyalsoldier
b3b6304a12 Fix with accept-encoding header & compressed option 2020-02-01 18:31:27 +08:00
loyalsoldier
ce4c3ee3d7 Revert "Change IP regex to domain regex" 2020-01-27 23:08:45 +08:00
loyalsoldier
77698a15f7 Change IP regex to domain regex 2020-01-27 22:51:10 +08:00
loyalsoldier
e4c729bf44 Fix _ character in regex 2020-01-27 22:47:32 +08:00
loyalsoldier
686c2d3c29 Fix typos 2020-01-27 22:36:52 +08:00
loyalsoldier
f8094e3e00 Refine regex scripts using Perl 2020-01-27 22:29:56 +08:00
loyalsoldier
bc7c8f7a4c Refine ookla-speedtest generation script using Perl 2020-01-27 21:16:23 +08:00
loyalsoldier
82a87b23e6 Fix typos & indent 2020-01-27 20:45:39 +08:00
Loyalsoldier
b1148f1bb7 Delete test.yml 2020-01-27 20:40:50 +08:00
Loyalsoldier
3a83e3911d Test 2020-01-27 20:37:44 +08:00
Loyalsoldier
ffc54de20e Update project description 2020-01-27 19:11:41 +08:00
Loyalsoldier
ec270174fb Fix typos 2020-01-27 19:10:22 +08:00
Loyalsoldier
9eb1fd129d Add more details
Add more details about the use of @felixonmars dnsmasq-china-list project
2020-01-27 14:33:05 +08:00
Loyalsoldier
1a03c37bae Add some CDN domains 2020-01-27 14:14:27 +08:00
Loyalsoldier
f8bb1017c6 Automatically generate ookla-speedtest sub-list from source 2020-01-26 22:16:41 +08:00
2 changed files with 34 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
name: Build v2ray rules dat files
name: Build V2Ray rules dat files
on:
schedule:
- cron: "0 22 * * *"
@@ -27,6 +27,7 @@ jobs:
echo "::set-env name=CHINA_DOMAINS_URL::https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf"
echo "::set-env name=GOOGLE_DOMAINS_URL::https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/google.china.conf"
echo "::set-env name=APPLE_DOMAINS_URL::https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf"
echo "::set-env name=CDN_DOMAINS_URL::https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/removed-cdn.txt"
echo "::set-env name=GFWLIST_DOMAINS_URL::https://cokebar.github.io/gfwlist2dnsmasq/gfwlist_domain.txt"
echo "::set-env name=GREATFIRE_DOMAINS_URL::https://raw.githubusercontent.com/wongsyrone/domain-block-list/master/domains.txt"
echo "::set-env name=PROFILES_URL::https://raw.githubusercontent.com/ConnersHua/Profiles/master/Shadow/Pro.conf"
@@ -40,12 +41,12 @@ jobs:
echo "::add-path::$(dirname $GITHUB_WORKSPACE)/bin"
shell: bash
- name: Checkout branch named hidden of this repo
- name: Checkout the "hidden" branch
uses: actions/checkout@v2
with:
ref: hidden
- name: Get GeoLite2 file
- name: Get GeoLite2 zip file
run: |
curl -L -o GeoLite2-Country-CSV.zip "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country-CSV&license_key=JvbzLLx7qBZT&suffix=zip"
unzip GeoLite2-Country-CSV.zip
@@ -63,22 +64,28 @@ jobs:
run: |
go get -u -v -insecure $GEOSITE_REPO
- name: Automatically generate ookla-speedtest sub-list from source
run: |
curl -L -o servers-source.xml "https://c.speedtest.net/speedtest-servers-static.php" -H "Accept-Encoding: gzip" --compressed
perl -ne '/host="(.+):[0-9]+"/ && print "full:$1\n"' servers-source.xml | perl -ne 'print if not /^(full:([0-9]{1,3}\.){3}[0-9]{1,3})$/' | perl -ne 'print lc' | sort --ignore-case -u >> $GOPATH/src/$GEOSITE_REPO/data/ookla-speedtest
- name: Get and add direct domains into temp-direct.txt file
run: |
curl -sSL $CHINA_DOMAINS_URL | awk -F '/' '{print $2}' > temp-direct.txt
curl -sSL $CHINA_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' > temp-direct.txt
- name: Get and add proxy domains into temp-proxy.txt file
run: |
curl -sSL $GFWLIST_DOMAINS_URL > temp-proxy.txt
curl -sSL $GREATFIRE_DOMAINS_URL >> temp-proxy.txt
curl -sSL $GOOGLE_DOMAINS_URL | awk -F '/' '{print $2}' >> temp-proxy.txt
curl -sSL $APPLE_DOMAINS_URL | awk -F '/' '{print $2}' >> temp-proxy.txt
curl -sSL $GFWLIST_DOMAINS_URL | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > temp-proxy.txt
curl -sSL $GREATFIRE_DOMAINS_URL | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' >> temp-proxy.txt
curl -sSL $GOOGLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' >> temp-proxy.txt
curl -sSL $APPLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' >> temp-proxy.txt
curl -sSL $CDN_DOMAINS_URL| perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' >> temp-proxy.txt
curl -sSL $PROFILES_URL | awk -F ',' '/^DOMAIN(,|\-SUFFIX,).+PROXY/ {print $2}' >> temp-proxy.txt
curl -sSL $GEQ1AN_RULES_APPLE_URL | awk -F ',' '/^(HOST|DOMAIN)(,|\-SUFFIX,).+Apple/ {print $2}' >> temp-proxy.txt
curl -sSL $GEQ1AN_RULES_MICROSOFT_URL | awk -F ',' '/^(HOST|DOMAIN)(,|\-SUFFIX,).+Microsoft/ {print $2}' >> temp-proxy.txt
curl -sSL $GEQ1AN_RULES_GLOBAL_MEDIA_URL | awk -F ',' '/^(HOST|DOMAIN)(,|\-SUFFIX,).+GMedia/ {print $2}' >> temp-proxy.txt
curl -sSL $GEQ1AN_RULES_OUTSIDE_URL | awk -F ',' '/^(HOST|DOMAIN)(,|\-SUFFIX,).+Outside/ {print $2}' >> temp-proxy.txt
- name: Get and add reject domains into temp-reject.txt file
run: |
curl -sSL $PROFILES_URL | awk -F ',' '/^DOMAIN(,|\-SUFFIX,).+REJECT/ {print $2}' > temp-reject.txt
@@ -90,20 +97,14 @@ jobs:
cat proxy.txt >> temp-proxy.txt
cat direct.txt >> temp-direct.txt
- name: Remove repeated domains, sort domains and write domains to appropriate list
- name: Sort and generate lists
run: |
cat temp-proxy.txt | sort --ignore-case -u > proxy-sort.txt
cat temp-direct.txt | sort --ignore-case -u > direct-sort.txt
cat temp-reject.txt | sort --ignore-case -u > reject-sort.txt
- name: Filter valid domains
run: |
cat proxy-sort.txt | awk '/^([a-zA-Z0-9[.-.][._.]]+\.)+[a-zA-Z0-9[.-.]]+$/{print $0}' > $GOPATH/src/$GEOSITE_REPO/data/proxylist
cat proxy-sort.txt | awk '!/^([a-zA-Z0-9[.-.][._.]]+\.)+[a-zA-Z0-9[.-.]]+$/{print $0}' > proxy-filter.txt
cat direct-sort.txt | awk '/^([a-zA-Z0-9[.-.][._.]]+\.)+[a-zA-Z0-9[.-.]]+$/{print $0}' > $GOPATH/src/$GEOSITE_REPO/data/directlist
cat direct-sort.txt | awk '!/^([a-zA-Z0-9[.-.][._.]]+\.)+[a-zA-Z0-9[.-.]]+$/{print $0}' > direct-filter.txt
cat reject-sort.txt | awk '/^([a-zA-Z0-9[.-.][._.]]+\.)+[a-zA-Z0-9[.-.]]+$/{print $0}' > $GOPATH/src/$GEOSITE_REPO/data/rejectlist
cat reject-sort.txt | awk '!/^([a-zA-Z0-9[.-.][._.]]+\.)+[a-zA-Z0-9[.-.]]+$/{print $0}' > reject-filter.txt
cat temp-proxy.txt | sort --ignore-case -u | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > $GOPATH/src/$GEOSITE_REPO/data/proxylist
cat temp-proxy.txt | sort --ignore-case -u | perl -ne 'print if not /^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/' > proxy-excluse-list.txt
cat temp-direct.txt | sort --ignore-case -u | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > $GOPATH/src/$GEOSITE_REPO/data/directlist
cat temp-direct.txt | sort --ignore-case -u | perl -ne 'print if not /^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/' > direct-excluse-list.txt
cat temp-reject.txt | sort --ignore-case -u | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > $GOPATH/src/$GEOSITE_REPO/data/rejectlist
cat temp-reject.txt | sort --ignore-case -u | perl -ne 'print if not /^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/' > reject-excluse-list.txt
- name: Add list into appropriate category file
run: |
@@ -116,7 +117,7 @@ jobs:
run: |
domain-list-community
mv ./dlc.dat ./publish/geosite.dat
mv ./*-filter.txt ./publish/
mv ./*-excluse-list.txt ./publish/
cp -f $GOPATH/src/$GEOSITE_REPO/data/{proxy,direct,reject}list ./publish/
- name: Release dat files

View File

@@ -1,6 +1,6 @@
# 简介
**v2ray** 加强版规则文件,可代替 v2ray 官方 `geoip.dat``geosite.dat` 规则文件。利用 GitHub Actions 北京时间每天早上 6 点自动构建,保证规则最新。
**V2Ray** 规则文件加强版,可代替 V2Ray 官方 `geoip.dat``geosite.dat` 规则文件。利用 GitHub Actions 北京时间每天早上 6 点自动构建,保证规则最新。
## 规则文件生成方式
@@ -12,7 +12,11 @@
### geosite.dat
- 通过仓库 [@v2ray/domain-list-community](https://github.com/v2ray/domain-list-community) 生成
- **加入大量中国大陆域名**:通过仓库 [@felixonmars/dnsmasq-china-list](https://github.com/felixonmars/dnsmasq-china-list) 生成并加入到 `geosite:cn` 类别中
- **加入大量中国大陆域名、Apple 域名、Google 域名和部分海外 CDN 域名**
- [@felixonmars/dnsmasq-china-list/accelerated-domains.china.conf](https://github.com/felixonmars/dnsmasq-china-list/blob/master/accelerated-domains.china.conf) 加入到 `geosite:cn` 类别中
- [@felixonmars/dnsmasq-china-list/apple.china.conf](https://github.com/felixonmars/dnsmasq-china-list/blob/master/apple.china.conf) 加入到 `geosite:geolocation-!cn` 类别中
- [@felixonmars/dnsmasq-china-list/google.china.conf](https://github.com/felixonmars/dnsmasq-china-list/blob/master/google.china.conf) 加入到 `geosite:geolocation-!cn` 类别中
- [@felixonmars/dnsmasq-china-list/removed-cdn.txt](https://github.com/felixonmars/dnsmasq-china-list/blob/master/removed-cdn.txt) 加入到 `geosite:geolocation-!cn` 类别中
- **加入最新 GFWList 域名**:通过仓库 [@cokebar/gfwlist2dnsmasq](https://github.com/cokebar/gfwlist2dnsmasq) 生成并加入到 `geosite:geolocation-!cn` 类别中
- **加入 Greatfire Analyzer 检测到的屏蔽域名**:通过仓库 [@wongsyrone/domain-block-list](https://github.com/wongsyrone/domain-block-list) 获取 [Greatfire Analyzer](https://zh.greatfire.org/analyzer) 检测到的屏蔽域名,并加入到 `geosite:geolocation-!cn` 类别中
- **加入更多代理域名和广告域名**:通过仓库 [@ConnersHua/Profiles](https://github.com/ConnersHua/Profiles/tree/master)、[@GeQ1an/Rules](https://github.com/GeQ1an/Rules/tree/master/QuantumultX) 和 [@lhie1/Rules](https://github.com/lhie1/Rules/tree/master) 获取更多代理域名、广告域名,并分别加入到 `geosite:geolocation-!cn``geosite:category-ads-all` 类别中
@@ -28,14 +32,14 @@
**使用方式**
1. 通过上面下载地址或[点击进入规则文件发布页面](https://github.com/Loyalsoldier/v2ray-rules-dat/releases),下载 `geoip.dat``geosite.dat`
2. 把下载下来的 `geoip.dat``geosite.dat` 文件放入到 v2ray 软件的规则文件目录,替换掉原来的 `geoip.dat``geosite.dat`
3. 修改 v2ray 配置文件,配置参考下面 👇👇👇
2. 把下载下来的 `geoip.dat``geosite.dat` 文件放入到 V2Ray 软件的规则文件目录,替换掉原来的 `geoip.dat``geosite.dat`
3. 修改 V2Ray 配置文件,配置参考下面 👇👇👇
## 参考配置
### geoip.dat
v2ray 官方 `geoip.dat` 配置方式相同。
V2Ray 官方 `geoip.dat` 配置方式相同。
**Routing 配置方式**
@@ -58,7 +62,7 @@
### geosite.dat
v2ray 官方 `geosite.dat` 配置方式相同。
V2Ray 官方 `geosite.dat` 配置方式相同。
**Routing 配置方式**