mirror of
https://github.com/bestnite/sub2clash.git
synced 2025-06-16 20:23:19 +08:00
remove toml and ini config type
This commit is contained in:
15
README.md
15
README.md
@ -31,15 +31,11 @@
|
|||||||
|
|
||||||
支持多种配置方式,按优先级排序:
|
支持多种配置方式,按优先级排序:
|
||||||
|
|
||||||
1. **配置文件**:支持多种格式(YAML、JSON、TOML、INI),按以下优先级搜索:
|
1. **配置文件**:支持多种格式(YAML、JSON),按以下优先级搜索:
|
||||||
- `config.yaml` / `config.yml`
|
- `config.yaml` / `config.yml`
|
||||||
- `config.json`
|
- `config.json`
|
||||||
- `config.toml`
|
|
||||||
- `config.ini`
|
|
||||||
- `sub2clash.yaml` / `sub2clash.yml`
|
- `sub2clash.yaml` / `sub2clash.yml`
|
||||||
- `sub2clash.json`
|
- `sub2clash.json`
|
||||||
- `sub2clash.toml`
|
|
||||||
- `sub2clash.ini`
|
|
||||||
2. **环境变量**:使用 `SUB2CLASH_` 前缀,例如 `SUB2CLASH_ADDRESS=0.0.0.0:8011`
|
2. **环境变量**:使用 `SUB2CLASH_` 前缀,例如 `SUB2CLASH_ADDRESS=0.0.0.0:8011`
|
||||||
3. **默认值**:内置默认配置
|
3. **默认值**:内置默认配置
|
||||||
|
|
||||||
@ -78,3 +74,12 @@
|
|||||||
|
|
||||||
- [Clash](./templates/template_clash.yaml)
|
- [Clash](./templates/template_clash.yaml)
|
||||||
- [Clash.Meta](./templates/template_meta.yaml)
|
- [Clash.Meta](./templates/template_meta.yaml)
|
||||||
|
|
||||||
|
## 开发
|
||||||
|
|
||||||
|
### 添加新协议支持
|
||||||
|
|
||||||
|
添加新协议支持需要实现以下组件:
|
||||||
|
|
||||||
|
1. 在 `parser` 目录下实现协议解析器,用于解析订阅链接
|
||||||
|
2. 在 `model/proxy` 目录下定义协议结构体和对应的序列化器,如有新增属性需在 `model/proxy/proxy.go` 中声明
|
||||||
|
@ -39,7 +39,7 @@ func LoadConfig() error {
|
|||||||
// 尝试按优先级加载不同格式的配置文件
|
// 尝试按优先级加载不同格式的配置文件
|
||||||
configLoaded := false
|
configLoaded := false
|
||||||
configNames := []string{"config", "sub2clash"}
|
configNames := []string{"config", "sub2clash"}
|
||||||
configExts := []string{"yaml", "yml", "json", "toml", "ini"}
|
configExts := []string{"yaml", "yml", "json"}
|
||||||
|
|
||||||
for _, name := range configNames {
|
for _, name := range configNames {
|
||||||
for _, ext := range configExts {
|
for _, ext := range configExts {
|
||||||
|
Reference in New Issue
Block a user