Files
pikasTech-unidesk/docs/reference/webterm.md
T
2026-07-11 12:18:21 +02:00

25 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Webterm 配置与受控部署
- 唯一配置来源:
- `config/platform-infra/webterm.yaml` 是端口、自动标签、启动模式、浏览器历史和输出聚合策略的 owning YAML
- `build/docker-compose.<port>.yaml` 是受控 CLI 渲染产物,禁止手工维护或在部署后恢复旧内容。
- 受控入口:
- 预览使用 `bun scripts/cli.ts platform-infra webterm plan --target <target>`
- 部署使用 `bun scripts/cli.ts platform-infra webterm apply --target <target> --confirm`
- 收口使用同一入口的 `status``validate`
- 日志使用 `bun scripts/cli.ts platform-infra webterm logs --target <target> --tail <lines>`
- 日志默认返回最近 100 行,`--tail` 允许范围为 1 到 1000 行,且总输出保持有界。
- 匿名健康与 provider 判定:
- Webterm `/healthz` 无需登录,返回 `ok``providers``sessions`
- `apply``status``validate` 必须读取 `/healthz`,且只在 `ok=true``providers>=1` 时判定本地运行面健康;
- `/login` 可访问不能替代 provider 健康证据。
- 浏览器历史策略:
- `browserTerminalHistory.desktopScrollbackLines` 控制桌面端 xterm 历史行数;
- `browserTerminalHistory.mobileScrollbackLines` 控制移动端 xterm 历史行数;
- `browserTerminalHistory.mobileMaxWidthPx` 与粗指针特征共同决定移动端策略;
- 视口类型变化后,已有终端必须同步新上限并截断超出上限的旧行。
- 输出聚合策略:
- `browserOutputPolicy.maxFramesPerSecond` 是每个浏览器连接、每个终端的最大输出消息频率;
- `browserOutputPolicy.maxFrameBytes` 是单条聚合输出消息的字节上限;
- 后端必须按终端独立排队,小数据在频率窗口内合并,积压数据按窗口顺序发送,禁止用字节阈值绕过频率上限。