mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2025-12-10 21:22:22 +00:00
Fix README-cn.md markdown style (#389)
* Fix README-cn.md markdown style * fix typo * Fix another issue [skip ci]
This commit is contained in:
221
README-cn.md
221
README-cn.md
@@ -7,7 +7,7 @@
|
||||
[](https://github.com/tindy2013/subconverter/releases)
|
||||
[](https://github.com/tindy2013/subconverter/blob/master/LICENSE)
|
||||
|
||||
---
|
||||
* * *
|
||||
|
||||
## 新增内容
|
||||
|
||||
@@ -63,40 +63,62 @@
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
* * *
|
||||
|
||||
## 说明目录
|
||||
|
||||
- [subconverter](#subconverter)
|
||||
|
||||
- [新增内容](#新增内容)
|
||||
|
||||
- [说明目录](#说明目录)
|
||||
|
||||
- [支持类型](#支持类型)
|
||||
|
||||
- [简易用法](#简易用法)
|
||||
|
||||
- [调用地址](#调用地址)
|
||||
- [调用说明](#调用说明)
|
||||
- [简易转换](#简易转换)
|
||||
|
||||
- [进阶用法](#进阶用法)
|
||||
|
||||
- [阅前提示](#阅前提示)
|
||||
|
||||
- [进阶链接](#进阶链接)
|
||||
|
||||
- [调用地址 (进阶)](#调用地址-进阶)
|
||||
- [调用说明 (进阶)](#调用说明-进阶)
|
||||
|
||||
- [配置档案](#配置档案)
|
||||
|
||||
- [调用地址 (档案)](#调用地址-档案)
|
||||
- [调用说明 (档案)](#调用说明-档案)
|
||||
|
||||
- [配置文件](#配置文件)
|
||||
|
||||
- [外部配置](#外部配置)
|
||||
|
||||
- [模板功能](#模板功能)
|
||||
|
||||
- [模板调用](#模板调用)
|
||||
- [直接渲染](#直接渲染)
|
||||
|
||||
- [特别用法](#特别用法)
|
||||
|
||||
- [本地生成](#本地生成)
|
||||
|
||||
- [自动上传](#自动上传)
|
||||
|
||||
- [规则转换](#规则转换)
|
||||
|
||||
- [调用地址 (规则转换)](#调用地址-规则转换)
|
||||
- [调用说明 (规则转换)](#调用说明-规则转换)
|
||||
|
||||
## 支持类型
|
||||
|
||||
| 类型 | 作为源类型 | 作为目标类型 | 参数 |
|
||||
| ---------------------------- | :--------: | :----------: | ------------------- |
|
||||
| ---------------------- | :---: | :----: | -------------- |
|
||||
| Clash | ✓ | ✓ | clash |
|
||||
| ClashR | ✓ | ✓ | clashr |
|
||||
| Quantumult (完整配置) | ✓ | ✓ | quan |
|
||||
@@ -124,14 +146,13 @@
|
||||
2. 类 TG 代理的 HTTP/Socks 链接由于没有命名设定,所以可以在后方插入`&remarks=`进行命名,同时也可以插入 `&group=` 设置组别名称,以上两个参数需要经过 [URLEncode](https://www.urlencoder.org/) 处理,例如
|
||||
|
||||
- tg://http?server=1.2.3.4&port=233&user=user&pass=pass&remarks=Example&group=xxx
|
||||
|
||||
- https://t.me/http?server=1.2.3.4&port=233&user=user&pass=pass&remarks=Example&group=xxx
|
||||
- <https://t.me/http?server=1.2.3.4&port=233&user=user&pass=pass&remarks=Example&group=xxx>
|
||||
|
||||
3. 目标类型为 `mixed` 时,会输出所有支持的节点的单链接组成的普通订阅(Base64编码)
|
||||
|
||||
4. 目标类型为 `auto` 时,会根据请求的 `User-Agent` 自动判断输出的目标类型,匹配规则可参见 [此处](https://github.com/tindy2013/subconverter/blob/master/src/handler/interfaces.cpp#L121) (该链接有可能因为代码修改而不能准确指向相应的代码)
|
||||
|
||||
---
|
||||
* * *
|
||||
|
||||
## 简易用法
|
||||
|
||||
@@ -146,7 +167,7 @@ http://127.0.0.1:25500/sub?target=%TARGET%&url=%URL%&config=%CONFIG%
|
||||
### 调用说明
|
||||
|
||||
| 调用参数 | 必要性 | 示例 | 解释 |
|
||||
| -------- | :----: | :------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| ------ | :-: | :------------------------ | ------------------------------------------------------------------------------------------------------------------- |
|
||||
| target | 必要 | surge&ver=4 | 指想要生成的配置类型,详见上方 [支持类型](#支持类型) 中的参数 |
|
||||
| url | 必要 | https%3A%2F%2Fwww.xxx.com | 指机场所提供的订阅链接或代理节点的分享链接,需要经过 [URLEncode](https://www.urlencoder.org/) 处理 |
|
||||
| config | 可选 | https%3A%2F%2Fwww.xxx.com | 指 外部配置 的地址 (包含分组和规则部分),需要经过 [URLEncode](https://www.urlencoder.org/) 处理,详见 [外部配置](#外部配置) ,当此参数不存在时使用 程序的主程序目录中的配置文件 |
|
||||
@@ -253,7 +274,7 @@ http://127.0.0.1:25500/surge2clash?link=Surge的订阅链接
|
||||
|
||||
此处 `Surge的订阅链接`**不需要进行URLEncode**,且**无需任何额外配置**。
|
||||
|
||||
---
|
||||
* * *
|
||||
|
||||
## 进阶用法
|
||||
|
||||
@@ -266,11 +287,11 @@ http://127.0.0.1:25500/surge2clash?link=Surge的订阅链接
|
||||
在进行下一步操作前,十分推荐您阅读以下内容:
|
||||
|
||||
1. 与 调用地址 相关的:[什么是URL?](https://developer.mozilla.org/zh-CN/docs/Learn/Common_questions/What_is_a_URL)
|
||||
1. 与 配置文件 相关的:[INI 语法介绍](https://zh.wikipedia.org/wiki/INI%E6%96%87%E4%BB%B6) 、 [YAML 语法介绍](https://zh.wikipedia.org/wiki/YAML#%E8%AA%9E%E6%B3%95) 以及 [TOML 语法介绍](https://toml.io/cn/v1.0.0)
|
||||
1. 与 `Clash` 配置相关的:[YAML 语法介绍](https://zh.wikipedia.org/wiki/YAML#%E8%AA%9E%E6%B3%95) 以及 [官方文档](https://github.com/Dreamacro/clash/wiki/configuration)
|
||||
1. 与 `模板` 配置相关的:[INJA 语法介绍](https://github.com/pantor/inja)
|
||||
1. 会经常涉及到的: [正则表达式入门](https://github.com/ziishaned/learn-regex/blob/master/translations/README-cn.md)
|
||||
1. 当遇到问题需要提交 ISSUE 时的:[提问的智慧](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md)
|
||||
2. 与 配置文件 相关的:[INI 语法介绍](https://zh.wikipedia.org/wiki/INI%E6%96%87%E4%BB%B6) 、 [YAML 语法介绍](https://zh.wikipedia.org/wiki/YAML#%E8%AA%9E%E6%B3%95) 以及 [TOML 语法介绍](https://toml.io/cn/v1.0.0)
|
||||
3. 与 `Clash` 配置相关的:[YAML 语法介绍](https://zh.wikipedia.org/wiki/YAML#%E8%AA%9E%E6%B3%95) 以及 [官方文档](https://github.com/Dreamacro/clash/wiki/configuration)
|
||||
4. 与 `模板` 配置相关的:[INJA 语法介绍](https://github.com/pantor/inja)
|
||||
5. 会经常涉及到的: [正则表达式入门](https://github.com/ziishaned/learn-regex/blob/master/translations/README-cn.md)
|
||||
6. 当遇到问题需要提交 ISSUE 时的:[提问的智慧](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md)
|
||||
|
||||
当您尝试进行进阶操作时,即默认您有相关的操作能力,本程序仅保证在默认配置文件下能够正常运行。
|
||||
|
||||
@@ -285,7 +306,7 @@ http://127.0.0.1:25500/sub?target=%TARGET%&url=%URL%&emoji=%EMOJI%····
|
||||
#### 调用说明 (进阶)
|
||||
|
||||
| 调用参数 | 必要性 | 示例 | 解释 |
|
||||
| ------------- | :----: | :--------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| ------------- | :-: | :------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| target | 必要 | surge&ver=4 | 指想要生成的配置类型,详见上方 [支持类型](#支持类型) 中的参数 |
|
||||
| url | 可选 | https%3A%2F%2Fwww.xxx.com | 指机场所提供的订阅链接或代理节点的分享链接,需要经过 [URLEncode](https://www.urlencoder.org/) 处理,**可选的前提是在 `default_url` 中进行指定**。也可以使用 data URI。可使用 `tag:xxx,https%3A%2F%2Fwww.xxx.com` 指定该订阅的所有节点归属于`xxx`分组,用于配置文件中的`!!GROUP=XXX` 匹配 |
|
||||
| group | 可选 | MySS | 用于设置该订阅的组名,多用于 SSD/SSR |
|
||||
@@ -303,7 +324,7 @@ http://127.0.0.1:25500/sub?target=%TARGET%&url=%URL%&emoji=%EMOJI%····
|
||||
| emoji | 可选 | true / false | 用于设置节点名称是否包含 Emoji,默认为 true |
|
||||
| add_emoji | 可选 | true / false | 用于在节点名称前加入 Emoji,默认为 true |
|
||||
| remove_emoji | 可选 | true / false | 用于设置是否删除节点名称中原有的 Emoji,默认为 true |
|
||||
| append_type | 可选 | true / false | 用于在节点名称前插入节点类型,如 [SS],[SSR] 等 |
|
||||
| append_type | 可选 | true / false | 用于在节点名称前插入节点类型,如 `[SS]`,`[SSR]`等 |
|
||||
| tfo | 可选 | true / false | 用于开启该订阅链接的 TCP Fast Open,默认为 false |
|
||||
| udp | 可选 | true / false | 用于开启该订阅链接的 UDP,默认为 false |
|
||||
| list | 可选 | true / false | 用于输出 Surge Node List 或者 Clash Proxy Provider 或者 Quantumult (X) 的节点订阅 或者 解码后的 SIP002 |
|
||||
@@ -355,7 +376,7 @@ http://127.0.0.1:25500/getprofile?name=%NAME%&token=%TOKEN%
|
||||
#### 调用说明 (档案)
|
||||
|
||||
| 调用参数 | 必要性 | 示例 | 解释 |
|
||||
| -------- | :----: | :------------------------ | :---------------------------------------------------------------------------------------------------------- |
|
||||
| ----- | :-: | :------------------------ | :----------------------------------------------------------------------------- |
|
||||
| name | 必要 | profiles/formyairport.ini | 指配置档案的存储位置(可使用基于**pref 配置文件**的相对位置) |
|
||||
| token | 必要 | passwd | 为了安全考虑**必须设置token**(详见 [配置文件](#配置文件) 中 `[common] 部分` 对 `api_access_token` 的描述) |
|
||||
|
||||
@@ -380,6 +401,7 @@ exclude=(流量|官网)
|
||||
```
|
||||
|
||||
在编辑并保存好 `formyairport.ini` 后,即可使用 `http://127.0.0.1:25500/getprofile?name=profiles/formyairport.ini&token=passwd` 进行调用。
|
||||
|
||||
</details>
|
||||
|
||||
### 配置文件
|
||||
@@ -405,7 +427,7 @@ exclude=(流量|官网)
|
||||
|
||||
- 当值为 `false` 时, 每次更新配置都会读取 主程序目录中的配置文件 , 为 `true` 时则仅启动时读取。
|
||||
|
||||
1. **api_access_token**
|
||||
2. **api_access_token**
|
||||
|
||||
> 用于访问相对隐私的接口(如 `/getprofile`)
|
||||
|
||||
@@ -415,7 +437,7 @@ exclude=(流量|官网)
|
||||
api_access_token=passwd
|
||||
```
|
||||
|
||||
1. **default_url**
|
||||
3. **default_url**
|
||||
|
||||
> 无 %URL% 参数时,默认加载的订阅链接, **不需要 URLEncode**。
|
||||
>
|
||||
@@ -436,13 +458,13 @@ exclude=(流量|官网)
|
||||
http://127.0.0.1:25500/sub?target=clash&url=https%3A%2F%2Fdler.cloud%2Fsubscribe%2FABCDE%3Fclash%3Dvmess
|
||||
```
|
||||
|
||||
1. **enable_insert**
|
||||
4. **enable_insert**
|
||||
|
||||
> 设置是否为输出的订阅添加 `insert_url` 中所有的节点
|
||||
|
||||
- 当值为 `true` 时, 会在输出的订阅中添加 `insert_url` 中所有的节点, 为 `false` 时不添加。
|
||||
|
||||
1. **insert_url**
|
||||
5. **insert_url**
|
||||
|
||||
> 当 `enable_insert` 的值为 `true` 时,无论是否具有 %URL% 参数时,都会在添加订阅前加入的节点, **不需要 URLEncode**。
|
||||
>
|
||||
@@ -457,13 +479,13 @@ exclude=(流量|官网)
|
||||
insert_url=ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpwYXNzd29yZA@www.example.com:1080#Example
|
||||
```
|
||||
|
||||
1. **prepend_insert_url**
|
||||
6. **prepend_insert_url**
|
||||
|
||||
> 设置为输出的订阅添加 `insert_url` 中的节点时是否添加至所有节点前方
|
||||
|
||||
- 当值为 `true` 时, 会在输出的订阅中所有节点的前方添加 `insert_url` 中所有的节点, 为 `false` 时在后方添加。
|
||||
|
||||
1. **exclude_remarks**
|
||||
7. **exclude_remarks**
|
||||
|
||||
> 排除匹配到的节点,支持正则匹配
|
||||
|
||||
@@ -473,7 +495,7 @@ exclude=(流量|官网)
|
||||
exclude_remarks=(到期|剩余流量|时间|官网|产品|平台)
|
||||
```
|
||||
|
||||
1. **include_remarks**
|
||||
8. **include_remarks**
|
||||
|
||||
> 仅保留匹配到的节点,支持正则匹配
|
||||
|
||||
@@ -483,13 +505,13 @@ exclude=(流量|官网)
|
||||
include_remarks=(?<=美).*(BGP|GIA|IPLC)
|
||||
```
|
||||
|
||||
1. **enable_filter**
|
||||
9. **enable_filter**
|
||||
|
||||
> 设置为所有节点使用自定义的js代码进行筛选
|
||||
|
||||
- 当值为 `true` 时, 为所有节点使用自定义的js代码进行筛选, 为 `false` 时不使用。
|
||||
|
||||
1. **filter_script**
|
||||
10. **filter_script**
|
||||
|
||||
> 为所有节点使用自定义的js函数进行筛选
|
||||
>
|
||||
@@ -508,7 +530,7 @@ exclude=(流量|官网)
|
||||
|
||||
- node对象包含节点的全部信息,具体结构参见[此处](https://github.com/netchx/netch/blob/268bdb7730999daf9f27b4a81cfed5c36366d1ce/GSF.md)
|
||||
|
||||
1. **default_external_config**
|
||||
11. **default_external_config**
|
||||
|
||||
> 如果未指定外部配置文件,则将其设置为默认值。支持 `本地文件` 和 `在线URL`
|
||||
|
||||
@@ -518,7 +540,7 @@ exclude=(流量|官网)
|
||||
default_external_config=config/example_external_config.ini
|
||||
```
|
||||
|
||||
1. **base_path**
|
||||
12. **base_path**
|
||||
|
||||
> 限制外部配置可以使用的本地配置文件基础路径。
|
||||
|
||||
@@ -529,7 +551,7 @@ exclude=(流量|官网)
|
||||
#外部配置只可以使用base文件夹下的本地配置文件基础
|
||||
```
|
||||
|
||||
1. **clash_rule_base**
|
||||
13. **clash_rule_base**
|
||||
|
||||
> 生成的 Clash 配置文件模板。支持 `本地文件` 和 `在线URL`
|
||||
|
||||
@@ -542,33 +564,33 @@ exclude=(流量|官网)
|
||||
# 加载ACL4SSR的 Github 中相关文件作为模板
|
||||
```
|
||||
|
||||
1. **surge_rule_base**
|
||||
14. **surge_rule_base**
|
||||
|
||||
> 生成的 Surge 配置文件模板,用法同上
|
||||
|
||||
1. **surfboard_rule_base**
|
||||
15. **surfboard_rule_base**
|
||||
|
||||
> 生成的 Surfboard 配置文件模板,用法同上
|
||||
|
||||
1. **mellow_rule_base**
|
||||
16. **mellow_rule_base**
|
||||
|
||||
> 生成的 Mellow 配置文件模板,用法同上
|
||||
|
||||
1. **loon_rule_base**
|
||||
17. **loon_rule_base**
|
||||
|
||||
> 生成的 Loon 配置文件模板,用法同上
|
||||
|
||||
1. **sssub_rule_base**
|
||||
18. **sssub_rule_base**
|
||||
|
||||
> 生成的 sssub 配置文件模板,用法同上
|
||||
|
||||
1. **proxy_config**
|
||||
19. **proxy_config**
|
||||
|
||||
> 更新 外部配置文件 时是否使用代理
|
||||
>
|
||||
> 填写 `NONE` 或者空白禁用,或者填写 `SYSTEM` 使用系统代理
|
||||
>
|
||||
> 支持HTTP 或 SOCKS 代理(http:// https:// socks4a:// socks5://)
|
||||
> 支持HTTP 或 SOCKS 代理(http:// https:// socks4a:// socks5://)
|
||||
>
|
||||
> 支持CORS代理(cors:),详细参见[cors-anywhere](https://github.com/Rob--W/cors-anywhere)、[cloudflare-cors-anywhere](https://github.com/Zibri/cloudflare-cors-anywhere)等
|
||||
|
||||
@@ -582,17 +604,17 @@ exclude=(流量|官网)
|
||||
proxy_config=cors:https://cors-anywhere.herokuapp.com/ # 使用CORS代理
|
||||
```
|
||||
|
||||
1. **proxy_ruleset**
|
||||
20. **proxy_ruleset**
|
||||
|
||||
> 更新 规则 时是否使用代理,用法同上
|
||||
|
||||
1. **proxy_subscription**
|
||||
21. **proxy_subscription**
|
||||
|
||||
> 更新 原始订阅 时是否使用代理,用法同上
|
||||
|
||||
1. **append_proxy_type**
|
||||
22. **append_proxy_type**
|
||||
|
||||
> 节点名称是否需要加入属性,设置为 true 时在节点名称前加入 \[SS\] \[SSR\] \[VMess\] 以作区别,
|
||||
> 节点名称是否需要加入属性,设置为 true 时在节点名称前加入 \[SS] \[SSR] \[VMess] 以作区别,
|
||||
>
|
||||
> 默认为 false
|
||||
|
||||
@@ -656,29 +678,29 @@ exclude=(流量|官网)
|
||||
|
||||
- 当不清楚机场的设置时**请勿调整此项**。
|
||||
|
||||
1. **tcp_fast_open_flag**
|
||||
2. **tcp_fast_open_flag**
|
||||
|
||||
> 为节点打开 TFO (TCP Fast Open) 模式,设置为 true 时打开,默认为 false
|
||||
|
||||
- 当不清楚机场的设置时**请勿调整此项**。
|
||||
|
||||
1. **skip_cert_verify_flag**
|
||||
3. **skip_cert_verify_flag**
|
||||
|
||||
> 关闭 TLS 节点的证书检查,设置为 true 时打开,默认为 false
|
||||
|
||||
- **请勿随意将此设置修改为 true**
|
||||
|
||||
1. **tls13_flag**
|
||||
4. **tls13_flag**
|
||||
|
||||
> 为节点增加tls1.3开启参数,设置为 true 时打开,默认为 false
|
||||
|
||||
- **请勿随意将此设置修改为 true**
|
||||
|
||||
1. **sort_flag**
|
||||
5. **sort_flag**
|
||||
|
||||
> 对生成的订阅中的节点按节点名进行 A-Z 的排序,设置为 true 时打开,默认为 false
|
||||
|
||||
1. **sort_script**
|
||||
6. **sort_script**
|
||||
|
||||
> 对生成的订阅中的节点按自定义js函数进行排序
|
||||
>
|
||||
@@ -686,7 +708,7 @@ exclude=(流量|官网)
|
||||
>
|
||||
> js函数包括2个参数,即2个节点,函数返回为true时,节点a排在节点b的前方
|
||||
>
|
||||
> 具体细节参照[common] 部分**filter_script**中的介绍
|
||||
> 具体细节参照 `[common]` 部分**filter_script**中的介绍
|
||||
|
||||
- 例如:
|
||||
|
||||
@@ -696,23 +718,23 @@ exclude=(流量|官网)
|
||||
sort_script="path:/path/to/script.js"
|
||||
```
|
||||
|
||||
1. **filter_deprecated_nodes**
|
||||
7. **filter_deprecated_nodes**
|
||||
|
||||
> 排除当前 **`target=`** 不支持的节点类型,设置为 true 时打开,默认为 false
|
||||
|
||||
- 可以考虑设置为 true,从而在**一定程度上避免出现兼容问题**
|
||||
|
||||
1. **append_sub_userinfo**
|
||||
8. **append_sub_userinfo**
|
||||
|
||||
> 在 header 里的加入流量信息 (Quanx, Surge 等读取后可以显示流量信息通知),设置为 true 时打开,默认为 true
|
||||
|
||||
1. **clash_use_new_field_name**
|
||||
9. **clash_use_new_field_name**
|
||||
|
||||
> 启用 Clash 的新区块名称 (proxies, proxy-groups, rules),设置为 true 时打开,默认为 true
|
||||
|
||||
- Clash内核在v0.19.0版本时开始启用新区块名称,当前已广泛使用v0.19.0及以上的版本,除非您确定正在使用极为古老的版本,否则请勿关闭。
|
||||
|
||||
1. **clash_proxies_style**
|
||||
10. **clash_proxies_style**
|
||||
|
||||
> 在Clash配置文件中proxies的生成风格
|
||||
>
|
||||
@@ -733,7 +755,7 @@ exclude=(流量|官网)
|
||||
[{name: name1, key: value},{name: name2, key: value}]
|
||||
```
|
||||
|
||||
1. **rename_node**
|
||||
11. **rename_node**
|
||||
|
||||
> 重命名节点,支持正则匹配
|
||||
>
|
||||
@@ -741,7 +763,7 @@ exclude=(流量|官网)
|
||||
>
|
||||
> 可以使用自定义的js函数进行重命名
|
||||
>
|
||||
> 具体细节参照[common] 部分**filter_script**中的介绍
|
||||
> 具体细节参照 `[common]` 部分**filter_script**中的介绍
|
||||
|
||||
- 例如:
|
||||
|
||||
@@ -769,7 +791,7 @@ exclude=(流量|官网)
|
||||
|
||||
> 是否将 '#!MANAGED-CONFIG' 信息附加到 Surge 或 Surfboard 配置,设置为 true 时打开,默认为 true
|
||||
|
||||
1. **managed_config_prefix**
|
||||
2. **managed_config_prefix**
|
||||
|
||||
> 具体的 '#!MANAGED-CONFIG' 信息,地址前缀不用添加 "/"。
|
||||
>
|
||||
@@ -783,7 +805,7 @@ exclude=(流量|官网)
|
||||
managed_config_prefix = http://192.168.1.5:25500
|
||||
```
|
||||
|
||||
1. **config_update_interval**
|
||||
3. **config_update_interval**
|
||||
|
||||
> 托管配置更新间隔,确定配置将更新多长时间,单位为秒
|
||||
|
||||
@@ -794,11 +816,11 @@ exclude=(流量|官网)
|
||||
# 每 86400 秒更新一次(即一天)
|
||||
```
|
||||
|
||||
1. **config_update_strict**
|
||||
4. **config_update_strict**
|
||||
|
||||
> 如果 config_update_strict 为 true,则 Surge 将在上述间隔后要求强制更新。
|
||||
|
||||
1. **quanx_device_id**
|
||||
5. **quanx_device_id**
|
||||
|
||||
> 用于重写 Quantumult X 远程 JS 中的设备 ID,该 ID 在 Quantumult X 设置中自行查找
|
||||
|
||||
@@ -822,11 +844,11 @@ exclude=(流量|官网)
|
||||
|
||||
> 是否在节点名称前加入下面自定义的 Emoji,设置为 true 时打开,默认为 true
|
||||
|
||||
1. **remove_old_emoji**
|
||||
2. **remove_old_emoji**
|
||||
|
||||
> 是否移除原有订阅中存在的 Emoji,设置为 true 时打开,默认为 true
|
||||
|
||||
1. **rule**
|
||||
3. **rule**
|
||||
|
||||
> 在匹配到的节点前添加自定义 emojis,支持正则匹配
|
||||
|
||||
@@ -854,15 +876,15 @@ exclude=(流量|官网)
|
||||
|
||||
> 启用自定义规则集的**总开关**,设置为 true 时打开,默认为 true
|
||||
|
||||
1. **overwrite_original_rules**
|
||||
2. **overwrite_original_rules**
|
||||
|
||||
> 覆盖原有规则,即 [common] 中 xxx_rule_base 中的内容,设置为 true 时打开,默认为 false
|
||||
> 覆盖原有规则,即 `[common]` 中 xxx_rule_base 中的内容,设置为 true 时打开,默认为 false
|
||||
|
||||
1. **update_ruleset_on_request**
|
||||
3. **update_ruleset_on_request**
|
||||
|
||||
> 根据请求执行规则集更新,设置为 true 时打开,默认为 false
|
||||
|
||||
1. **ruleset**
|
||||
4. **ruleset**
|
||||
|
||||
> 从本地或 url 获取规则片段
|
||||
>
|
||||
@@ -872,7 +894,7 @@ exclude=(流量|官网)
|
||||
>
|
||||
> type留空时默认为surge类型的规则
|
||||
>
|
||||
> [] 前缀后的文字将被当作规则,而不是链接或路径,主要包含 `[]GEOIP` 和 `[]MATCH`(等同于 `[]FINAL`)。
|
||||
> \[] 前缀后的文字将被当作规则,而不是链接或路径,主要包含 `[]GEOIP` 和 `[]MATCH`(等同于 `[]FINAL`)。
|
||||
|
||||
- 例如:
|
||||
|
||||
@@ -899,10 +921,9 @@ exclude=(流量|官网)
|
||||
<details>
|
||||
<summary><b>[proxy_group] 部分</b></summary>
|
||||
|
||||
|
||||
> 为 Clash 、Mellow 、Surge 以及 Surfboard 等程序创建策略组, 可用正则来筛选节点
|
||||
>
|
||||
> [] 前缀后的文字将被当作引用策略组
|
||||
> \[] 前缀后的文字将被当作引用策略组
|
||||
|
||||
```ini
|
||||
custom_proxy_group=Group_Name`url-test|fallback|load-balance`Rule_1`Rule_2`...`test_url`interval[,timeout][,tolerance]
|
||||
@@ -942,6 +963,7 @@ custom_proxy_group=节点选择`select`(^(?!.*(美国|日本)).*)
|
||||
custom_proxy_group=v2ray`select`!!GROUP=V2RayProvider
|
||||
# 表示创建一个叫 v2ray 的 select 策略组,并向其中依次添加订阅链接中组名(tag)为 V2RayProvider 的所有节点
|
||||
```
|
||||
|
||||
注意:此处的订阅链接指 `default_url` 和 `&url=` 中的订阅以及单链接节点(区别于配置文件中 insert_url)
|
||||
|
||||
- 现在也可以使用2个条件组合来进行筛选,只有同时满足这2个筛选条件的节点才会被加入组内
|
||||
@@ -965,8 +987,6 @@ custom_proxy_group=节点选择`select`(^(?!.*(美国|日本)).*)
|
||||
# 使用本地的snippets/groups.txt文件
|
||||
```
|
||||
|
||||
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
@@ -999,7 +1019,6 @@ custom_proxy_group=节点选择`select`(^(?!.*(美国|日本)).*)
|
||||
|
||||
> 该部分主要涉及到的内容为 **定时执行js文件中的代码**
|
||||
|
||||
|
||||
1. **task**
|
||||
|
||||
> 在服务器运行期间定期执行的任务。
|
||||
@@ -1023,11 +1042,11 @@ custom_proxy_group=节点选择`select`(^(?!.*(美国|日本)).*)
|
||||
|
||||
> 绑定到 Web 服务器的地址,将地址设为 0.0.0.0,则局域网内设备均可使用
|
||||
|
||||
1. **port**
|
||||
2. **port**
|
||||
|
||||
> 绑定到 Web 服务器地址的端口,默认为 25500
|
||||
|
||||
1. **serve_file_root**
|
||||
3. **serve_file_root**
|
||||
|
||||
> Web服务器的根目录,可以为包含静态页面的文件夹,留空则为关闭
|
||||
|
||||
@@ -1042,7 +1061,7 @@ custom_proxy_group=节点选择`select`(^(?!.*(美国|日本)).*)
|
||||
|
||||
> 对**子模板**文件的所在位置(即模板文件中使用 `{% include "xxx.tpl" %}` 引入的模板)做出路径限制
|
||||
|
||||
1. **clash.dns 等**
|
||||
2. **clash.dns 等**
|
||||
|
||||
> 名称可以为任意非本程序默认的参数,用来对模板中的值进行判断或在模板中使用其定义的参数
|
||||
|
||||
@@ -1058,60 +1077,58 @@ custom_proxy_group=节点选择`select`(^(?!.*(美国|日本)).*)
|
||||
|
||||
> 日志级别,可选值有:fatal error warn info debug verbose
|
||||
|
||||
1. **print_debug_info**
|
||||
2. **print_debug_info**
|
||||
|
||||
> 是否打印debug信息
|
||||
|
||||
1. **max_pending_connections**
|
||||
3. **max_pending_connections**
|
||||
|
||||
> 最大挂起连接数
|
||||
|
||||
1. **max_concurrent_threads**
|
||||
4. **max_concurrent_threads**
|
||||
|
||||
> 最大线程数
|
||||
|
||||
1. **max_allowed_rulesets**
|
||||
5. **max_allowed_rulesets**
|
||||
|
||||
> 规则集数量上限,0表示无限
|
||||
|
||||
1. **max_allowed_rules**
|
||||
6. **max_allowed_rules**
|
||||
|
||||
> 规则数量上限,0表示无限
|
||||
|
||||
1. **max_allowed_download_size**
|
||||
7. **max_allowed_download_size**
|
||||
|
||||
> subconverter下载外部文件时的文件大小上限,超过时直接忽略该文件,单位bytes,0表示无限
|
||||
|
||||
1. **enable_cache**
|
||||
8. **enable_cache**
|
||||
|
||||
> 是否启用缓存
|
||||
|
||||
1. **cache_subscription**
|
||||
9. **cache_subscription**
|
||||
|
||||
> 当启用缓存时,订阅文件的缓存时间
|
||||
|
||||
1. **cache_config**
|
||||
10. **cache_config**
|
||||
|
||||
> 当启用缓存时,外部配置文件的缓存时间
|
||||
|
||||
1. **cache_ruleset**
|
||||
11. **cache_ruleset**
|
||||
|
||||
> 当启用缓存时,规则集的缓存时间
|
||||
|
||||
1. **script_clean_context**
|
||||
12. **script_clean_context**
|
||||
|
||||
> script脚本是否使用干净上下文
|
||||
|
||||
1. **async_fetch_ruleset**
|
||||
13. **async_fetch_ruleset**
|
||||
|
||||
> 并行下载规则集
|
||||
|
||||
1. **skip_failed_links**
|
||||
14. **skip_failed_links**
|
||||
|
||||
> 跳过失败的链接,继续转换而不是直接返回错误
|
||||
|
||||
|
||||
|
||||
</details>
|
||||
|
||||
### 外部配置
|
||||
@@ -1232,7 +1249,7 @@ clash_rule_base=base/forcerule.yml
|
||||
# 获取 配置文件 中 clash.http_port 的值
|
||||
```
|
||||
|
||||
1. 单判断
|
||||
2. 单判断
|
||||
|
||||
```inja
|
||||
{% if request.clash.dns == "1" %}
|
||||
@@ -1241,7 +1258,7 @@ clash_rule_base=base/forcerule.yml
|
||||
# 如果 URL 中的 clash.dns=1 时,判断成立
|
||||
```
|
||||
|
||||
1. 或判断
|
||||
3. 或判断
|
||||
|
||||
```inja
|
||||
{% if request.target == "clash" or request.target == "clashr" %}
|
||||
@@ -1250,7 +1267,7 @@ clash_rule_base=base/forcerule.yml
|
||||
# 如果 URL 中的 target 为 clash 或者 clashr 时,判断成立
|
||||
```
|
||||
|
||||
1. 如果...否则...
|
||||
4. 如果...否则...
|
||||
|
||||
```inja
|
||||
{% if local.clash.new_field_name == "true" %}
|
||||
@@ -1265,7 +1282,7 @@ clash_rule_base=base/forcerule.yml
|
||||
# 如果 外部配置中 clash.new_field_name=true 时,启用 新的 Clash 块名称,否则使用旧的名称
|
||||
```
|
||||
|
||||
1. 如果存在...则...(可避免请求中无对应参数时发生的报错)
|
||||
5. 如果存在...则...(可避免请求中无对应参数时发生的报错)
|
||||
|
||||
```inja
|
||||
{% if exists("request.clash.dns") %}
|
||||
@@ -1276,7 +1293,7 @@ clash_rule_base=base/forcerule.yml
|
||||
# 如果 URL 中存在对 clash.dns 参数的任意指定时,判断成立 (可以和 如果···否则··· 等判断一起使用)
|
||||
```
|
||||
|
||||
1. 单判断,且如果参数不存在时使用默认值进行判断(可避免请求中无对应参数时发生的报错)
|
||||
6. 单判断,且如果参数不存在时使用默认值进行判断(可避免请求中无对应参数时发生的报错)
|
||||
|
||||
```inja
|
||||
dns:
|
||||
@@ -1303,7 +1320,7 @@ clash_rule_base=base/forcerule.yml
|
||||
# 当配置文件中设定了 `clash.socks_port` 值时,将被引用
|
||||
```
|
||||
|
||||
1. 从 外部配置 中获取,判断前缀为 `local`
|
||||
2. 从 外部配置 中获取,判断前缀为 `local`
|
||||
|
||||
```inja
|
||||
{% if local.clash.new_field_name =="true" %}
|
||||
@@ -1312,7 +1329,7 @@ clash_rule_base=base/forcerule.yml
|
||||
# 当外部配置中设定了 `clash.new_field_name=true` 时,该判断生效,其包含的···内容被引用
|
||||
```
|
||||
|
||||
1. 从 URL 链接中获取,判断前缀为 `request`,例如 `http://127.0.0.1:25500/sub?target=clash&url=www.xxx.com&clash.dns=1`
|
||||
3. 从 URL 链接中获取,判断前缀为 `request`,例如 `http://127.0.0.1:25500/sub?target=clash&url=www.xxx.com&clash.dns=1`
|
||||
|
||||
- 从 URL 中所获得**包含**在 [进阶链接](#进阶链接) 内的参数进行判断
|
||||
|
||||
@@ -1344,14 +1361,13 @@ http://127.0.0.1:25500/render?path=xxx&额外的调试或控制参数
|
||||
|
||||
此处 `path` 需要在 [配置文件](#配置文件) 中 `template_path` 所限定的路径内
|
||||
|
||||
|
||||
## 特别用法
|
||||
|
||||
### 本地生成
|
||||
|
||||
> 启动程序后,在本地生成对应的配置文件文本
|
||||
|
||||
在程序目录内的 [generate.ini](./base/generate.ini) 中设定文件块([xxx]),生成的文件名(path=xxx)以及其所需要包含的参数,例如:
|
||||
在程序目录内的 [generate.ini](https://github.com/tindy2013/subconverter/blob/master/base/generate.ini) 中设定文件块(`[xxx]`),生成的文件名(path=xxx)以及其所需要包含的参数,例如:
|
||||
|
||||
```ini
|
||||
[test]
|
||||
@@ -1367,13 +1383,13 @@ profile=profiles/example_profile.ini
|
||||
|
||||
使用 `subconverter -g` 启动本程序时,即可在程序根目录内生成名为 `output.conf` `output.yml` 的配置文件文本。
|
||||
|
||||
使用 `subconverter -g --artifact "test"` 启动本程序时,即可在程序根目录内仅生成上述示例中 [test] 文件块所指代的 `output.conf` 的配置文件文本。
|
||||
使用 `subconverter -g --artifact "test"` 启动本程序时,即可在程序根目录内仅生成上述示例中 `[test]` 文件块所指代的 `output.conf` 的配置文件文本。
|
||||
|
||||
### 自动上传
|
||||
|
||||
> 自动上传 gist ,可以用于 Clash For Android / Surge 等进行远程订阅
|
||||
|
||||
在程序目录内的 [gistconf.ini](./base/gistconf.ini) 中添加 `Personal Access Token`([在此创建](https://github.com/settings/tokens/new?scopes=gist&description=Subconverter))例如:
|
||||
在程序目录内的 [gistconf.ini](https://github.com/tindy2013/subconverter/blob/master/base/gistconf.ini) 中添加 `Personal Access Token`([在此创建](https://github.com/settings/tokens/new?scopes=gist&description=Subconverter))例如:
|
||||
|
||||
```ini
|
||||
[common]
|
||||
@@ -1412,19 +1428,18 @@ Gist owner: xxxx
|
||||
|
||||
> 将规则转换为指定的规则类型,用于将不同类型的规则互相转换
|
||||
|
||||
### 调用地址
|
||||
#### 调用地址 (规则转换)
|
||||
|
||||
````txt
|
||||
```txt
|
||||
http://127.0.0.1:25500/getruleset?type=%TYPE%&url=%URL%&group=%GROUP%
|
||||
````
|
||||
```
|
||||
|
||||
#### 调用说明
|
||||
#### 调用说明 (规则转换)
|
||||
|
||||
| 调用参数 | 必要性 | 示例 | 解释 |
|
||||
| -------- | :----------: | :------ | ------------------------------------------------------------ |
|
||||
| ----- | :-------: | :------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| type | 必要 | 6 | 指想要生成的规则类型,用数字表示:1为Surge,2 为 Quantumult X,3 为 Clash domain rule-provider,4 为 Clash ipcidr rule-provider,5 为 Surge DOMAIN-SET,6 为 Clash classical ruleset |
|
||||
| url | 必要 | | 指待转换的规则链接,需要经过 [Base64](https://base64.us/) 处理 |
|
||||
| group | type=2时必选 | mygroup | 规则对应的策略组名,生成Quantumult X类型(type=2)时必须提供 |
|
||||
|
||||
运行 subconverter 主程序后,按照 [调用说明](#调用说明-1) 的对应内容替换即可得到指定类型的规则。
|
||||
|
||||
运行 subconverter 主程序后, 按照 [调用地址 (规则转换)](#调用地址-规则转换) 的对应内容替换即可得到指定类型的规则。
|
||||
|
||||
Reference in New Issue
Block a user