Compare commits

..

1 Commits

Author SHA1 Message Date
loyalsoldier
b46f11363b Add RULE-SET support for Surge iOS 2020-08-16 15:33:27 +08:00
2 changed files with 22 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
name: Generate routing rules for Surge
name: Generate DOMAIN-SET for Surge Mac 3
on:
schedule:
- cron: "30 22 * * *"
@@ -14,16 +14,16 @@ jobs:
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 "v2fly_icloud=https://raw.githubusercontent.com/v2fly/domain-list-community/release/icloud.txt" >> $GITHUB_ENV
echo "v2fly_apple=https://raw.githubusercontent.com/v2fly/domain-list-community/release/apple.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 "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 "ipipnet_chinaiplist=https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt" >> $GITHUB_ENV
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=v2fly_icloud::https://raw.githubusercontent.com/v2fly/domain-list-community/release/icloud.txt"
echo "::set-env name=v2fly_apple::https://raw.githubusercontent.com/v2fly/domain-list-community/release/apple.txt"
echo "::set-env name=Loyalsoldier_reject::https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/reject-list.txt"
echo "::set-env name=Loyalsoldier_proxy::https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/proxy-list.txt"
echo "::set-env name=Loyalsoldier_direct::https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/direct-list.txt"
echo "::set-env name=felixonmars_apple::https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf"
echo "::set-env name=felixonmars_google::https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/google.china.conf"
echo "::set-env name=ipipnet_chinaiplist::https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt"
shell: bash
- name: Generate icloud.txt file
@@ -65,7 +65,7 @@ jobs:
- name: Generate cncidr.txt file
run: |
curl -sSL ${ipipnet_chinaiplist} | perl -ne '/^(\d{1,3}(\.\d{1,3}){3}\/\d{1,2})/ && print "IP-CIDR,$1\n"' > cncidr.txt
curl -sSL ${ipipnet_chinaiplist} | perl -ne '/^(\d{1,3}(\.\d{1,3}){3}\/\d{1,2})/ && print "$1\n"' > cncidr.txt
curl -sSL ${ipipnet_chinaiplist} | perl -ne '/^(\d{1,3}(\.\d{1,3}){3}\/\d{1,2})/ && print "IP-CIDR,$1\n"' > ruleset/cncidr.txt
- name: Move files to publish directory

View File

@@ -6,10 +6,11 @@
本项目的规则集DOMAIN-SET 和 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/surge-rules/blob/release/apple.txt) 和 [`Google`](https://github.com/Loyalsoldier/surge-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)。
### ⚠️ 注意
## ⚠️注意⚠️
- **DOMAIN-SET** 同时适用于 Surge for Mac **v3.5.1** 及更新的版本、Surge for iOS **v4.2.2** 及更新的版本,拥有比 RULE-SET 更优秀的匹配效率,建议优先使用。
- **DOMAIN-SET** 适用于 Surge for Mac **v3.5.1** 及更新的版本,拥有比 RULE-SET 更优秀的匹配效率,建议优先使用。
- **RULE-SET** 同时适用于 Surge for Mac **v3.0** 及更新的版本、Surge for iOS **v3.4** 及更新的版本。
- 由于本项目规则集很庞大,用于 Surge for iOS 可能会拖慢移动设备网速或性能(未测试),请酌情使用。
## 规则文件地址及使用方式
@@ -17,7 +18,7 @@
> 如果无法访问域名 `raw.githubusercontent.com`,可以使用第二个地址(`cdn.jsdelivr.net`),但是内容更新会有 12 小时的延迟。
#### DOMAIN-SET:
#### DOMAIN-SET
- **直连域名列表 direct.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/surge-rules/release/direct.txt](https://raw.githubusercontent.com/Loyalsoldier/surge-rules/release/direct.txt)
@@ -41,7 +42,7 @@
- [https://raw.githubusercontent.com/Loyalsoldier/surge-rules/release/cncidr.txt](https://raw.githubusercontent.com/Loyalsoldier/surge-rules/release/cncidr.txt)
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/surge-rules@release/cncidr.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/surge-rules@release/cncidr.txt)
#### RULE-SET:
#### RULE-SET
- **直连域名列表 direct.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/surge-rules/release/ruleset/direct.txt](https://raw.githubusercontent.com/Loyalsoldier/surge-rules/release/ruleset/direct.txt)
@@ -67,11 +68,9 @@
### 使用方式
关于 Surge 的详细使用方法,见[官方手册](https://manual.nssurge.com)。要想使用本项目的规则集,只需要在 Surge 配置文件中添加如下规则
关于 Surge 的详细使用方法,见[官方手册](https://manual.nssurge.com)。要想使用本项目的规则集,只需要在 Surge 配置文件中添加如下规则
⚠️ 注意:
- 如果希望使用 DNS 来解析未命中域名类型规则的域名,而不是直接走代理,请删除规则行尾的 `,no-resolve`
- 如果希望使用 DNS 来解析未命中域名类型规则的域名,而不是直接走代理,请删除 `cncidr` 行尾的 `,no-resolve`
- 以下配置中,除了 `DIRECT``REJECT` 是默认存在于 Surge 中的 policy路由策略/流量处理策略),其余均为自定义 policy对应配置文件中 `[Proxy]``[Proxy Group]` 中的代理名称。如你直接使用下面的 `[Rule]` 规则,则需要在 `[Proxy]``[Proxy Group]` 中手动配置一个名为 `PROXY` 的 policy。
- 如你希望 Apple、iCloud 和 Google 列表中的域名使用代理,则把 policy 由 `DIRECT` 改为 `PROXY`,以此类推,举一反三。
@@ -88,7 +87,7 @@ PROCESS-NAME,trojan-go,DIRECT
PROCESS-NAME,naive,DIRECT
PROCESS-NAME,Thunder,DIRECT
PROCESS-NAME,DownloadService,DIRECT
PROCESS-NAME,qBittorrent,DIRECT
PROCESS-NAME,qbittorrent,DIRECT
PROCESS-NAME,Transmission,DIRECT
PROCESS-NAME,fdm,DIRECT
PROCESS-NAME,aria2c,DIRECT
@@ -103,7 +102,7 @@ DOMAIN-SET,https://raw.githubusercontent.com/Loyalsoldier/surge-rules/release/ap
DOMAIN-SET,https://raw.githubusercontent.com/Loyalsoldier/surge-rules/release/google.txt,DIRECT
DOMAIN-SET,https://raw.githubusercontent.com/Loyalsoldier/surge-rules/release/proxy.txt,PROXY,force-remote-dns
DOMAIN-SET,https://raw.githubusercontent.com/Loyalsoldier/surge-rules/release/direct.txt,DIRECT
RULE-SET,https://raw.githubusercontent.com/Loyalsoldier/surge-rules/release/cncidr.txt,DIRECT,no-resolve
DOMAIN-SET,https://raw.githubusercontent.com/Loyalsoldier/surge-rules/release/cncidr.txt,DIRECT,no-resolve
RULE-SET,LAN,DIRECT,no-resolve
FINAL,PROXY,dns-failed
```
@@ -121,7 +120,7 @@ PROCESS-NAME,trojan-go,DIRECT
PROCESS-NAME,naive,DIRECT
PROCESS-NAME,Thunder,DIRECT
PROCESS-NAME,DownloadService,DIRECT
PROCESS-NAME,qBittorrent,DIRECT
PROCESS-NAME,qbittorrent,DIRECT
PROCESS-NAME,Transmission,DIRECT
PROCESS-NAME,fdm,DIRECT
PROCESS-NAME,aria2c,DIRECT