Skip to content

Commit e997411

Browse files
committed
Update documentation
1 parent 6b96032 commit e997411

File tree

7 files changed

+117
-2
lines changed

7 files changed

+117
-2
lines changed

constant/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package constant
22

3-
var Version = "1.2-beta3"
3+
var Version = "1.2-beta4"

docs/changelog.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#### 1.2-beta4
2+
3+
* Add [NTP service](/configuration/ntp)
4+
* Add Add multiple server names and multi-user support for shadowtls
5+
* Add strict mode support for shadowtls v3
6+
17
#### 1.2-beta3
28

39
* Update QUIC v2 version number and initial salt

docs/configuration/index.md

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ sing-box uses JSON for configuration files.
88
{
99
"log": {},
1010
"dns": {},
11+
"ntp": {},
1112
"inbounds": [],
1213
"outbounds": [],
1314
"route": {},
@@ -21,6 +22,7 @@ sing-box uses JSON for configuration files.
2122
|----------------|--------------------------------|
2223
| `log` | [Log](./log) |
2324
| `dns` | [DNS](./dns) |
25+
| `ntp` | [NTP](./ntp) |
2426
| `inbounds` | [Inbound](./inbound) |
2527
| `outbounds` | [Outbound](./outbound) |
2628
| `route` | [Route](./route) |

docs/configuration/ntp/index.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# NTP
2+
3+
Built-in NTP client service.
4+
5+
If enabled, it will provide time for protocols like TLS/Shadowsocks/VMess, which is useful for environments where time
6+
synchronization is not possible.
7+
8+
### Structure
9+
10+
```json
11+
{
12+
"ntp": {
13+
"enabled": false,
14+
"server": "ntp.apple.com",
15+
"server_port": 123,
16+
"interval": "30m",
17+
18+
... // Dial Fields
19+
}
20+
}
21+
22+
```
23+
24+
### Fields
25+
26+
#### enabled
27+
28+
Enable NTP service.
29+
30+
#### server
31+
32+
==Required==
33+
34+
NTP server address.
35+
36+
#### server_port
37+
38+
NTP server port.
39+
40+
123 is used by default.
41+
42+
#### interval
43+
44+
Time synchronization interval.
45+
46+
30 minutes is used by default.
47+
48+
### Dial Fields
49+
50+
See [Dial Fields](/configuration/shared/dial) for details.

docs/configuration/ntp/index.zh.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# NTP
2+
3+
内建的 NTP 客户端服务。
4+
5+
如果启用,它将为像 TLS/Shadowsocks/VMess 这样的协议提供时间,这对于无法进行时间同步的环境很有用。
6+
7+
### 结构
8+
9+
```json
10+
{
11+
"ntp": {
12+
"enabled": false,
13+
"server": "ntp.apple.com",
14+
"server_port": 123,
15+
"interval": "30m",
16+
17+
... // 拨号字段
18+
}
19+
}
20+
21+
```
22+
23+
### 字段
24+
25+
#### enabled
26+
27+
启用 NTP 服务。
28+
29+
#### server
30+
31+
==必填==
32+
33+
NTP 服务器地址。
34+
35+
#### server_port
36+
37+
NTP 服务器端口。
38+
39+
默认使用 123。
40+
41+
#### interval
42+
43+
时间同步间隔。
44+
45+
默认使用 30 分钟。
46+
47+
### 拨号字段
48+
49+
参阅 [拨号字段](/zh/configuration/shared/dial/)

mkdocs.yml

+8
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ nav:
4343
- configuration/dns/index.md
4444
- DNS Server: configuration/dns/server.md
4545
- DNS Rule: configuration/dns/rule.md
46+
- NTP:
47+
- configuration/ntp/index.md
4648
- Route:
4749
- configuration/route/index.md
4850
- GeoIP: configuration/route/geoip.md
@@ -149,21 +151,27 @@ plugins:
149151
Features: 特性
150152
Support: 支持
151153
Change Log: 更新日志
154+
152155
Configuration: 配置
153156
Log: 日志
154157
DNS Server: DNS 服务器
155158
DNS Rule: DNS 规则
159+
156160
Route: 路由
157161
Route Rule: 路由规则
158162
Protocol Sniff: 协议探测
163+
159164
Experimental: 实验性
165+
160166
Shared: 通用
161167
Listen Fields: 监听字段
162168
Dial Fields: 拨号字段
163169
Multiplex: 多路复用
164170
V2Ray Transport: V2Ray 传输层
171+
165172
Inbound: 入站
166173
Outbound: 出站
174+
167175
FAQ: 常见问题
168176
Known Issues: 已知问题
169177
Examples: 示例

ntp/service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func NewService(ctx context.Context, router adapter.Router, logger logger.Logger
3737
}
3838
var interval time.Duration
3939
if options.Interval > 0 {
40-
interval = time.Duration(options.Interval) * time.Second
40+
interval = time.Duration(options.Interval)
4141
} else {
4242
interval = 30 * time.Minute
4343
}

0 commit comments

Comments
 (0)