Add inline rule-set & Add reload for local rule-set

This commit is contained in:
世界
2024-06-26 00:43:51 +08:00
parent 6bebe2483b
commit 3a7acaa92a
14 changed files with 311 additions and 280 deletions

View File

@@ -1,48 +1,56 @@
---
icon: material/new-box
---
!!! quote "Changes in sing-box 1.10.0"
:material-plus: `type: inline`
# rule-set
!!! question "Since sing-box 1.8.0"
### Structure
```json
{
"type": "",
"tag": "",
"format": "",
... // Typed Fields
}
```
=== "Inline"
#### Local Structure
!!! question "Since sing-box 1.10.0"
```json
{
"type": "local",
...
"path": ""
}
```
```json
{
"type": "inline", // optional
"tag": "",
"rules": []
}
```
#### Remote Structure
=== "Local File"
!!! info ""
```json
{
"type": "local",
"tag": "",
"format": "source", // or binary
"path": ""
}
```
Remote rule-set will be cached if `experimental.cache_file.enabled`.
=== "Remote File"
```json
{
"type": "remote",
...,
"url": "",
"download_detour": "",
"update_interval": ""
}
```
!!! info ""
Remote rule-set will be cached if `experimental.cache_file.enabled`.
```json
{
"type": "remote",
"tag": "",
"format": "source", // or binary
"url": "",
"download_detour": "", // optional
"update_interval": "" // optional
}
```
### Fields
@@ -58,11 +66,23 @@ Type of rule-set, `local` or `remote`.
Tag of rule-set.
### Inline Fields
!!! question "Since sing-box 1.10.0"
#### rules
==Required==
List of [Headless Rule](./headless-rule.md/).
### Local or Remote Fields
#### format
==Required==
Format of rule-set, `source` or `binary`.
Format of rule-set file, `source` or `binary`.
### Local Fields
@@ -70,6 +90,10 @@ Format of rule-set, `source` or `binary`.
==Required==
!!! note ""
Will be automatically reloaded if file modified since sing-box 1.10.0.
File path of rule-set.
### Remote Fields

View File

@@ -178,6 +178,10 @@ The server certificate line array, in PEM format.
#### certificate_path
!!! note ""
Will be automatically reloaded if file modified.
The path to the server certificate, in PEM format.
#### key
@@ -190,6 +194,10 @@ The server private key line array, in PEM format.
==Server only==
!!! note ""
Will be automatically reloaded if file modified.
The path to the server private key, in PEM format.
## Custom TLS support
@@ -266,6 +274,10 @@ ECH key line array, in PEM format.
==Server only==
!!! note ""
Will be automatically reloaded if file modified.
The path to ECH key, in PEM format.
#### config
@@ -397,8 +409,4 @@ A hexadecimal string with zero to eight digits.
The maximum time difference between the server and the client.
Check disabled if empty.
### Reload
For server configuration, certificate, key and ECH key will be automatically reloaded if modified.
Check disabled if empty.

View File

@@ -176,12 +176,20 @@ TLS 版本值:
#### certificate_path
!!! note ""
文件更改时将自动重新加载。
服务器 PEM 证书路径。
#### key
==仅服务器==
!!! note ""
文件更改时将自动重新加载。
服务器 PEM 私钥行数组。
#### key_path
@@ -258,6 +266,10 @@ ECH PEM 密钥行数组
==仅服务器==
!!! note ""
文件更改时将自动重新加载。
ECH PEM 密钥路径
#### config
@@ -384,7 +396,3 @@ ACME DNS01 验证字段。如果配置,将禁用其他验证方法。
服务器与和客户端之间允许的最大时间差。
默认禁用检查。
### 重载
对于服务器配置,如果修改,证书和密钥将自动重新加载。