Compare commits

...

51 Commits

Author SHA1 Message Date
dependabot[bot]
0c3c03ea62
Chore: bump softprops/action-gh-release from 1 to 2 (#267) 2024-03-13 21:46:27 +08:00
Loyalsoldier
7055f29131
Rule: proxy google list in whitelist mode by default 2024-01-29 13:21:46 +08:00
Loyalsoldier
98fe5fd593
Docs: clash & ecosystem backup 2023-11-05 22:17:48 +08:00
dependabot[bot]
7a9894fa22
Chore: bump actions/checkout from 3 to 4 (#212) 2023-09-07 17:48:30 +08:00
Loyalsoldier
3b76324b76
Feat: remove obsolete cn blocked domains 2023-04-23 15:17:57 +08:00
Loyalsoldier
113caa01de
Fix: update dep to suppress warning 2023-02-08 17:38:26 +08:00
Loyalsoldier
52af20ac3c
Docs: fix links & platform 2023-01-28 14:31:49 +08:00
Loyalsoldier
9155127ee1
Docs: remove donation section 2022-08-30 21:18:27 +08:00
Loyalsoldier
11ed3bf0c9
Revert "Feat: deprecate jsDelivr links"
This reverts commit fa12eabc89ae3f373d556f0d0846909a691d19aa.
2022-08-30 21:17:42 +08:00
Loyalsoldier
fa12eabc89
Feat: deprecate jsDelivr links 2022-05-21 11:12:55 +08:00
dependabot[bot]
9cf6161dbf
Chore: bump actions/checkout from 2 to 3 (#72) 2022-03-02 16:37:41 +08:00
Loyalsoldier
1e6cb3c0e2
README: fix LAN geoip rule 2022-02-24 00:01:01 +08:00
Loyalsoldier
81c1ec313c
README: fix terms 2021-11-05 21:16:17 +08:00
Loyalsoldier
e89dd8d764
Fix: README typo 2021-11-03 23:28:17 +08:00
Loyalsoldier
6653b1818c
Chore: replace PROCESS-NAME rules with rule-set 2021-11-03 19:29:07 +08:00
Loyalsoldier
a409fcb644
Feat: use CIDR from repo @Loyalsoldier/geoip 2021-11-03 18:30:42 +08:00
Loyalsoldier
b10802d5f3
Chore: update actions/checkout 2021-10-18 08:22:16 +08:00
Loyalsoldier
c3b9c36c72
README: add donation info 2021-10-16 09:40:50 +08:00
pzcn
9666b73222
Purge CDN after a new release (#45)
Co-authored-by: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
2021-08-28 19:31:31 +08:00
loyalsoldier
3231f9422a
Fix: degrade to fix upload 2021-08-09 19:11:26 +08:00
loyalsoldier
0d943b72cf
README: add stargazers over time image 2021-06-21 15:12:29 +08:00
Loyalsoldier
fcf4f979dc
Chore: change Git user
Reference: https://github.com/Loyalsoldier/geoip/pull/9
2021-03-19 12:40:06 +08:00
loyalsoldier
18c612c4e9
README: refine description 2021-03-11 16:14:28 +08:00
loyalsoldier
86a7c719b5
Chore: refine README & process rules 2021-02-20 14:48:48 +08:00
loyalsoldier
c210a589f0
Fix: unique full type of rules
fixes #21
2021-02-16 20:00:02 +08:00
Loyalsoldier
5441d199cf
Refine blacklist mode 2021-01-28 09:17:25 +08:00
loyalsoldier
49f7eb8a57
Specify domain and sub-domain
Keep up with upstream behavior 18f0a8301a
2021-01-21 17:57:04 +08:00
loyalsoldier
1e7b435701
Add private domain list 2021-01-21 16:42:50 +08:00
loyalsoldier
7f13203f06
Refine telegram CIDR 2021-01-01 09:31:50 +08:00
loyalsoldier
f85ed2f9e1
Add Telegram CIDR 2020-11-26 05:30:11 +08:00
Loyalsoldier
79f97847f4
Update README.md 2020-11-23 14:24:43 +08:00
loyalsoldier
28f62a90c5
Remove regexp & keyword types of domains 2020-11-23 13:44:24 +08:00
loyalsoldier
594f81515e
Make clash dashboards use DIRECT 2020-11-04 07:49:05 +08:00
dependabot[bot]
d2b891b3e5
Bump actions/checkout from v2.3.3 to v2.3.4 (#7) 2020-11-04 07:03:41 +08:00
loyalsoldier
43422a58a8
Change download links to avoid download error 2020-10-30 08:47:17 +08:00
loyalsoldier
048ee41552
Add blacklist mode 2020-10-30 08:47:16 +08:00
loyalsoldier
0dfe2ef96d
Refine list 2020-10-30 08:13:45 +08:00
loyalsoldier
62a5cdf9e7
Change source from v2fly to @Loyalsoldier/domain-list-custom 2020-10-30 08:13:07 +08:00
Loyalsoldier
4ef5289afe
Run workflow on workflow_dispatch event 2020-10-27 12:52:24 +08:00
loyalsoldier
12b0214a27
Update set-env & add-path commands
due to https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
2020-10-06 15:08:20 +08:00
dependabot[bot]
92d01ffcba
Bump actions/checkout from v2.3.2 to v2.3.3 (#3) 2020-09-24 13:26:20 +08:00
Loyalsoldier
9607b36305
README: fix qBittorrent process name 2020-09-09 17:51:06 +08:00
dependabot[bot]
7ee290b55f
Bump actions/checkout from v2.3.1 to v2.3.2 (#1)
Bumps [actions/checkout](https://github.com/actions/checkout) from v2.3.1 to v2.3.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.3.1...2036a08e25fa78bbd946711a407b529a0a1204bf)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-10 07:13:49 +08:00
Loyalsoldier
636c38ac37
Add surge 3 into PROCESS-NAME direct rule 2020-08-06 01:40:21 +08:00
Loyalsoldier
6f1a37e9c8
Add credit to @v2fly/domain-list-community 2020-08-06 01:36:23 +08:00
Loyalsoldier
a94175521f
Remove GEOIP 2020-08-06 01:34:12 +08:00
loyalsoldier
6e6e1c5594
Use GitHub dependabot 2020-08-05 07:14:56 +08:00
loyalsoldier
7c58f18503
Add README 2020-08-05 07:14:56 +08:00
loyalsoldier
7f9927dc93
Update due to af804d9879 2020-08-04 10:56:16 +08:00
loyalsoldier
f5068de75f
Generate cncidr.txt from @17mon/china_ip_list 2020-08-01 09:30:36 +08:00
loyalsoldier
4bb65003e6
Add GitHub workflow 2020-08-01 09:29:48 +08:00
3 changed files with 383 additions and 1 deletions

15
.github/dependabot.yml vendored Normal file
View 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: "-"

141
.github/workflows/run.yml vendored Normal file
View File

@ -0,0 +1,141 @@
name: Generate RULE-SET for Premium Edition of Clash
on:
workflow_dispatch:
schedule:
- cron: "30 22 * * *"
push:
branches:
- master
paths-ignore:
- "**/README.md"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set variables
run: |
echo "RELEASE_NAME=Released on $(date +%Y%m%d%H%M)" >> $GITHUB_ENV
echo "TAG_NAME=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV
echo "custom_icloud=https://raw.githubusercontent.com/Loyalsoldier/domain-list-custom/release/icloud.txt" >> $GITHUB_ENV
echo "custom_tld_not_cn=https://raw.githubusercontent.com/Loyalsoldier/domain-list-custom/release/tld-!cn.txt" >> $GITHUB_ENV
echo "custom_private=https://raw.githubusercontent.com/Loyalsoldier/domain-list-custom/release/private.txt" >> $GITHUB_ENV
echo "Loyalsoldier_reject=https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/reject-list.txt" >> $GITHUB_ENV
echo "Loyalsoldier_proxy=https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/proxy-list.txt" >> $GITHUB_ENV
echo "Loyalsoldier_direct=https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/direct-list.txt" >> $GITHUB_ENV
echo "Loyalsoldier_gfw=https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/gfw.txt" >> $GITHUB_ENV
echo "Loyalsoldier_greatfire=https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/greatfire.txt" >> $GITHUB_ENV
echo "felixonmars_apple=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf" >> $GITHUB_ENV
echo "felixonmars_google=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/google.china.conf" >> $GITHUB_ENV
echo "cn_cidr=https://raw.githubusercontent.com/Loyalsoldier/geoip/release/text/cn.txt" >> $GITHUB_ENV
echo "lan_cidr=https://raw.githubusercontent.com/Loyalsoldier/geoip/release/text/private.txt" >> $GITHUB_ENV
echo "telegram_cidr=https://raw.githubusercontent.com/Loyalsoldier/geoip/release/text/telegram.txt" >> $GITHUB_ENV
shell: bash
- name: Checkout the "hidden" branch
uses: actions/checkout@v4
with:
ref: hidden
- name: Generate icloud.txt file
run: |
echo "payload:" > icloud.txt
curl -sSL ${custom_icloud} | grep -E "^(full|domain):" | awk -F ':' '{printf " - |+.%s|\n", $2}' | sed "s/|/'/g" >> icloud.txt
- name: Generate google.txt file
run: |
echo "payload:" > google.txt
curl -sSL ${felixonmars_google} | perl -ne '/^server=\/([^\/]+)\// && print " - |+.$1|\n"' | sed "s/|/'/g" >> google.txt
- name: Generate apple.txt file
run: |
echo "payload:" > apple.txt
curl -sSL ${felixonmars_apple} | perl -ne '/^server=\/([^\/]+)\// && print " - |+.$1|\n"' | sed "s/|/'/g" >> apple.txt
- name: Generate private.txt file
run: |
echo "payload:" > private.txt
curl -sSL ${custom_private} | awk -F ':' '/^full:/ {printf " - |%s|\n", $2}' | sed "s/|/'/g" >> private.txt
curl -sSL ${custom_private} | awk -F ':' '/^domain:/ {printf " - |+.%s|\n", $2}' | sed "s/|/'/g" >> private.txt
- name: Generate direct.txt file
run: |
echo "payload:" > direct.txt
curl -sSL ${Loyalsoldier_direct} | grep -Ev "^(regexp|keyword):" | perl -ne '/^(full:)([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |$2|\n"' | sed "s/|/'/g" >> direct.txt
curl -sSL ${Loyalsoldier_direct} | grep -Ev "^(regexp|keyword|full):" | perl -ne '/^(domain:)?([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$2|\n"' | sed "s/|/'/g" >> direct.txt
- name: Generate proxy.txt file
run: |
echo "payload:" > proxy.txt
curl -sSL ${Loyalsoldier_proxy} | grep -Ev "^(regexp|keyword):" | perl -ne '/^(full:)([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |$2|\n"' | sed "s/|/'/g" >> proxy.txt
curl -sSL ${Loyalsoldier_proxy} | grep -Ev "^(regexp|keyword|full):" | perl -ne '/^(domain:)?([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$2|\n"' | sed "s/|/'/g" >> proxy.txt
- name: Generate reject.txt file
run: |
echo "payload:" > reject.txt
curl -sSL ${Loyalsoldier_reject} | grep -Ev "^(regexp|keyword):" | perl -ne '/^(domain:|full:)?([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$2|\n"' | sed "s/|/'/g" >> reject.txt
- name: Generate gfw.txt file
run: |
echo "payload:" > gfw.txt
curl -sSL ${Loyalsoldier_gfw} | grep -Ev "^(regexp|keyword):" | perl -ne '/^(domain:|full:)?([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$2|\n"' | sed "s/|/'/g" >> gfw.txt
- name: Generate greatfire.txt file
run: |
echo "payload:" > greatfire.txt
curl -sSL ${Loyalsoldier_greatfire} | grep -Ev "^(regexp|keyword):" | perl -ne '/^(domain:|full:)?([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$2|\n"' | sed "s/|/'/g" >> greatfire.txt
- name: Generate tld-not-cn.txt file
run: |
echo "payload:" > tld-not-cn.txt
curl -sSL "${custom_tld_not_cn}" | perl -ne '/^domain:([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$1|\n"' | sed "s/|/'/g" >> tld-not-cn.txt
- name: Generate cncidr.txt file
run: |
echo "payload:" > cncidr.txt
curl -sSL ${cn_cidr} | perl -ne '/(.+\/\d+)/ && print " - |$1|\n"' | sed "s/|/'/g" >> cncidr.txt
- name: Generate telegramcidr.txt file
run: |
echo "payload:" > telegramcidr.txt
curl -sSL ${telegram_cidr} | perl -ne '/(.+\/\d+)/ && print " - |$1|\n"' | sed "s/|/'/g" >> telegramcidr.txt
- name: Generate lancidr.txt file
run: |
echo "payload:" > lancidr.txt
curl -sSL ${lan_cidr} | perl -ne '/(.+\/\d+)/ && print " - |$1|\n"' | sed "s/|/'/g" >> lancidr.txt
- name: Move files to publish directory
run: |
mkdir -p publish
cp *.txt ./publish/
- name: Release and upload assets
uses: softprops/action-gh-release@v2
with:
name: ${{ env.RELEASE_NAME }}
tag_name: ${{ env.TAG_NAME }}
draft: false
prerelease: false
files: |
./publish/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Git push assets to "release" branch
run: |
cd publish || exit 1
git init
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b release
git add .
git commit -m "${{ env.RELEASE_NAME }}"
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
git push -f 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

228
README.md
View File

@ -1 +1,227 @@
# clash-rules
# 简介
本项目生成适用于 [**Clash Premium 内核**](https://github.com/Dreamacro/clash/releases/tag/premium)的规则集RULE-SET同时适用于所有使用 Clash Premium 内核的 Clash 图形用户界面GUI客户端。使用 GitHub Actions 北京时间每天早上 6:30 自动构建,保证规则最新。
## 说明
本项目规则集RULE-SET的数据主要来源于项目 [@Loyalsoldier/v2ray-rules-dat](https://github.com/Loyalsoldier/v2ray-rules-dat) 和 [@v2fly/domain-list-community](https://github.com/v2fly/domain-list-community)[`Apple`](https://github.com/Loyalsoldier/clash-rules/blob/release/apple.txt) 和 [`Google`](https://github.com/Loyalsoldier/clash-rules/blob/release/google.txt) 列表里的域名来源于项目 [@felixonmars/dnsmasq-china-list](https://github.com/felixonmars/dnsmasq-china-list);中国大陆 IPv4 地址数据使用 [@17mon/china_ip_list](https://github.com/17mon/china_ip_list)。
本项目的规则集RULE-SET只适用于 Clash **Premium** 版本。Clash Premium 相对于普通版,增加了 **TUN 增强模式**,能接管设备所有 TCP 和 UDP 流量。
### Clash Premium 各版本下载地址
> ⚠️ 由于 Clash 及其部分周边生态项目于 2023 年 11 月上旬删库跑路,现提供部分官方原版安装包、可执行文件,详情见 [**hidden**](https://github.com/Loyalsoldier/clash-rules/tree/hidden) 分支。
- Clash Premium **命令行**版:
- [官方版](https://github.com/Loyalsoldier/clash-rules/tree/hidden/software/clash-premium)(适用于 Windows、macOS、Linux、OpenWRT 等多种平台)
- [衍生版 Clash.Meta](https://github.com/MetaCubeX/Clash.Meta/releases)(适用于 Windows、macOS、Linux、OpenWRT 等多种平台)
- Clash Premium **图形用户界面**版:
- [ClashN](https://github.com/2dust/clashN/releases)(适用于 Windows
- [ClashX Pro](https://github.com/Loyalsoldier/clash-rules/tree/hidden/software/clashx-pro)(适用于 macOS
- [Clash-verge](https://github.com/zzzgydi/clash-verge/releases)(适用于 Windows、macOS、Linux
- [Clash for Windows](https://github.com/Loyalsoldier/clash-rules/tree/hidden/software/clash-for-windows)(适用于 Windows、macOS、Linux
- [Clash for Android](https://apkpure.com/clash-for-android/com.github.kr328.clash/versions)(适用于 Android
## 规则文件地址及使用方式
### 在线地址URL
> 如果无法访问域名 `raw.githubusercontent.com`,可以使用第二个地址(`cdn.jsdelivr.net`),但是内容更新会有 12 小时的延迟。以下地址填写在 Clash 配置文件里的 `rule-providers` 里的 `url` 配置项中。
- **直连域名列表 direct.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/direct.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/direct.txt)
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/direct.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/direct.txt)
- **代理域名列表 proxy.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/proxy.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/proxy.txt)
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/proxy.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/proxy.txt)
- **广告域名列表 reject.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/reject.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/reject.txt)
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/reject.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/reject.txt)
- **私有网络专用域名列表 private.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/private.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/private.txt)
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/private.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/private.txt)
- **Apple 在中国大陆可直连的域名列表 apple.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/apple.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/apple.txt)
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/apple.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/apple.txt)
- **iCloud 域名列表 icloud.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/icloud.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/icloud.txt)
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/icloud.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/icloud.txt)
- **[慎用]Google 在中国大陆可直连的域名列表 google.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/google.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/google.txt)
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/google.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/google.txt)
- **GFWList 域名列表 gfw.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/gfw.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/gfw.txt)
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/gfw.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/gfw.txt)
- **非中国大陆使用的顶级域名列表 tld-not-cn.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/tld-not-cn.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/tld-not-cn.txt)
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/tld-not-cn.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/tld-not-cn.txt)
- **Telegram 使用的 IP 地址列表 telegramcidr.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/telegramcidr.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/telegramcidr.txt)
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/telegramcidr.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/telegramcidr.txt)
- **局域网 IP 及保留 IP 地址列表 lancidr.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/lancidr.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/lancidr.txt)
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/lancidr.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/lancidr.txt)
- **中国大陆 IP 地址列表 cncidr.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/cncidr.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/cncidr.txt)
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/cncidr.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/cncidr.txt)
- **需要直连的常见软件列表 applications.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/applications.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/applications.txt)
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/applications.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/applications.txt)
### 使用方式
要想使用本项目的规则集,只需要在 Clash 配置文件中添加如下 `rule-providers``rules`
#### Rule Providers 配置方式
```yaml
rule-providers:
reject:
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/reject.txt"
path: ./ruleset/reject.yaml
interval: 86400
icloud:
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/icloud.txt"
path: ./ruleset/icloud.yaml
interval: 86400
apple:
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/apple.txt"
path: ./ruleset/apple.yaml
interval: 86400
google:
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/google.txt"
path: ./ruleset/google.yaml
interval: 86400
proxy:
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/proxy.txt"
path: ./ruleset/proxy.yaml
interval: 86400
direct:
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/direct.txt"
path: ./ruleset/direct.yaml
interval: 86400
private:
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/private.txt"
path: ./ruleset/private.yaml
interval: 86400
gfw:
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/gfw.txt"
path: ./ruleset/gfw.yaml
interval: 86400
tld-not-cn:
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/tld-not-cn.txt"
path: ./ruleset/tld-not-cn.yaml
interval: 86400
telegramcidr:
type: http
behavior: ipcidr
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/telegramcidr.txt"
path: ./ruleset/telegramcidr.yaml
interval: 86400
cncidr:
type: http
behavior: ipcidr
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/cncidr.txt"
path: ./ruleset/cncidr.yaml
interval: 86400
lancidr:
type: http
behavior: ipcidr
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/lancidr.txt"
path: ./ruleset/lancidr.yaml
interval: 86400
applications:
type: http
behavior: classical
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/applications.txt"
path: ./ruleset/applications.yaml
interval: 86400
```
#### 白名单模式 Rules 配置方式(推荐)
- 白名单模式,意为「**没有命中规则的网络流量,统统使用代理**」,适用于服务器线路网络质量稳定、快速,不缺服务器流量的用户。
- 以下配置中,除了 `DIRECT``REJECT` 是默认存在于 Clash 中的 policy路由策略/流量处理策略),其余均为自定义 policy对应配置文件中 `proxies``proxy-groups` 中的 `name`。如你直接使用下面的 `rules` 规则,则需要在 `proxies``proxy-groups` 中手动配置一个 `name``PROXY` 的 policy。
- 如你希望 Apple、iCloud 和 Google 列表中的域名使用代理,则把 policy 由 `DIRECT` 改为 `PROXY`,以此类推,举一反三。
- 如你不希望进行 DNS 解析,可在 `GEOIP` 规则的最后加上 `,no-resolve`,如 `GEOIP,CN,DIRECT,no-resolve`
```yaml
rules:
- RULE-SET,applications,DIRECT
- DOMAIN,clash.razord.top,DIRECT
- DOMAIN,yacd.haishan.me,DIRECT
- RULE-SET,private,DIRECT
- RULE-SET,reject,REJECT
- RULE-SET,icloud,DIRECT
- RULE-SET,apple,DIRECT
- RULE-SET,google,PROXY
- RULE-SET,proxy,PROXY
- RULE-SET,direct,DIRECT
- RULE-SET,lancidr,DIRECT
- RULE-SET,cncidr,DIRECT
- RULE-SET,telegramcidr,PROXY
- GEOIP,LAN,DIRECT
- GEOIP,CN,DIRECT
- MATCH,PROXY
```
#### 黑名单模式 Rules 配置方式
- 黑名单模式,意为「**只有命中规则的网络流量,才使用代理**」,适用于服务器线路网络质量不稳定或不够快,或服务器流量紧缺的用户。通常也是软路由用户、家庭网关用户的常用模式。
- 以下配置中,除了 `DIRECT``REJECT` 是默认存在于 Clash 中的 policy路由策略/流量处理策略),其余均为自定义 policy对应配置文件中 `proxies``proxy-groups` 中的 `name`。如你直接使用下面的 `rules` 规则,则需要在 `proxies``proxy-groups` 中手动配置一个 `name``PROXY` 的 policy。
```yaml
rules:
- RULE-SET,applications,DIRECT
- DOMAIN,clash.razord.top,DIRECT
- DOMAIN,yacd.haishan.me,DIRECT
- RULE-SET,private,DIRECT
- RULE-SET,reject,REJECT
- RULE-SET,tld-not-cn,PROXY
- RULE-SET,gfw,PROXY
- RULE-SET,telegramcidr,PROXY
- MATCH,DIRECT
```
## 致谢
- [@Loyalsoldier/geoip](https://github.com/Loyalsoldier/geoip)
- [@Loyalsoldier/v2ray-rules-dat](https://github.com/Loyalsoldier/v2ray-rules-dat)
- [@gfwlist/gfwlist](https://github.com/gfwlist/gfwlist)
- [@v2fly/domain-list-community](https://github.com/v2fly/domain-list-community)
- [@felixonmars/dnsmasq-china-list](https://github.com/felixonmars/dnsmasq-china-list)
- [@17mon/china_ip_list](https://github.com/17mon/china_ip_list)
## 项目 Star 数增长趋势
[![Stargazers over time](https://starchart.cc/Loyalsoldier/clash-rules.svg)](https://starchart.cc/Loyalsoldier/clash-rules)