mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-16 16:32:23 +08:00
Update documentation
This commit is contained in:
parent
6b9603227b
commit
e99741159b
|
@ -1,3 +1,3 @@
|
||||||
package constant
|
package constant
|
||||||
|
|
||||||
var Version = "1.2-beta3"
|
var Version = "1.2-beta4"
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
#### 1.2-beta4
|
||||||
|
|
||||||
|
* Add [NTP service](/configuration/ntp)
|
||||||
|
* Add Add multiple server names and multi-user support for shadowtls
|
||||||
|
* Add strict mode support for shadowtls v3
|
||||||
|
|
||||||
#### 1.2-beta3
|
#### 1.2-beta3
|
||||||
|
|
||||||
* Update QUIC v2 version number and initial salt
|
* Update QUIC v2 version number and initial salt
|
||||||
|
|
|
@ -8,6 +8,7 @@ sing-box uses JSON for configuration files.
|
||||||
{
|
{
|
||||||
"log": {},
|
"log": {},
|
||||||
"dns": {},
|
"dns": {},
|
||||||
|
"ntp": {},
|
||||||
"inbounds": [],
|
"inbounds": [],
|
||||||
"outbounds": [],
|
"outbounds": [],
|
||||||
"route": {},
|
"route": {},
|
||||||
|
@ -21,6 +22,7 @@ sing-box uses JSON for configuration files.
|
||||||
|----------------|--------------------------------|
|
|----------------|--------------------------------|
|
||||||
| `log` | [Log](./log) |
|
| `log` | [Log](./log) |
|
||||||
| `dns` | [DNS](./dns) |
|
| `dns` | [DNS](./dns) |
|
||||||
|
| `ntp` | [NTP](./ntp) |
|
||||||
| `inbounds` | [Inbound](./inbound) |
|
| `inbounds` | [Inbound](./inbound) |
|
||||||
| `outbounds` | [Outbound](./outbound) |
|
| `outbounds` | [Outbound](./outbound) |
|
||||||
| `route` | [Route](./route) |
|
| `route` | [Route](./route) |
|
||||||
|
|
50
docs/configuration/ntp/index.md
Normal file
50
docs/configuration/ntp/index.md
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
# NTP
|
||||||
|
|
||||||
|
Built-in NTP client service.
|
||||||
|
|
||||||
|
If enabled, it will provide time for protocols like TLS/Shadowsocks/VMess, which is useful for environments where time
|
||||||
|
synchronization is not possible.
|
||||||
|
|
||||||
|
### Structure
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ntp": {
|
||||||
|
"enabled": false,
|
||||||
|
"server": "ntp.apple.com",
|
||||||
|
"server_port": 123,
|
||||||
|
"interval": "30m",
|
||||||
|
|
||||||
|
... // Dial Fields
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Fields
|
||||||
|
|
||||||
|
#### enabled
|
||||||
|
|
||||||
|
Enable NTP service.
|
||||||
|
|
||||||
|
#### server
|
||||||
|
|
||||||
|
==Required==
|
||||||
|
|
||||||
|
NTP server address.
|
||||||
|
|
||||||
|
#### server_port
|
||||||
|
|
||||||
|
NTP server port.
|
||||||
|
|
||||||
|
123 is used by default.
|
||||||
|
|
||||||
|
#### interval
|
||||||
|
|
||||||
|
Time synchronization interval.
|
||||||
|
|
||||||
|
30 minutes is used by default.
|
||||||
|
|
||||||
|
### Dial Fields
|
||||||
|
|
||||||
|
See [Dial Fields](/configuration/shared/dial) for details.
|
49
docs/configuration/ntp/index.zh.md
Normal file
49
docs/configuration/ntp/index.zh.md
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
# NTP
|
||||||
|
|
||||||
|
内建的 NTP 客户端服务。
|
||||||
|
|
||||||
|
如果启用,它将为像 TLS/Shadowsocks/VMess 这样的协议提供时间,这对于无法进行时间同步的环境很有用。
|
||||||
|
|
||||||
|
### 结构
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ntp": {
|
||||||
|
"enabled": false,
|
||||||
|
"server": "ntp.apple.com",
|
||||||
|
"server_port": 123,
|
||||||
|
"interval": "30m",
|
||||||
|
|
||||||
|
... // 拨号字段
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### 字段
|
||||||
|
|
||||||
|
#### enabled
|
||||||
|
|
||||||
|
启用 NTP 服务。
|
||||||
|
|
||||||
|
#### server
|
||||||
|
|
||||||
|
==必填==
|
||||||
|
|
||||||
|
NTP 服务器地址。
|
||||||
|
|
||||||
|
#### server_port
|
||||||
|
|
||||||
|
NTP 服务器端口。
|
||||||
|
|
||||||
|
默认使用 123。
|
||||||
|
|
||||||
|
#### interval
|
||||||
|
|
||||||
|
时间同步间隔。
|
||||||
|
|
||||||
|
默认使用 30 分钟。
|
||||||
|
|
||||||
|
### 拨号字段
|
||||||
|
|
||||||
|
参阅 [拨号字段](/zh/configuration/shared/dial/)。
|
|
@ -43,6 +43,8 @@ nav:
|
||||||
- configuration/dns/index.md
|
- configuration/dns/index.md
|
||||||
- DNS Server: configuration/dns/server.md
|
- DNS Server: configuration/dns/server.md
|
||||||
- DNS Rule: configuration/dns/rule.md
|
- DNS Rule: configuration/dns/rule.md
|
||||||
|
- NTP:
|
||||||
|
- configuration/ntp/index.md
|
||||||
- Route:
|
- Route:
|
||||||
- configuration/route/index.md
|
- configuration/route/index.md
|
||||||
- GeoIP: configuration/route/geoip.md
|
- GeoIP: configuration/route/geoip.md
|
||||||
|
@ -149,21 +151,27 @@ plugins:
|
||||||
Features: 特性
|
Features: 特性
|
||||||
Support: 支持
|
Support: 支持
|
||||||
Change Log: 更新日志
|
Change Log: 更新日志
|
||||||
|
|
||||||
Configuration: 配置
|
Configuration: 配置
|
||||||
Log: 日志
|
Log: 日志
|
||||||
DNS Server: DNS 服务器
|
DNS Server: DNS 服务器
|
||||||
DNS Rule: DNS 规则
|
DNS Rule: DNS 规则
|
||||||
|
|
||||||
Route: 路由
|
Route: 路由
|
||||||
Route Rule: 路由规则
|
Route Rule: 路由规则
|
||||||
Protocol Sniff: 协议探测
|
Protocol Sniff: 协议探测
|
||||||
|
|
||||||
Experimental: 实验性
|
Experimental: 实验性
|
||||||
|
|
||||||
Shared: 通用
|
Shared: 通用
|
||||||
Listen Fields: 监听字段
|
Listen Fields: 监听字段
|
||||||
Dial Fields: 拨号字段
|
Dial Fields: 拨号字段
|
||||||
Multiplex: 多路复用
|
Multiplex: 多路复用
|
||||||
V2Ray Transport: V2Ray 传输层
|
V2Ray Transport: V2Ray 传输层
|
||||||
|
|
||||||
Inbound: 入站
|
Inbound: 入站
|
||||||
Outbound: 出站
|
Outbound: 出站
|
||||||
|
|
||||||
FAQ: 常见问题
|
FAQ: 常见问题
|
||||||
Known Issues: 已知问题
|
Known Issues: 已知问题
|
||||||
Examples: 示例
|
Examples: 示例
|
||||||
|
|
|
@ -37,7 +37,7 @@ func NewService(ctx context.Context, router adapter.Router, logger logger.Logger
|
||||||
}
|
}
|
||||||
var interval time.Duration
|
var interval time.Duration
|
||||||
if options.Interval > 0 {
|
if options.Interval > 0 {
|
||||||
interval = time.Duration(options.Interval) * time.Second
|
interval = time.Duration(options.Interval)
|
||||||
} else {
|
} else {
|
||||||
interval = 30 * time.Minute
|
interval = 30 * time.Minute
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user