@iasiv5/dsh-obmc-web 0.1.4 → 0.1.5

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/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @iasiv5/dsh-obmc-web
2
2
 
3
3
  在 DSH GUI 里使用 **BMC Web UI**(OpenBMC / bmcweb,AST2700 EVB 实测;
4
- 插件本体于 DSH Web `0.1.7-rc.2` 实测)。
4
+ 插件本体于 DSH Web `0.1.7-rc.2` 与 `0.2.1-rc.2` 实测)。
5
5
  host 半身在 DSH web 服务器的 GUI origin 上注册一组同源代理路由,经
6
6
  `obmc-web-relay.service`(SSH 本地转发,仅绑 `127.0.0.1`,端口默认
7
7
  18443、被占自动顺延)抵达 BMC;client 半身仿照 dsh-surf,在「设置」
@@ -44,6 +44,20 @@ hash 模式,因此挂在 `/bmc` 前缀下不会与 SPA 内部导航冲突。DS
44
44
  按「精确表优先、前缀最长者胜」分发,GUI 自身的路由永远优先;重复注册只
45
45
  跳过、不会让插件失败。
46
46
 
47
+ ## DSH 版本兼容
48
+
49
+ - **版本门槛**:`0.2.1` 及以上宿主需 **≥0.1.4**——0.2.1 起宿主移除 `webRuntime`
50
+ 服务(改名 `webStartup`),0.1.0–0.1.3 在其上会静默失效(插件 pending、路由 404)。
51
+ ≥0.1.4 采用非抛双服务解析(`webStartup` → `webRuntime` → `[]`),在
52
+ `0.1.x`–`0.2.1-rc.x` 宿主全线可用。本包不声明 `@deepseek-ai/dsh` 家族
53
+ peer,宿主版本守卫对其不设门槛,兼容范围以本节与市场文案为准。
54
+ - **依赖的宿主契约面**:`webServer.register/registerUpgrade`(exact/prefix、
55
+ 最长前缀分发)、客户端 `settings.section` slot、`slots` 客户端服务、
56
+ `window.__ModuleLoader__` 启动契约。配置走自有 `/bmc-config` 路由持久化,
57
+ 不触宿主 settings/credentials。
58
+ - **失效模式**:契约若在后续宿主版本变更,症状为设置面板消失(客户端 console
59
+ 报错)或路由 404,不会损坏宿主、不会无声改写数据。
60
+
47
61
  ## 安装
48
62
 
49
63
  ```bash
package/lib/index.js CHANGED
@@ -59,7 +59,7 @@ import os from 'node:os'
59
59
  import path from 'node:path'
60
60
 
61
61
  export const name = '@iasiv5/dsh-obmc-web'
62
- export const inject = ['webServer'] /* LOCAL-PATCH 2026-10-18 (know-how 035): 0.2.1 host removed webRuntime (→webStartup); trusted-hosts now resolved per-request via non-throwing dual-service fallback */
62
+ export const inject = ['webServer'] /* compat (know-how 035, shipped since 0.1.4): 0.2.1 host removed webRuntime (→webStartup); trusted-hosts now resolved per-request via non-throwing dual-service fallback */
63
63
 
64
64
  const UP_HOST = '127.0.0.1'
65
65
  const DEFAULT_RELAY_PORT = 18443
@@ -731,7 +731,7 @@ export function apply(ctx) {
731
731
  if (createdTemplate) ctx.logger?.info?.(`[dsh-obmc-web] first start: wrote a commented config template to ${ENV_FILE} — configure it in Settings → BMC 控制台`)
732
732
  Object.assign(envConfig, readEnvConfig())
733
733
  bmcState.target = envConfig.bmcTarget
734
- /* LOCAL-PATCH 2026-10-18 (know-how 035): was `ctx.webRuntime?.trustedHosts` (0.2.1 host removed webRuntime; cordis Local throws on un-injected property access, `?.` cannot protect). 034 pattern: non-throwing ctx.get lookup, webStartup (0.2.1+) → webRuntime (≤0.2.0) → []. */
734
+ /* compat (know-how 035, shipped since 0.1.4): was `ctx.webRuntime?.trustedHosts` (0.2.1 host removed webRuntime; cordis Local throws on un-injected property access, `?.` cannot protect). 034 pattern: non-throwing ctx.get lookup, webStartup (0.2.1+) → webRuntime (≤0.2.0) → []. */
735
735
  const resolveTrustedHosts = () => {
736
736
  let startup, runtime
737
737
  try { startup = ctx?.get?.('webStartup') } catch {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iasiv5/dsh-obmc-web",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "OpenBMC 控制台入口:设置一级菜单「BMC 控制台」面板一键在顶层标签页打开 BMC Web UI,同源代理经 SSH 本地转发 relay(obmc-web-relay)抵达 BMC,BMC IP 变化自动探测并重定向隧道;需 SSH 跳板机可达 BMC。",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",