Compare commits

...

48 Commits

Author SHA1 Message Date
Loyalsoldier
749e420c3f Release all domain lists 2020-01-12 02:11:39 +08:00
Loyalsoldier
6fb2569a68 Update description 2020-01-10 17:05:54 +08:00
loyalsoldier
7230e8cffc Try to fix regex rules 2020-01-10 16:34:59 +08:00
loyalsoldier
a9b458de22 Fix regexp validating domains rules 2020-01-10 16:23:09 +08:00
loyalsoldier
b080e37d6e Fix regexp validating rules 2020-01-10 16:16:17 +08:00
loyalsoldier
ee6546bc2a Validate domains 2020-01-10 16:10:06 +08:00
loyalsoldier
588b482047 Include GeQ1an/Rules domain rules 2020-01-10 14:15:44 +08:00
loyalsoldier
306fc08df1 Refine workflow 2020-01-10 13:22:40 +08:00
loyalsoldier
c65313fd83 Include @lhie1/Rules proxied and rejected domains 2020-01-10 11:52:39 +08:00
loyalsoldier
4ef01bc102 Revert "Add rejected domains from @StevenBlack/hosts" 2020-01-09 23:24:52 +08:00
loyalsoldier
b7eb8202da Revert "Add description"
This reverts commit b735c06461.
2020-01-09 23:23:52 +08:00
Loyalsoldier
b735c06461 Add description 2020-01-09 20:46:07 +08:00
loyalsoldier
5124b0d821 Add rejected domains from @StevenBlack/hosts 2020-01-09 19:17:06 +08:00
loyalsoldier
72906569ad Change variables names 2020-01-09 19:00:24 +08:00
Loyalsoldier
7156a11754 Remove advantages from README.md 2020-01-02 06:26:11 +08:00
Loyalsoldier
f5451027e9 Delete geoip.dat 2019-12-31 23:42:50 +08:00
Loyalsoldier
5af129797e Fix curl URL path 2019-12-31 23:40:04 +08:00
Loyalsoldier
5958c2493c Delete test.yml 2019-12-31 23:38:39 +08:00
Loyalsoldier
eb61e68d38 Test 2019-12-31 23:36:46 +08:00
Loyalsoldier
cadd037384 Test 2019-12-31 23:28:12 +08:00
Loyalsoldier
e2ae2400b4 Create test.yml 2019-12-31 23:18:51 +08:00
Loyalsoldier
2168f18cac Test 2019-12-31 22:43:56 +08:00
Loyalsoldier
21f766dc39 Update for new GeoLite2 policy 2019-12-31 22:39:50 +08:00
Loyalsoldier
4e4ef7bd85 Just copy geoip.dat from repo temporarily 2019-12-31 03:28:59 +08:00
Loyalsoldier
d9620ae732 Add geoip.dat for temporarily usage
Add geoip.dat due to GeoLite2 restriction
2019-12-31 03:24:13 +08:00
Loyalsoldier
d07c21c7eb Add Thanks section 2019-12-31 02:33:59 +08:00
Loyalsoldier
db68429e18 Update build.yml
Refine
2019-12-31 02:27:18 +08:00
Loyalsoldier
4923596b20 Fix typo 2019-12-28 23:04:21 +08:00
Loyalsoldier
bd7139d162 Update README.md 2019-12-28 22:57:44 +08:00
Loyalsoldier
61a8ee2ffb Update build.yml 2019-12-24 01:25:05 +08:00
Loyalsoldier
64a26fcddc Fixed regex to remove DOMAIN-KEYWORD rules 2019-12-24 01:15:56 +08:00
Loyalsoldier
fc3bebe736 Update build.yml 2019-12-23 21:39:20 +08:00
Loyalsoldier
1c6f0fa3a9 Update README.md 2019-12-23 21:33:58 +08:00
Loyalsoldier
e2b975cda1 Update README.md 2019-12-23 21:21:52 +08:00
loyalsoldier
b2793662b8 Add support for custom domains 2019-12-23 20:42:11 +08:00
loyalsoldier
dfd0c980ef Delete test.yml 2019-12-23 19:28:24 +08:00
loyalsoldier
c13336200f Test 2019-12-23 19:24:25 +08:00
loyalsoldier
10fd8faee8 Test 2019-12-23 19:20:48 +08:00
loyalsoldier
080d51e91c Test 2019-12-23 19:16:40 +08:00
loyalsoldier
c314c2dd1d test the default directory 2019-12-23 18:36:07 +08:00
Loyalsoldier
8291a04cdc Update build.yml
change the time of auto-run build
2019-12-22 22:09:23 +08:00
Loyalsoldier
64dbf736cb fixed google and apple rules 2019-12-15 19:13:40 +08:00
Loyalsoldier
7ed56de602 Update README.md 2019-12-15 18:39:10 +08:00
Loyalsoldier
2f065c5b37 fixed include commands 2019-12-15 18:25:24 +08:00
Loyalsoldier
58b06a5887 fixed color output 2019-12-15 18:18:45 +08:00
Loyalsoldier
9ad5f9fd0d Remove repeat domains 2019-12-15 18:14:44 +08:00
Loyalsoldier
8888445e2e Add @wongsyrone domain-block-list description 2019-12-15 16:25:51 +08:00
Loyalsoldier
4943b40560 Add blocked domains
Add blocked domains from @wongsyrone domain-block-list
2019-12-15 16:11:57 +08:00
2 changed files with 98 additions and 85 deletions

View File

@@ -1,10 +1,10 @@
name: Build v2ray rules dat files
on:
schedule:
- cron: "0 19 * * *"
- cron: "0 22 * * *"
push:
branches:
- master
- master
jobs:
build:
@@ -12,28 +12,42 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
- name: Setup Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
- name: Set GOPATH
- name: Set $GOPATH and more variables
run: |
echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)"
echo "::set-env name=GREEN::\033[0;32m"
echo "::set-env name=NC::\033[0m"
echo "::set-env name=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/v2ray/geoip"
echo "::set-env name=GEOSITE_REPO::github.com/v2ray/domain-list-community"
echo "::set-env name=GFWLIST_URL::https://cokebar.github.io/gfwlist2dnsmasq/gfwlist_domain.txt"
echo "::set-env name=Profiles_URL::https://raw.githubusercontent.com/ConnersHua/Profiles/master/Shadow/Pro.conf"
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=PROFILES_URL::https://raw.githubusercontent.com/ConnersHua/Profiles/master/Shadow/Pro.conf"
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/Microsoft.list"
echo "::set-env name=GEQ1AN_RULES_GLOBAL_MEDIA_URL::https://raw.githubusercontent.com/GeQ1an/Rules/master/QuantumultX/Filter/GMedia.list"
echo "::set-env name=GEQ1AN_RULES_OUTSIDE_URL::https://raw.githubusercontent.com/GeQ1an/Rules/master/QuantumultX/Filter/Outside.list"
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_REJECT_URL::https://raw.githubusercontent.com/lhie1/Rules/master/Auto/REJECT.conf"
echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)"
echo "::add-path::$(dirname $GITHUB_WORKSPACE)/bin"
shell: bash
- name: Get GeoLite2
- name: Checkout branch named hidden of this repo
uses: actions/checkout@v2
with:
ref: hidden
- name: Get GeoLite2 file
run: |
curl -sSL -O https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip
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
rm -f GeoLite2-Country-CSV.zip
mv GeoLite2* geoip
@@ -49,86 +63,64 @@ jobs:
run: |
go get -u -v -insecure $GEOSITE_REPO
- name: Get and add gfwlist into geolocation-!cn
- name: Get and add direct domains into temp-direct.txt file
run: |
cd $GOPATH/src/$GEOSITE_REPO/data
curl -sSL $GFWLIST_URL > gfwlist
echo "include:gfwlist" >> geolocation-\!cn
curl -sSL $CHINA_DOMAINS_URL | awk -F '/' '{print $2}' > temp-direct.txt
- name: Get and add proxy domains from @ConnersHua/Profiles into geolocation-!cn
- name: Get and add proxy domains into temp-proxy.txt file
run: |
cd $GOPATH/src/$GEOSITE_REPO/data
curl -sSL $Profiles_URL | awk '/^DOMAIN.+PROXY/' | cut -d ',' -f 2 > profileproxy
echo "include:profileproxy" >> geolocation-\!cn
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 $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
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,).+REJECT/ {print $2}' >> temp-reject.txt
- name: Get and add direct domains from @ConnersHua/Profiles into cn
- name: Add proxy and direct domains from "hidden" branch to appropriate temp files
run: |
cd $GOPATH/src/$GEOSITE_REPO/data
curl -sSL $Profiles_URL | awk '/^DOMAIN.+DIRECT/' | cut -d ',' -f 2 > profiledirect
echo "include:profiledirect" >> cn
cat proxy.txt >> temp-proxy.txt
cat direct.txt >> temp-direct.txt
- name: Get and add chinalist into cn
- name: Remove repeated domains, sort domains and write domains to appropriate list
run: |
cd $GOPATH/src/$GEOSITE_REPO/data
curl -sSL $CHINA_DOMAINS_URL | awk -F '/' '{print $2}' > chinalist
echo "include:chinalist" >> cn
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: Get and add reject domains from @ConnersHua/Profiles into category-ads-all
- 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
- name: Add list into appropriate category file
run: |
cd $GOPATH/src/$GEOSITE_REPO/data
curl -sSL $Profiles_URL | awk '/^DOMAIN.+REJECT/' | cut -d ',' -f 2 > profilereject
echo "include:profilereject" >> category-ads-all
echo "include:proxylist" >> geolocation-\!cn
echo "include:directlist" >> cn
echo "include:rejectlist" >> category-ads-all
- name: Build geosite.dat file
run: |
domain-list-community
mv ./dlc.dat ./publish/geosite.dat
- name: List above process results
run: |
echo ">>>>>>>>>>>>>>>>>>>>>>>>"
echo "list files in data folder"
ls -lah $GOPATH/src/$GEOSITE_REPO/data
echo ">>>>>>>>>>>>>>>>>>>>>>>>"
echo "list last 10 lines of cn file"
tail -n 10 $GOPATH/src/$GEOSITE_REPO/data/cn
echo ">>>>>>>>>>>>>>>>>>>>>>>>"
echo "list last 10 lines of geolocation-!cn file"
tail -n 10 $GOPATH/src/$GEOSITE_REPO/data/geolocation-\!cn
echo ">>>>>>>>>>>>>>>>>>>>>>>>"
echo "list last 10 lines of category-ads-all file"
tail -n 10 $GOPATH/src/$GEOSITE_REPO/data/category-ads-all
echo ">>>>>>>>>>>>>>>>>>>>>>>>"
echo "list files in publish folder"
ls -lah ./publish
echo ">>>>>>>>>>>>>>>>>>>>>>>>"
echo -e "${GREEN}完成啦!🌈${NC}"
- name: Set release variables
run: |
echo "::set-env name=NAME::Released on $(date +%Y%m%d%H%M)"
echo "::set-env name=TAG_NAME::$(date +%Y%m%d%H%M)"
mv ./*-filter.txt ./publish/
cp -f $GOPATH/src/$GEOSITE_REPO/data/{proxy,direct,reject}list ./publish/
- name: Release dat files
uses: Ricky-Hao/action-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ASSET_PATH: publish
- name: Upload dat files
uses: actions/upload-artifact@master
if: success()
with:
name: dat_files
path: publish

View File

@@ -1,6 +1,6 @@
# 简介
**v2ray** 加强版规则文件,可代替 v2ray 官方 `geoip.dat``geosite.dat` 文件。利用 GitHub Actions 每天自动构建,保证最新。
**v2ray** 加强版规则文件,可代替 v2ray 官方 `geoip.dat``geosite.dat` 规则文件。利用 GitHub Actions 北京时间每天早上 6 点自动构建,保证规则最新。
## 规则文件生成方式
@@ -8,27 +8,36 @@
- 通过仓库 [@v2ray/geoip](https://github.com/v2ray/geoip) 生成
- 其中 IP 地址来源于 [MaxMind 免费 IP](https://dev.maxmind.com/geoip/geoip2/geolite2/)
- **优点**:由于项目每天自动构建,所以更新速度比官方 `geoip.dat` 要快得多
### geosite.dat
- 通过仓库 [@v2ray/domain-list-community](https://github.com/v2ray/domain-list-community) 生成
- **优点**:由于项目每天自动构建,所以更新速度比官方 `geosite.dat` 要快得多
- **加入大量中国大陆域名**:通过仓库 [@felixonmars/dnsmasq-china-list](https://github.com/felixonmars/dnsmasq-china-list) 生成 `chinalist` 类别域名并加入到 `geosite:cn` 类别中
- **加入最新 GFWList**:通过仓库 [@cokebar/gfwlist2dnsmasq](https://github.com/cokebar/gfwlist2dnsmasq) 生成 `gfwlist` 类别域名并加入到 `geosite:geolocation-!cn` 类别中
- **加入更多直连、代理、广告域名**:通过仓库 [@ConnersHua/Profiles](https://github.com/ConnersHua/Profiles/tree/master) 获取更多直连、代理、广告域名,并分别加入到 `geosite:cn``geosite:geolocation-!cn``geosite:category-ads-all` 类别中
- **加入大量中国大陆域名**:通过仓库 [@felixonmars/dnsmasq-china-list](https://github.com/felixonmars/dnsmasq-china-list) 生成并加入到 `geosite: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` 类别中
- **加入自定义直连和代理域名**:由于上游域名列表更新缓慢或缺失某些被屏蔽的域名,所以引入自定义域名列表,主要为了解决在 DNS 解析 `A``AAAA` 记录时的 DNS 泄漏问题。[`hidden` 分支](https://github.com/Loyalsoldier/v2ray-rules-dat/tree/hidden)里有两个文件 `direct.txt``proxy.txt`,分别放置自定义的直连、代理域名,最终分别加入到 `geosite:cn``geosite:geolocation-!cn` 类别中
## 使用方式
## 规则文件下载及使用方式
1. [点击进入规则文件发布页面](https://github.com/Loyalsoldier/v2ray-rules-dat/releases),点击下载位于最上方的 `geoip.dat``geosite.dat`
**下载地址**
- **geoip.dat**[https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat](https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat)
- **geosite.dat**[https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat](https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat)
**使用方式**
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 配置文件配置参考下面👇
3. 修改 v2ray 配置文件配置参考下面 👇👇👇
## 参考配置
### geoip.dat
跟 v2ray 官方 `geoip.dat` 配置方式相同。
Routing 配置方式:
**Routing 配置方式**
```json
{
@@ -51,7 +60,7 @@ Routing 配置方式:
跟 v2ray 官方 `geosite.dat` 配置方式相同。
Routing 配置方式:
**Routing 配置方式**
```json
{
@@ -83,7 +92,7 @@ Routing 配置方式:
}
```
DNS 配置方式:
**DNS 配置方式**
```json
{
@@ -109,3 +118,15 @@ DNS 配置方式:
}
}
```
## 致谢
- [@v2ray/geoip](https://github.com/v2ray/geoip)
- [@v2ray/domain-list-community](https://github.com/v2ray/domain-list-community)
- [@felixonmars/dnsmasq-china-list](https://github.com/felixonmars/dnsmasq-china-list)
- [@cokebar/gfwlist2dnsmasq](https://github.com/cokebar/gfwlist2dnsmasq)
- [@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 免费 IP](https://dev.maxmind.com/geoip/geoip2/geolite2/)