Update documentation

This commit is contained in:
世界 2023-02-21 20:20:17 +08:00
parent 6b9603227b
commit e99741159b
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
7 changed files with 117 additions and 2 deletions

View file

@ -1,3 +1,3 @@
package constant
var Version = "1.2-beta3"
var Version = "1.2-beta4"

View file

@ -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
* Update QUIC v2 version number and initial salt

View file

@ -8,6 +8,7 @@ sing-box uses JSON for configuration files.
{
"log": {},
"dns": {},
"ntp": {},
"inbounds": [],
"outbounds": [],
"route": {},
@ -21,6 +22,7 @@ sing-box uses JSON for configuration files.
|----------------|--------------------------------|
| `log` | [Log](./log) |
| `dns` | [DNS](./dns) |
| `ntp` | [NTP](./ntp) |
| `inbounds` | [Inbound](./inbound) |
| `outbounds` | [Outbound](./outbound) |
| `route` | [Route](./route) |

View 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.

View 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/)。

View file

@ -43,6 +43,8 @@ nav:
- configuration/dns/index.md
- DNS Server: configuration/dns/server.md
- DNS Rule: configuration/dns/rule.md
- NTP:
- configuration/ntp/index.md
- Route:
- configuration/route/index.md
- GeoIP: configuration/route/geoip.md
@ -149,21 +151,27 @@ plugins:
Features: 特性
Support: 支持
Change Log: 更新日志
Configuration: 配置
Log: 日志
DNS Server: DNS 服务器
DNS Rule: DNS 规则
Route: 路由
Route Rule: 路由规则
Protocol Sniff: 协议探测
Experimental: 实验性
Shared: 通用
Listen Fields: 监听字段
Dial Fields: 拨号字段
Multiplex: 多路复用
V2Ray Transport: V2Ray 传输层
Inbound: 入站
Outbound: 出站
FAQ: 常见问题
Known Issues: 已知问题
Examples: 示例

View file

@ -37,7 +37,7 @@ func NewService(ctx context.Context, router adapter.Router, logger logger.Logger
}
var interval time.Duration
if options.Interval > 0 {
interval = time.Duration(options.Interval) * time.Second
interval = time.Duration(options.Interval)
} else {
interval = 30 * time.Minute
}