mirror of
https://github.com/Loyalsoldier/v2ray-rules-dat.git
synced 2026-01-13 04:57:12 +08:00
Compare commits
32 Commits
2020051203
...
2020072422
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc95dd0f1f | ||
|
|
7f98db18f7 | ||
|
|
1e4898fd50 | ||
|
|
501e8d121e | ||
|
|
842c180663 | ||
|
|
0463521801 | ||
|
|
6308edf8f2 | ||
|
|
1e0bafc21f | ||
|
|
992b02fa83 | ||
|
|
fc4062c3e7 | ||
|
|
9bdbf8e49a | ||
|
|
320f8849ff | ||
|
|
368a00b913 | ||
|
|
bcefb05796 | ||
|
|
45ade5b9ff | ||
|
|
05b4021505 | ||
|
|
896b809632 | ||
|
|
8148a3bac2 | ||
|
|
54b01cd838 | ||
|
|
d9ffcd313b | ||
|
|
14f9756d78 | ||
|
|
f3acc73a29 | ||
|
|
4d73ef6f3d | ||
|
|
013c6ef33a | ||
|
|
91f21e9dd0 | ||
|
|
d5bf41ce00 | ||
|
|
3245b960bb | ||
|
|
2bfb1aa228 | ||
|
|
765182332a | ||
|
|
6725586512 | ||
|
|
838b85e50a | ||
|
|
10961eff9c |
15
.github/dependabot.yml
vendored
Normal file
15
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
timezone: "Asia/Shanghai"
|
||||
time: "07:00"
|
||||
pull-request-branch-name:
|
||||
separator: "-"
|
||||
70
.github/workflows/build.yml
vendored
70
.github/workflows/build.yml
vendored
@@ -6,29 +6,31 @@ on:
|
||||
branches:
|
||||
- master
|
||||
- hidden
|
||||
paths-ignore:
|
||||
- ".github/**"
|
||||
- "**/README.md"
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Go 1.14
|
||||
uses: actions/setup-go@v1
|
||||
- name: Setup Go 1.x
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.14
|
||||
go-version: "^1.14"
|
||||
|
||||
- name: Set $GOPATH and more variables
|
||||
run: |
|
||||
echo "::set-env name=RELEASE_NAME::Released on $(date +%Y%m%d%H%M)"
|
||||
echo "::set-env name=TAG_NAME::$(date +%Y%m%d%H%M)"
|
||||
echo "::set-env name=GEOIP_REPO::github.com/Loyalsoldier/geoip"
|
||||
echo "::set-env name=GEOSITE_REPO::github.com/v2ray/domain-list-community"
|
||||
echo "::set-env name=GEOSITE_REPO::github.com/v2fly/domain-list-community"
|
||||
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=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=GREATFIRE_DOMAINS_MINE_URL::https://raw.githubusercontent.com/Loyalsoldier/cn-blocked-domain/release/domains.txt"
|
||||
echo "::set-env name=PROFILES_URL::https://raw.githubusercontent.com/ConnersHua/Profiles/master/Shadow/Pro.conf"
|
||||
echo "::set-env name=GFWLIST_EXTRAS_DOMAINS_URL::https://raw.githubusercontent.com/pexcn/gfwlist-extras/master/gfwlist-extras.txt"
|
||||
echo "::set-env name=GREATFIRE_DOMAINS_URL::https://raw.githubusercontent.com/Loyalsoldier/cn-blocked-domain/release/domains.txt"
|
||||
echo "::set-env name=GEQ1AN_RULES_APPLE_URL::https://raw.githubusercontent.com/GeQ1an/Rules/master/QuantumultX/Filter/Apple.list"
|
||||
echo "::set-env name=GEQ1AN_RULES_MICROSOFT_URL::https://raw.githubusercontent.com/GeQ1an/Rules/master/QuantumultX/Filter/Optional/Microsoft.list"
|
||||
echo "::set-env name=GEQ1AN_RULES_GLOBAL_MEDIA_URL::https://raw.githubusercontent.com/GeQ1an/Rules/master/QuantumultX/Filter/GMedia.list"
|
||||
@@ -36,12 +38,13 @@ jobs:
|
||||
echo "::set-env name=GEQ1AN_RULES_REJECT_URL::https://raw.githubusercontent.com/GeQ1an/Rules/master/QuantumultX/Filter/AdBlock.list"
|
||||
echo "::set-env name=LHIE1_RULES_PROXY_URL::https://raw.githubusercontent.com/lhie1/Rules/master/Surge/Surge%203/Provider/Proxy.list"
|
||||
echo "::set-env name=LHIE1_RULES_REJECT_URL::https://raw.githubusercontent.com/lhie1/Rules/master/Surge/Surge%203/Provider/Reject.list"
|
||||
echo "::set-env name=ADAWAY_REJECT_URL::https://raw.githubusercontent.com/AdAway/adaway.github.io/master/hosts.txt"
|
||||
echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)"
|
||||
echo "::add-path::$(dirname $GITHUB_WORKSPACE)/bin"
|
||||
shell: bash
|
||||
|
||||
- name: Checkout the "hidden" branch
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.3.1
|
||||
with:
|
||||
ref: hidden
|
||||
|
||||
@@ -55,9 +58,7 @@ jobs:
|
||||
- name: Generate geoip.dat file
|
||||
run: |
|
||||
go get -u -v -insecure $GEOIP_REPO
|
||||
geoip --country=./geoip/GeoLite2-Country-Locations-en.csv --ipv4=./geoip/GeoLite2-Country-Blocks-IPv4.csv --ipv6=./geoip/GeoLite2-Country-Blocks-IPv6.csv --cnipv4url=https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt
|
||||
mkdir -p ./publish
|
||||
mv ./geoip.dat ./publish/
|
||||
geoip --country=./geoip/GeoLite2-Country-Locations-en.csv --ipv4=./geoip/GeoLite2-Country-Blocks-IPv4.csv --ipv6=./geoip/GeoLite2-Country-Blocks-IPv6.csv --ipv4CN=https://raw.githubusercontent.com/pexcn/daily/gh-pages/chnroute/chnroute.txt
|
||||
|
||||
- name: Download geosite project
|
||||
run: |
|
||||
@@ -70,11 +71,10 @@ jobs:
|
||||
- name: Get and add proxy domains into temp-proxy.txt file
|
||||
run: |
|
||||
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 $GFWLIST_EXTRAS_DOMAINS_URL | perl -ne 'print if not /^(#|\s)/' >> 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 $GREATFIRE_DOMAINS_MINE_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 $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
|
||||
@@ -83,9 +83,9 @@ jobs:
|
||||
|
||||
- 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
|
||||
curl -sSL $GEQ1AN_RULES_REJECT_URL | awk -F ',' '/^(HOST|DOMAIN)(,|\-SUFFIX,).+AdBlock/ {print $2}' >> temp-reject.txt
|
||||
curl -sSL $GEQ1AN_RULES_REJECT_URL | awk -F ',' '/^(HOST|DOMAIN)(,|\-SUFFIX,).+AdBlock/ {print $2}' > temp-reject.txt
|
||||
curl -sSL $LHIE1_RULES_REJECT_URL | awk -F ',' '/^DOMAIN(,|\-SUFFIX,).+/ {print $2}' >> temp-reject.txt
|
||||
curl -sSL $ADAWAY_REJECT_URL | grep "127.0.0.1" | sed '1d' | awk '{print $2}' >> temp-reject.txt
|
||||
|
||||
- name: Add proxy, direct and reject domains from "hidden" branch to appropriate temp files
|
||||
run: |
|
||||
@@ -96,11 +96,11 @@ jobs:
|
||||
- name: Sort and generate redundant lists
|
||||
run: |
|
||||
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"' > proxy-list-with-redundant
|
||||
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
|
||||
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"' > direct-list-with-redundant
|
||||
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
|
||||
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"' > reject-list-with-redundant
|
||||
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
|
||||
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: Remove redundant domains
|
||||
run: |
|
||||
@@ -120,29 +120,37 @@ jobs:
|
||||
|
||||
- name: Remove domains from "need-to-remove" lists in "hidden" branch and remove domains end with ".cn" in proxy-list
|
||||
run: |
|
||||
diff ./direct-need-to-remove.txt ./direct-list-without-redundant | awk '/^>/{print $2}' > $GOPATH/src/$GEOSITE_REPO/data/direct-list
|
||||
diff ./proxy-need-to-remove.txt ./proxy-list-without-redundant | awk '/^>/{print $2}' | perl -ne 'print if not /\.cn$/' > $GOPATH/src/$GEOSITE_REPO/data/proxy-list
|
||||
diff ./reject-need-to-remove.txt ./reject-list-without-redundant | awk '/^>/{print $2}' > $GOPATH/src/$GEOSITE_REPO/data/reject-list
|
||||
diff ./direct-need-to-remove.txt ./direct-list-without-redundant | awk '/^>/{print $2}' > $GOPATH/src/$GEOSITE_REPO/data/direct-list.txt
|
||||
diff ./proxy-need-to-remove.txt ./proxy-list-without-redundant | awk '/^>/{print $2}' | perl -ne 'print if not /\.cn$/' > $GOPATH/src/$GEOSITE_REPO/data/proxy-list.txt
|
||||
diff ./reject-need-to-remove.txt ./reject-list-without-redundant | awk '/^>/{print $2}' > $GOPATH/src/$GEOSITE_REPO/data/reject-list.txt
|
||||
|
||||
- name: Add list into appropriate category file
|
||||
run: |
|
||||
cd $GOPATH/src/$GEOSITE_REPO/data
|
||||
echo "include:proxy-list" >> geolocation-\!cn
|
||||
echo "include:direct-list" >> cn
|
||||
echo "include:reject-list" >> category-ads-all
|
||||
echo "include:proxy-list.txt" >> geolocation-\!cn
|
||||
echo "include:direct-list.txt" >> cn
|
||||
echo "include:reject-list.txt" >> category-ads-all
|
||||
|
||||
- name: Add `google-cn` and `apple-cn` sub-lists for custom routing settings for third-party users due to accessibility in China mainland
|
||||
run: |
|
||||
curl -sSL $GOOGLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' > $GOPATH/src/$GEOSITE_REPO/data/google-cn
|
||||
curl -sSL $APPLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' > $GOPATH/src/$GEOSITE_REPO/data/apple-cn
|
||||
|
||||
- name: Build geosite.dat file
|
||||
run: |
|
||||
domain-list-community
|
||||
mv ./dlc.dat ./publish/geosite.dat
|
||||
mv ./*-excluse-list ./publish/
|
||||
cp -f $GOPATH/src/$GEOSITE_REPO/data/{proxy,direct,reject}-list ./publish/
|
||||
domain-list-community --datapath=${{ env.GOPATH }}/src/${{ env.GEOSITE_REPO }}/data
|
||||
|
||||
- name: Generate dat files sha256 hash
|
||||
- name: Move and zip files and generate sha256 hash
|
||||
run: |
|
||||
install -Dp geoip.dat ./publish/geoip.dat
|
||||
install -Dp dlc.dat ./publish/geosite.dat
|
||||
install -p {proxy,direct,reject}-excluse-list.txt ./publish/
|
||||
install -p $GOPATH/src/$GEOSITE_REPO/data/{proxy,direct,reject}-list.txt ./publish/
|
||||
cd ./publish
|
||||
zip rules.zip {proxy,direct,reject}-list.txt geoip.dat geosite.dat
|
||||
sha256sum geoip.dat > geoip.dat.sha256sum
|
||||
sha256sum geosite.dat > geosite.dat.sha256sum
|
||||
sha256sum rules.zip > rules.zip.sha256sum
|
||||
|
||||
- name: Release and upload assets
|
||||
uses: softprops/action-gh-release@v1
|
||||
@@ -160,8 +168,8 @@ jobs:
|
||||
run: |
|
||||
cd publish
|
||||
git init
|
||||
git config --local user.name "${{ github.actor }}"
|
||||
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
|
||||
git config --local user.name "actions"
|
||||
git config --local user.email "action@github.com"
|
||||
git checkout -b release
|
||||
git add .
|
||||
git commit -m "${{ env.RELEASE_NAME }}"
|
||||
|
||||
110
README.md
110
README.md
@@ -1,6 +1,6 @@
|
||||
# 简介
|
||||
|
||||
**V2Ray** 规则文件加强版,可代替 V2Ray 官方 `geoip.dat` 和 `geosite.dat` 规则文件。利用 GitHub Actions 北京时间每天早上 6 点自动构建,保证规则最新。
|
||||
**V2Ray** 路由规则文件加强版,可代替 V2Ray 官方 `geoip.dat` 和 `geosite.dat` 规则文件。利用 GitHub Actions 北京时间每天早上 6 点自动构建,保证规则最新。
|
||||
|
||||
## 说明
|
||||
|
||||
@@ -11,18 +11,20 @@
|
||||
### geoip.dat
|
||||
|
||||
- 通过仓库 [@Loyalsoldier/geoip](https://github.com/Loyalsoldier/geoip) 生成
|
||||
- 其中全球 IP 地址(IPv4 和 IPv6)来源于 [MaxMind GeoLite2](https://dev.maxmind.com/geoip/geoip2/geolite2/),`CN`(中国大陆)类别下的 IPv4 地址来源于 [@17mon/china_ip_list](https://github.com/17mon/china_ip_list/blob/master/china_ip_list.txt)
|
||||
- 其中全球 IP 地址(IPv4 和 IPv6)来源于 [MaxMind GeoLite2](https://dev.maxmind.com/geoip/geoip2/geolite2/),`CN`(中国大陆)类别下的 IPv4 地址来源于 [@pexcn/chnroute.txt](https://github.com/pexcn/daily/blob/gh-pages/chnroute/chnroute.txt)
|
||||
|
||||
### geosite.dat
|
||||
|
||||
- 通过仓库 [@v2ray/domain-list-community](https://github.com/v2ray/domain-list-community) 生成
|
||||
- 通过仓库 [@v2fly/domain-list-community](https://github.com/v2fly/domain-list-community) 生成
|
||||
- **加入大量中国大陆域名、Apple 域名和 Google 域名**:
|
||||
- [@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/apple.china.conf](https://github.com/felixonmars/dnsmasq-china-list/blob/master/apple.china.conf) 加入到 `geosite:geolocation-!cn` 类别中(如希望本文件中的 Apple 域名直连,请参考下面 [geosite 的 Routing 配置方式](https://github.com/Loyalsoldier/v2ray-rules-dat#geositedat-1))
|
||||
- [@felixonmars/dnsmasq-china-list/google.china.conf](https://github.com/felixonmars/dnsmasq-china-list/blob/master/google.china.conf) 加入到 `geosite:geolocation-!cn` 类别中(如希望本文件中的 Google 域名直连,请参考下面 [geosite 的 Routing 配置方式](https://github.com/Loyalsoldier/v2ray-rules-dat#geositedat-1))
|
||||
- **加入最新 GFWList 域名**:通过仓库 [@cokebar/gfwlist2dnsmasq](https://github.com/cokebar/gfwlist2dnsmasq) 生成并加入到 `geosite:geolocation-!cn` 类别中
|
||||
- **加入 Greatfire Analyzer 检测到的屏蔽域名**:通过仓库 [@wongsyrone/domain-block-list](https://github.com/wongsyrone/domain-block-list) 和 [@Loyalsoldier/cn-blocked-domain](https://github.com/Loyalsoldier/cn-blocked-domain) 获取 [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` 类别中
|
||||
- **加入附加 GFWList 域名**:通过仓库 [@pexcn/gfwlist-extras](https://github.com/pexcn/gfwlist-extras) 获取并加入到 `geosite:geolocation-!cn` 类别中
|
||||
- **加入 Greatfire Analyzer 检测到的屏蔽域名**:通过仓库 [@Loyalsoldier/cn-blocked-domain](https://github.com/Loyalsoldier/cn-blocked-domain) 获取 [Greatfire Analyzer](https://zh.greatfire.org/analyzer) 检测到的屏蔽域名,并加入到 `geosite:geolocation-!cn` 类别中
|
||||
- **加入 AdAway 广告域名**:通过仓库 [@AdAway/adaway.github.io/hosts.txt](https://github.com/AdAway/adaway.github.io/blob/master/hosts.txt) 获取并加入到 `geosite:category-ads-all` 类别中
|
||||
- **加入更多代理域名和广告域名**:通过仓库 [@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` 类别中
|
||||
- **可添加自定义直连、代理和广告域名**:由于上游域名列表更新缓慢或缺失某些域名,所以引入**需要添加的域名**列表。[`hidden 分支`](https://github.com/Loyalsoldier/v2ray-rules-dat/tree/hidden)里的三个文件 `direct.txt`、`proxy.txt` 和 `reject.txt`,分别存放自定义的需要添加的直连、代理、广告域名,最终分别加入到 `geosite:cn`、`geosite:geolocation-!cn` 和 `geosite:category-ads-all` 类别中
|
||||
- **可移除自定义直连、代理和广告域名**:由于上游域名列表存在需要被移除的域名,所以引入**需要移除的域名**列表。[`hidden 分支`](https://github.com/Loyalsoldier/v2ray-rules-dat/tree/hidden)里的三个文件 `direct-need-to-remove.txt`、`proxy-need-to-remove.txt` 和 `reject-need-to-remove.txt`,分别存放自定义的需要从 `direct-list`(直连域名列表)、`proxy-list`(代理域名列表)和 `reject-list`(广告域名列表) 移除的域名
|
||||
|
||||
@@ -32,9 +34,21 @@
|
||||
|
||||
- **geoip.dat**:[https://github.com/Loyalsoldier/v2ray-rules-dat/raw/release/geoip.dat](https://github.com/Loyalsoldier/v2ray-rules-dat/raw/release/geoip.dat)
|
||||
- **geosite.dat**:[https://github.com/Loyalsoldier/v2ray-rules-dat/raw/release/geosite.dat](https://github.com/Loyalsoldier/v2ray-rules-dat/raw/release/geosite.dat)
|
||||
- **直连域名列表 direct-list.txt**:[https://github.com/Loyalsoldier/v2ray-rules-dat/raw/release/direct-list.txt](https://github.com/Loyalsoldier/v2ray-rules-dat/raw/release/direct-list.txt)
|
||||
- **代理域名列表 proxy-list.txt**:[https://github.com/Loyalsoldier/v2ray-rules-dat/raw/release/proxy-list.txt](https://github.com/Loyalsoldier/v2ray-rules-dat/raw/release/proxy-list.txt)
|
||||
- **广告域名列表 reject-list.txt**:[https://github.com/Loyalsoldier/v2ray-rules-dat/raw/release/reject-list.txt](https://github.com/Loyalsoldier/v2ray-rules-dat/raw/release/reject-list.txt)
|
||||
|
||||
**使用方式**:
|
||||
|
||||
Windows 用户可通过 [Scoop](https://scoop.sh) 来安装:
|
||||
|
||||
```shell
|
||||
scoop bucket add v2ray https://github.com/kidonng/scoop-v2ray
|
||||
scoop install v2ray-rules-dat
|
||||
```
|
||||
|
||||
非 Windows 用户:
|
||||
|
||||
1. 点击上面下载地址,下载 `geoip.dat` 和 `geosite.dat`
|
||||
2. 把下载下来的 `geoip.dat` 和 `geosite.dat` 文件放入到 V2Ray 的规则文件目录,替换掉原来的 `geoip.dat` 和 `geosite.dat`
|
||||
3. 修改 V2Ray 配置文件,配置参考下面 👇👇👇
|
||||
@@ -54,9 +68,25 @@
|
||||
"type": "field",
|
||||
"outboundTag": "Direct",
|
||||
"ip": [
|
||||
"223.5.5.5/32",
|
||||
"119.29.29.29/32",
|
||||
"180.76.76.76/32",
|
||||
"114.114.114.114/32",
|
||||
"geoip:cn",
|
||||
"geoip:private"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "Proxy",
|
||||
"ip": [
|
||||
"1.1.1.1/32",
|
||||
"1.0.0.1/32",
|
||||
"8.8.8.8/32",
|
||||
"8.8.4.4/32",
|
||||
"geoip:us",
|
||||
"geoip:ca"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -64,7 +94,7 @@
|
||||
|
||||
### geosite.dat
|
||||
|
||||
跟 V2Ray 官方 `geosite.dat` 配置方式相同。
|
||||
跟 V2Ray 官方 `geosite.dat` 配置方式相同。`geosite:apple-cn` 和 `geosite:google-cn` 为本项目特有的两个类别,分别包含 [@felixonmars/dnsmasq-china-list/apple.china.conf](https://github.com/felixonmars/dnsmasq-china-list/blob/master/apple.china.conf) 和 [@felixonmars/dnsmasq-china-list/google.china.conf](https://github.com/felixonmars/dnsmasq-china-list/blob/master/google.china.conf) 文件里的域名,供希望 Apple 和 Google 域名直连(不走代理)的用户使用。在 Routing 配置中,类别越靠前(上),优先级越高,所以 `geosite:apple-cn` 和 `geosite:google-cn` 要放置在 `geosite:geolocation-!cn` 前(上)面。配置参考下面 👇👇👇
|
||||
|
||||
**Routing 配置方式**:
|
||||
|
||||
@@ -78,6 +108,17 @@
|
||||
"geosite:category-ads-all"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "Direct",
|
||||
"domain": [
|
||||
"geosite:apple-cn",
|
||||
"geosite:google-cn",
|
||||
"geosite:tld-cn",
|
||||
"domain:icloud.com",
|
||||
"domain:icloud-content.com"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "Proxy",
|
||||
@@ -101,13 +142,6 @@
|
||||
```json
|
||||
"dns": {
|
||||
"servers": [
|
||||
{
|
||||
"address": "1.1.1.1",
|
||||
"port": 53,
|
||||
"domains": [
|
||||
"geosite:geolocation-!cn"
|
||||
]
|
||||
},
|
||||
{
|
||||
"address": "114.114.114.114",
|
||||
"port": 53,
|
||||
@@ -115,8 +149,15 @@
|
||||
"geosite:cn"
|
||||
]
|
||||
},
|
||||
"8.8.8.8",
|
||||
"223.5.5.5"
|
||||
{
|
||||
"address": "1.1.1.1",
|
||||
"port": 53,
|
||||
"domains": [
|
||||
"geosite:geolocation-!cn"
|
||||
]
|
||||
},
|
||||
"223.5.5.5",
|
||||
"8.8.8.8"
|
||||
]
|
||||
}
|
||||
```
|
||||
@@ -125,7 +166,7 @@
|
||||
|
||||
下面为自用 V2Ray 客户端完整配置,注意事项:
|
||||
|
||||
- 由于下面客户端配置使用了 DoH DNS 功能,所以必须使用 v4.22.0 或更新版本的 [V2Ray](https://github.com/v2ray/v2ray-core/releases)
|
||||
- 由于下面客户端配置使用了 DoH DNS 功能,所以必须使用 v4.22.0 或更新版本的 [V2Ray](https://github.com/v2fly/v2ray-core/releases)
|
||||
- 下面客户端配置使 V2Ray 在本机开启 SOCKS 代理(监听 1080 端口)和 HTTP 代理(监听 2080 端口)
|
||||
- BT 流量统统直连(实测依然会有部分 BT 流量走代理,尚不清楚是不是 V2Ray 的 bug。如果服务商禁止 BT 下载的话,请不要为下载软件设置代理)
|
||||
- 最后,不命中任何路由规则的请求和流量,统统走代理
|
||||
@@ -190,10 +231,10 @@
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
//下面这行,协议名称为socks、shadowsocks或vmess等(记得删除这行文字说明)
|
||||
"protocol": "协议名称",
|
||||
//下面这行,协议类别要改为socks、shadowsocks或vmess等(记得删除本行文字说明)
|
||||
"protocol": "协议类别",
|
||||
"settings": {},
|
||||
//下面这行,必须为Proxy,对应Routing里的outboundTag(记得删除这行文字说明)
|
||||
//下面这行,tag的值对应Routing里的outboundTag,这里为Proxy(记得删除本行文字说明)
|
||||
"tag": "Proxy",
|
||||
"streamSettings": {},
|
||||
"mux": {}
|
||||
@@ -220,7 +261,7 @@
|
||||
}
|
||||
],
|
||||
"routing": {
|
||||
"domainStrategy": "IPIfNonMatch",
|
||||
"domainStrategy": "AsIs",
|
||||
"rules": [
|
||||
{
|
||||
"type": "field",
|
||||
@@ -244,6 +285,13 @@
|
||||
"geosite:category-ads-all"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "Direct",
|
||||
"domain": [
|
||||
"geosite:tld-cn"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "Proxy",
|
||||
@@ -298,15 +346,23 @@
|
||||
|
||||
## 致谢
|
||||
|
||||
> This product includes GeoLite2 data created by MaxMind, available from [https://www.maxmind.com](https://www.maxmind.com).
|
||||
|
||||
- [MaxMind GeoLite2 Free IP Database](https://dev.maxmind.com/geoip/geoip2/geolite2/)
|
||||
- [@v2ray/geoip](https://github.com/v2ray/geoip)
|
||||
- [@v2ray/domain-list-community](https://github.com/v2ray/domain-list-community)
|
||||
- [@17mon/china_ip_list](https://github.com/17mon/china_ip_list/blob/master/china_ip_list.txt)
|
||||
- [@Loyalsoldier/geoip](https://github.com/Loyalsoldier/geoip)
|
||||
- [@v2fly/domain-list-community](https://github.com/v2fly/domain-list-community)
|
||||
- [@felixonmars/dnsmasq-china-list](https://github.com/felixonmars/dnsmasq-china-list)
|
||||
- [@gfwlist/gfwlist](https://github.com/gfwlist/gfwlist)
|
||||
- [@pexcn/gfwlist-extras](https://github.com/pexcn/gfwlist-extras)
|
||||
- [@cokebar/gfwlist2dnsmasq](https://github.com/cokebar/gfwlist2dnsmasq)
|
||||
- [@Loyalsoldier/cn-blocked-domain](https://github.com/Loyalsoldier/cn-blocked-domain)
|
||||
- [@wongsyrone/domain-block-list](https://github.com/wongsyrone/domain-block-list)
|
||||
- [@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)
|
||||
- [MaxMind GeoLite2 Free IP Database](https://dev.maxmind.com/geoip/geoip2/geolite2/)
|
||||
- [@pexcn/daily/chnroute.txt](https://github.com/pexcn/daily/blob/gh-pages/chnroute/chnroute.txt)
|
||||
- [@AdAway/adaway.github.io/hosts.txt](https://github.com/AdAway/adaway.github.io/blob/master/hosts.txt)
|
||||
- [@kidonng/scoop-v2ray](https://github.com/kidonng/scoop-v2ray)
|
||||
|
||||
## 项目 Star 数增长趋势
|
||||
|
||||
[](https://starchart.cc/Loyalsoldier/v2ray-rules-dat)
|
||||
|
||||
Reference in New Issue
Block a user