Files
clash-rules/README.md
2025-09-12 07:10:01 +00:00

143 lines
4.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Clash Rules 规则仓库
[![Update Rules](https://github.com/adminroot/clash-rules/actions/workflows/clash-rules.yml/badge.svg)](https://github.com/adminroot/clash-rules/actions/workflows/clash-rules.yml)
[![Last Update](https://img.shields.io/badge/Last%20Update-$(date +'%Y--%m--%d')-blue)](https://github.com/adminroot/clash-rules/tree/main/ruleset)
自动同步 [Loyalsoldier/clash-rules](https://github.com/Loyalsoldier/clash-rules) 规则,每日更新。
## 📁 文件结构
```
.
├── README.md # 本文档
└── ruleset/
├── txt/ # 原始文本格式规则
│ ├── reject.txt
│ ├── proxy.txt
│ └── ...
└── yaml/ # Clash YAML 格式规则
├── reject.yaml
├── proxy.yaml
└── ...
```
## 📊 规则文件说明
| 规则名称 | 类型 | 描述 | 文本格式 | YAML格式 |
|---------|------|------|---------|----------|
| reject | 域名 | 广告和跟踪域名 | [txt](./ruleset/txt/reject.txt) | [yaml](./ruleset/yaml/reject.yaml) |
| icloud | 域名 | iCloud 域名 | [txt](./ruleset/txt/icloud.txt) | [yaml](./ruleset/yaml/icloud.yaml) |
| apple | 域名 | Apple 服务域名 | [txt](./ruleset/txt/apple.txt) | [yaml](./ruleset/yaml/apple.yaml) |
| google | 域名 | Google 服务域名 | [txt](./ruleset/txt/google.txt) | [yaml](./ruleset/yaml/google.yaml) |
| proxy | 域名 | 需要代理的域名 | [txt](./ruleset/txt/proxy.txt) | [yaml](./ruleset/yaml/proxy.yaml) |
| direct | 域名 | 直连域名 | [txt](./ruleset/txt/direct.txt) | [yaml](./ruleset/yaml/direct.yaml) |
| private | 域名 | 私有网络域名 | [txt](./ruleset/txt/private.txt) | [yaml](./ruleset/yaml/private.yaml) |
| gfw | 域名 | GFW 域名列表 | [txt](./ruleset/txt/gfw.txt) | [yaml](./ruleset/yaml/gfw.yaml) |
| tld-not-cn | 域名 | 非中国顶级域名 | [txt](./ruleset/txt/tld-not-cn.txt) | [yaml](./ruleset/yaml/tld-not-cn.yaml) |
| telegramcidr | IP段 | Telegram IP 段 | [txt](./ruleset/txt/telegramcidr.txt) | [yaml](./ruleset/yaml/telegramcidr.yaml) |
| cncidr | IP段 | 中国 IP 段 | [txt](./ruleset/txt/cncidr.txt) | [yaml](./ruleset/yaml/cncidr.yaml) |
| lancidr | IP段 | 局域网 IP 段 | [txt](./ruleset/txt/lancidr.txt) | [yaml](./ruleset/yaml/lancidr.yaml) |
| applications | 进程 | 应用程序规则 | [txt](./ruleset/txt/applications.txt) | [yaml](./ruleset/yaml/applications.yaml) |
## 🚀 使用方法
### 方式一:远程规则订阅(推荐)
在 Clash 配置文件中添加:
\`\`\`yaml
rule-providers:
# 广告拦截
reject:
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/adminroot/clash-rules@main/ruleset/yaml/reject.yaml"
path: ./ruleset/reject.yaml
interval: 86400
# 代理规则
proxy:
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/adminroot/clash-rules@main/ruleset/yaml/proxy.yaml"
path: ./ruleset/proxy.yaml
interval: 86400
# 直连规则
direct:
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/adminroot/clash-rules@main/ruleset/yaml/direct.yaml"
path: ./ruleset/direct.yaml
interval: 86400
# 中国IP段
cncidr:
type: http
behavior: ipcidr
url: "https://cdn.jsdelivr.net/gh/adminroot/clash-rules@main/ruleset/yaml/cncidr.yaml"
path: ./ruleset/cncidr.yaml
interval: 86400
rules:
- RULE-SET,reject,REJECT
- RULE-SET,proxy,PROXY
- RULE-SET,direct,DIRECT
- RULE-SET,cncidr,DIRECT
- GEOIP,CN,DIRECT
- MATCH,PROXY
\`\`\`
### 方式二:本地规则文件
1. 下载所需的规则文件到本地
2. 在 Clash 配置中引用本地文件:
\`\`\`yaml
rule-providers:
reject:
type: file
behavior: domain
path: ./ruleset/reject.yaml
\`\`\`
## 🔗 CDN 加速地址
提供多个 CDN 地址,选择最适合你的:
### jsDelivr推荐国内可访问
\`\`\`
https://cdn.jsdelivr.net/gh/adminroot/clash-rules@main/ruleset/yaml/[规则名].yaml
https://fastly.jsdelivr.net/gh/adminroot/clash-rules@main/ruleset/yaml/[规则名].yaml
\`\`\`
### GitHub Raw
\`\`\`
https://raw.githubusercontent.com/adminroot/clash-rules/main/ruleset/yaml/[规则名].yaml
\`\`\`
### Statically
\`\`\`
https://cdn.statically.io/gh/adminroot/clash-rules/main/ruleset/yaml/[规则名].yaml
\`\`\`
## 📈 更新统计
最后更新时间: $(date +'%Y-%m-%d %H:%M:%S UTC')
查看详细更新日志: [UPDATE_LOG.md](./ruleset/UPDATE_LOG.md)
## ⚙️ 自动更新
- **更新频率**: 每日自动更新UTC 23:00 / 北京时间 07:00
- **手动更新**: 可在 [Actions](https://github.com/adminroot/clash-rules/actions) 页面手动触发
- **数据来源**: [Loyalsoldier/clash-rules](https://github.com/Loyalsoldier/clash-rules)
## 📝 许可证
本项目规则文件来自上游项目,仅做格式转换和分发。
---
如果这个项目对你有帮助,请给个 ⭐ Star