浏览代码

Update documentation

世界 2 年之前
父节点
当前提交
e99741159b
共有 7 个文件被更改,包括 117 次插入2 次删除
  1. 1 1
      constant/version.go
  2. 6 0
      docs/changelog.md
  3. 2 0
      docs/configuration/index.md
  4. 50 0
      docs/configuration/ntp/index.md
  5. 49 0
      docs/configuration/ntp/index.zh.md
  6. 8 0
      mkdocs.yml
  7. 1 1
      ntp/service.go

+ 1 - 1
constant/version.go

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

+ 6 - 0
docs/changelog.md

@@ -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

+ 2 - 0
docs/configuration/index.md

@@ -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)               |

+ 50 - 0
docs/configuration/ntp/index.md

@@ -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 - 0
docs/configuration/ntp/index.zh.md

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

+ 8 - 0
mkdocs.yml

@@ -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: 示例

+ 1 - 1
ntp/service.go

@@ -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
 	}