Compare commits

...

19 Commits

Author SHA1 Message Date
Loyalsoldier
4ad108cc03 Docs: remove donation section 2022-08-30 21:05:18 +08:00
Loyalsoldier
a42e1fc7eb Revert "Feat: deprecate jsDelivr links"
This reverts commit 89dc99780a.
2022-08-30 21:03:20 +08:00
Loyalsoldier
89dc99780a Feat: deprecate jsDelivr links 2022-05-21 10:50:17 +08:00
Loyalsoldier
6a45361741 Feat: remove @pexcn/gfwlist-extras due to inactivity 2022-05-21 10:48:35 +08:00
dependabot[bot]
c6b6ce1b55 Chore: bump actions/setup-go from 2 to 3 (#193) 2022-04-11 11:52:42 +08:00
Loyalsoldier
7a937e7cf3 CI: use Go v1.18 2022-03-25 17:09:19 +08:00
Kid
f6a48e35eb Fix: remove lhie1/Rules repository due to inaccessibility (#183)
* Remove inaccessible lhie1/Rules repository
* Remove lhie1/Rules from README
* Actually remove download command
* Clean more
2022-03-03 22:08:16 +08:00
dependabot[bot]
1728a3bf05 Chore: bump actions/checkout from 2 to 3 (#182) 2022-03-02 16:35:46 +08:00
Loyalsoldier
467b44b760 README: add donation info 2021-10-16 11:09:44 +08:00
Loyalsoldier
49289a0a3c README: update appended geoip lists 2021-09-18 10:04:48 +08:00
Loyalsoldier
106d799bf3 README: update blacklist mode configuration 2021-09-18 10:02:24 +08:00
loyalsoldier
1971d7a499 Workflow: purge CDN after a new release 2021-08-28 19:34:40 +08:00
loyalsoldier
012a6308ee Fix: degrade to fix upload 2021-08-09 00:59:19 +08:00
loyalsoldier
12e336e982 README: add geoip:facebook 2021-08-08 14:09:15 +08:00
Loyalsoldier
03d4e100dc README: add geoip:netflix 2021-07-05 02:20:03 +08:00
loyalsoldier
1aaa2c3955 Add geoip:fastly & geoip:cloudfront lists 2021-06-21 14:51:56 +08:00
Loyalsoldier
41248053f3 Add geoip:cloudflare list 2021-06-02 18:16:57 +08:00
loyalsoldier
2ed2fba720 Feat: generate gfwlist manually 2021-04-21 17:19:21 +08:00
loyalsoldier
6961566065 Update config examples 2021-04-20 17:27:55 +08:00
2 changed files with 92 additions and 91 deletions

View File

@@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup Go 1.x.y
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ^1.16
go-version: ^1.18
- name: Set variables
run: |
@@ -24,10 +24,7 @@ jobs:
echo "CHINA_DOMAINS_URL=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf" >> $GITHUB_ENV
echo "GOOGLE_DOMAINS_URL=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/google.china.conf" >> $GITHUB_ENV
echo "APPLE_DOMAINS_URL=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf" >> $GITHUB_ENV
echo "GFWLIST_DOMAINS_URL=https://cokebar.github.io/gfwlist2dnsmasq/gfwlist_domain.txt" >> $GITHUB_ENV
echo "GFWLIST_EXTRAS_DOMAINS_URL=https://raw.githubusercontent.com/pexcn/gfwlist-extras/master/gfwlist-extras.txt" >> $GITHUB_ENV
echo "GREATFIRE_DOMAINS_URL=https://raw.githubusercontent.com/Loyalsoldier/cn-blocked-domain/release/domains.txt" >> $GITHUB_ENV
echo "LHIE1_RULES_PROXY_URL=https://raw.githubusercontent.com/lhie1/Rules/master/Surge/Surge%203/Provider/Proxy.list" >> $GITHUB_ENV
echo "EASYLISTCHINA_EASYLIST_REJECT_URL=https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt" >> $GITHUB_ENV
echo "PETERLOWE_REJECT_URL=https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext" >> $GITHUB_ENV
echo "ADGUARD_DNS_REJECT_URL=https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt" >> $GITHUB_ENV
@@ -40,27 +37,39 @@ jobs:
shell: bash
- name: Checkout the "hidden" branch of this repo
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3
with:
ref: hidden
- name: Checkout Loyalsoldier/domain-list-custom
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3
with:
repository: Loyalsoldier/domain-list-custom
path: custom
- name: Checkout v2fly/domain-list-community
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3
with:
repository: v2fly/domain-list-community
path: community
- name: Checkout cokebar/gfwlist2dnsmasq
uses: actions/checkout@v3
with:
repository: cokebar/gfwlist2dnsmasq
path: gfwlist2dnsmasq
- name: Get geoip.dat relative files
run: |
wget https://github.com/Loyalsoldier/geoip/raw/release/geoip.dat
wget https://github.com/Loyalsoldier/geoip/raw/release/geoip.dat.sha256sum
- name: Generate GFWList domains
run: |
cd gfwlist2dnsmasq || exit 1
chmod +x ./gfwlist2dnsmasq.sh
./gfwlist2dnsmasq.sh -l -o ./temp-gfwlist.txt
- name: Get and add direct domains into temp-direct.txt file
run: |
curl -sSL $CHINA_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' > temp-direct.txt
@@ -68,12 +77,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
cat ./gfwlist2dnsmasq/temp-gfwlist.txt | 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 $LHIE1_RULES_PROXY_URL | awk -F ',' '/^(HOST|DOMAIN)(,|\-SUFFIX,).+/ {print $2}' >> temp-proxy.txt
curl -sSL ${CUSTOM_PROXY} | grep -Ev ":@cn" | perl -ne '/^(domain):([^:]+)(\n$|:@.+)/ && print "$2\n"' >> temp-proxy.txt
- name: Get and add reject domains into temp-reject.txt file
@@ -146,8 +153,7 @@ jobs:
curl -sSL $GOOGLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "full:$1\n"' > google-cn.txt
curl -sSL $APPLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "full:$1\n"' > ./community/data/apple-cn
curl -sSL $APPLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "full:$1\n"' > apple-cn.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"' >> ./community/data/gfw
curl -sSL $GFWLIST_EXTRAS_DOMAINS_URL | perl -ne 'print if not /^(#|\s)/' >> ./community/data/gfw
cat ./gfwlist2dnsmasq/temp-gfwlist.txt | 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"' >> ./community/data/gfw
cat ./community/data/gfw | sort --ignore-case -u > gfw.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"' >> ./community/data/greatfire
cat ./community/data/greatfire | sort --ignore-case -u > greatfire.txt
@@ -177,7 +183,7 @@ jobs:
sha256sum rules.zip > rules.zip.sha256sum
- name: Release and upload assets
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v0.1.6
with:
name: ${{ env.RELEASE_NAME }}
tag_name: ${{ env.TAG_NAME }}
@@ -199,3 +205,10 @@ jobs:
git commit -m "${{ env.RELEASE_NAME }}"
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
git push -f -u origin release
- name: Purge jsdelivr CDN
run: |
cd publish || exit 1
for file in $(ls); do
curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@release/${file}"
done

142
README.md
View File

@@ -8,7 +8,15 @@
- 通过仓库 [@Loyalsoldier/geoip](https://github.com/Loyalsoldier/geoip) 生成
- 其中全球 IP 地址IPv4 和 IPv6来源于 [MaxMind GeoLite2](https://dev.maxmind.com/geoip/geoip2/geolite2/)`CN`(中国大陆)类别下的 IPv4 地址来源于 [ipip.net](https://github.com/17mon/china_ip_list)
- 新增 `geoip:telegram` 类别方便黑名单模式用户使用
- 新增类别方便有特殊需求的用户使用
- `geoip:cloudflare`
- `geoip:cloudfront`
- `geoip:facebook`
- `geoip:fastly`
- `geoip:google`
- `geoip:netflix`
- `geoip:telegram`
- `geoip:twitter`
> 希望定制 `geoip.dat` 文件?查看仓库 [@Loyalsoldier/geoip](https://github.com/Loyalsoldier/geoip)。
@@ -20,7 +28,7 @@
- [@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 域名**
- 基于 [@gfwlist/gfwlist](https://github.com/gfwlist/gfwlist) 数据,通过仓库 [@cokebar/gfwlist2dnsmasq](https://github.com/cokebar/gfwlist2dnsmasq) 和 [@pexcn/gfwlist-extras](https://github.com/pexcn/gfwlist-extras) 生成
- 基于 [@gfwlist/gfwlist](https://github.com/gfwlist/gfwlist) 数据,通过仓库 [@cokebar/gfwlist2dnsmasq](https://github.com/cokebar/gfwlist2dnsmasq) 生成
- 加入到 `geosite:gfw` 类别中,供习惯于 PAC 模式并希望使用 [GFWList](https://github.com/gfwlist/gfwlist) 的用户使用
- 同时加入到 `geosite:geolocation-!cn` 类别中
- **加入 Greatfire Analyzer 检测到的屏蔽域名**
@@ -37,7 +45,6 @@
- [**慎用**] Windows 操作系统使用的系统升级域名 [@crazy-max/WindowsSpyBlocker/hosts/update.txt](https://github.com/crazy-max/WindowsSpyBlocker/blob/master/data/hosts/update.txt) 加入到 `geosite:win-update` 类别中
- [**慎用**] Windows 操作系统附加的隐私跟踪域名 [@crazy-max/WindowsSpyBlocker/hosts/extra.txt](https://github.com/crazy-max/WindowsSpyBlocker/blob/master/data/hosts/extra.txt) 加入到 `geosite:win-extra` 类别中
- 关于这三个类别的使用方式,请参考下面 [geosite 的 Routing 配置方式](https://github.com/Loyalsoldier/v2ray-rules-dat#geositedat-1)
- **加入更多代理域名**:通过仓库 [@lhie1/Rules](https://github.com/lhie1/Rules/tree/master) 获取更多代理域名,并加入到 `geosite:geolocation-!cn` 类别中
- **可添加自定义直连、代理和广告域名**:由于上游域名列表更新缓慢或缺失某些域名,所以引入**需要添加的域名**列表。[`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`(广告域名列表) 移除的域名
@@ -168,9 +175,7 @@ steamstatic.com.8686c.com @cn
{
"type": "field",
"outboundTag": "Reject",
"domain": [
"geosite:category-ads-all"
]
"domain": ["geosite:category-ads-all"]
},
{
"type": "field",
@@ -186,21 +191,17 @@ steamstatic.com.8686c.com @cn
{
"type": "field",
"outboundTag": "Proxy",
"domain": [
"geosite:geolocation-!cn"
]
"domain": ["geosite:geolocation-!cn"]
},
{
"type": "field",
"outboundTag": "Direct",
"domain": [
"geosite:cn"
]
"domain": ["geosite:cn"]
},
{
"type": "field",
"outboundTag": "Proxy",
"network": "tcp,udp"
"type": "field",
"outboundTag": "Proxy",
"network": "tcp,udp"
}
]
}
@@ -214,30 +215,22 @@ steamstatic.com.8686c.com @cn
{
"type": "field",
"outboundTag": "Reject",
"domain": [
"geosite:category-ads-all"
]
"domain": ["geosite:category-ads-all"]
},
{
"type": "field",
"outboundTag": "Proxy",
"domain": [
"geosite:tld-!cn",
"geosite:gfw",
"geosite:greatfire"
]
"domain": ["geosite:gfw", "geosite:greatfire"]
},
{
"type": "field",
"outboundTag": "Proxy",
"ip": [
"geoip:telegram"
]
"ip": ["geoip:telegram"]
},
{
"type": "field",
"outboundTag": "Direct",
"network": "tcp,udp"
"type": "field",
"outboundTag": "Direct",
"network": "tcp,udp"
}
]
}
@@ -247,26 +240,30 @@ steamstatic.com.8686c.com @cn
```json
"dns": {
"hosts": {
"dns.google": "8.8.8.8",
"dns.pub": "119.29.29.29",
"dns.alidns.com": "223.5.5.5",
"geosite:category-ads-all": "127.0.0.1"
},
"servers": [
{
"address": "https://1.1.1.1/dns-query",
"domains": ["geosite:geolocation-!cn"],
"expectIPs": ["geoip:!cn"]
},
"8.8.8.8",
{
"address": "114.114.114.114",
"port": 53,
"domains": [
"geosite:cn",
"geosite:category-games@cn"
],
"expectIPs": [
"geoip:cn"
]
"domains": ["geosite:cn", "geosite:category-games@cn"],
"expectIPs": ["geoip:cn"],
"skipFallback": true
},
{
"address": "https://1.1.1.1/dns-query",
"domains": [
"geosite:geolocation-!cn"
]
},
"https+local://223.5.5.5/dns-query",
"119.29.29.29"
"address": "localhost",
"skipFallback": true
}
]
}
```
@@ -275,9 +272,9 @@ steamstatic.com.8686c.com @cn
注意事项:
- 由于下面客户端配置使用了 DoH (DNS over HTTPS) 功能,所以必须使用 v4.22.0 或更新版本的 [V2Ray](https://github.com/v2fly/v2ray-core/releases)
- 由于下面客户端配置的 DNS 使用了 `skipFallback` 选项,所以必须使用 v4.37.2 或更新版本的 [V2Ray](https://github.com/v2fly/v2ray-core/releases)
- 下面客户端配置使 V2Ray 在本机开启 SOCKS 代理(监听 1080 端口)和 HTTP 代理(监听 2080 端口),允许局域网内其他设备连接并使用代理
- BT 流量统统直连(实测依然会有部分 BT 流量走代理,尚不清楚是不是 V2Ray 的 bug。如果服务商禁止 BT 下载的话,请不要为下载软件设置代理)
- BT 流量统统直连(实测依然会有部分 BT 流量走代理,如果服务商禁止 BT 下载,请不要为下载软件设置代理)
- 最后,不命中任何路由规则的请求和流量,统统走代理
- `outbounds` 里的第一个大括号内的配置,即为 V2Ray 代理服务的配置。请根据自身需求进行修改,并参照 V2Ray 官网配置文档中的 [配置 > Outbounds > OutboundObject](https://www.v2fly.org/config/outbounds.html#outboundobject) 部分进行补全
@@ -289,26 +286,31 @@ steamstatic.com.8686c.com @cn
"dns": {
"hosts": {
"dns.google": "8.8.8.8",
"doh.pub": "119.29.29.29"
"dns.pub": "119.29.29.29",
"dns.alidns.com": "223.5.5.5",
"geosite:category-ads-all": "127.0.0.1"
},
"servers": [
"https://dns.google/dns-query",
{
"address": "https+local://223.5.5.5/dns-query",
"address": "https://1.1.1.1/dns-query",
"domains": ["geosite:geolocation-!cn", "geosite:google@cn"],
"expectIPs": ["geoip:!cn"]
},
"8.8.8.8",
{
"address": "114.114.114.114",
"port": 53,
"domains": [
"geosite:cn",
"geosite:icloud",
"geosite:category-games@cn"
],
"expectIPs": [
"geoip:cn"
]
"expectIPs": ["geoip:cn"],
"skipFallback": true
},
{
"address": "https://1.1.1.1/dns-query",
"domains": [
"geosite:geolocation-!cn"
]
"address": "localhost",
"skipFallback": true
}
]
},
@@ -372,6 +374,7 @@ steamstatic.com.8686c.com @cn
],
"routing": {
"domainStrategy": "IPIfNonMatch",
"domainMatcher": "mph",
"rules": [
{
"type": "field",
@@ -381,26 +384,22 @@ steamstatic.com.8686c.com @cn
{
"type": "field",
"outboundTag": "Dns-Out",
"inboundTag": [
"Socks-In",
"Http-In"
],
"inboundTag": ["Socks-In", "Http-In"],
"network": "udp",
"port": 53
},
{
"type": "field",
"outboundTag": "Reject",
"domain": [
"geosite:category-ads-all"
]
"domain": ["geosite:category-ads-all"]
},
{
"type": "field",
"outboundTag": "Proxy",
"domain": [
"full:www.icloud.com",
"domain:icloud-content.com"
"domain:icloud-content.com",
"geosite:google"
]
},
{
@@ -415,25 +414,17 @@ steamstatic.com.8686c.com @cn
{
"type": "field",
"outboundTag": "Proxy",
"domain": [
"geosite:geolocation-!cn"
]
"domain": ["geosite:geolocation-!cn"]
},
{
"type": "field",
"outboundTag": "Direct",
"domain": [
"geosite:cn",
"geosite:private"
]
"domain": ["geosite:cn", "geosite:private"]
},
{
"type": "field",
"outboundTag": "Direct",
"ip": [
"geoip:cn",
"geoip:private"
]
"ip": ["geoip:cn", "geoip:private"]
},
{
"type": "field",
@@ -452,16 +443,13 @@ steamstatic.com.8686c.com @cn
## 致谢
- [@v2fly/geoip](https://github.com/v2fly/geoip)
- [@Loyalsoldier/geoip](https://github.com/Loyalsoldier/geoip)
- [@v2fly/domain-list-community](https://github.com/v2fly/domain-list-community)
- [@Loyalsoldier/domain-list-custom](https://github.com/Loyalsoldier/domain-list-custom)
- [@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)
- [@lhie1/Rules](https://github.com/lhie1/Rules/tree/master)
- [@AdblockPlus/EasylistChina+Easylist.txt](https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt)
- [@AdGuard/DNS-filter](https://kb.adguard.com/en/general/adguard-ad-filters#dns-filter)
- [@PeterLowe/adservers](https://pgl.yoyo.org/adservers)