@twinsearth/dsh-2xray 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.3 — 2026-10-29
4
+
5
+ ### 健康检查与发布
6
+
7
+ - 新增鉴权端点 `GET /api/xray/healthz`:返回 `v0.3.3`、运行状态与路由接管状态。
8
+ - Release 增加公开静态资产 `healthz.json`(`version: v0.3.3`),供部署流水线探针使用。
9
+ - 包含 0.3.1 的端口护栏与 geodata 降级修复(0.3.2 未单独发布)。
10
+
3
11
  ## 0.3.1 — 2026-10-29
4
12
 
5
13
  ### 修复
package/README.md CHANGED
@@ -334,6 +334,11 @@ v0.2.0 提供两个入口,互不替代:
334
334
 
335
335
  维护者用 `tools/build-core-packages.mjs` 从官方 zip 生成平台包;`.github/workflows/core-packages.yml` 会在具备 `NPM_TOKEN` secret 时自动下载、校验并发布各平台包。
336
336
 
337
+ ## 健康检查
338
+
339
+ - 进程内(需 DSH 会话鉴权):`GET /api/xray/healthz` → `{ "ok": true, "version": "v0.3.3", ... }`
340
+ - 发布物(公开、静态):Release 资产 `healthz.json`,`version` 与 tag 一致,可用于部署流水线的健康探针。
341
+
337
342
  ## 更新
338
343
 
339
344
  设置页 2Xray 里有三个入口:
package/index.js CHANGED
@@ -233,6 +233,25 @@ export function apply(ctx, rawConfig) {
233
233
  }),
234
234
  'dsh-2xray: update api',
235
235
  )
236
+ child.effect(
237
+ () =>
238
+ child.connection.fetch.register({
239
+ path: '/api/xray/healthz',
240
+ methods: ['GET'],
241
+ fetch: () => {
242
+ const snapshot = supervisor.snapshot()
243
+ return Response.json({
244
+ ok: true,
245
+ service: 'dsh-2xray',
246
+ version: `v${updateState.current}`,
247
+ state: snapshot.state,
248
+ ready: snapshot.state === 'ready',
249
+ routeInstalled: snapshot.route?.installed === true,
250
+ })
251
+ },
252
+ }),
253
+ 'dsh-2xray: healthz api',
254
+ )
236
255
  } catch (error) {
237
256
  logger.warn(`状态 API 注册失败:${String(error)}`)
238
257
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twinsearth/dsh-2xray",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "private": false,
5
5
  "description": "DSH-2Xray: supervises xray-core and routes DSH process-wide HTTP(S) traffic through its local inbound, with optional multi-node gRPC control plane",
6
6
  "type": "module",