Files
NexusGate/panel-go/golden
aaaamoooo 0037116edc feat: manual landing endpoints for forward nodes (item 8)
A forward node's exit target is now a choice: a managed panel server
(existing behavior) or a manual landing endpoint — address + port +
protocol (VLESS / SS2022 / SOCKS5) + operator-supplied credentials,
including third-party nodes the panel does not run. The panel only
builds the entry-side sing-box outbound and route rule; there is no
exit resource, no exit job, and the node is exit-ready by definition.

- model: Node.ExitMode/ExitAddress; manual exits force fixed port mode
  and skip the exit-server port table entirely
- validation: address/port required; per-protocol credential presence;
  SS2022 passwords must be base64 key material of the method's key
  length (one PSK segment or serverKey:userKey) — the exact form
  sing-box accepts, rejected up front instead of failing at deploy
- orchestration: resource building, deploy validation and rebuilds all
  branch on manualExit; switching managed->manual queues removal of the
  old exit resource, manual->managed mints a fresh exit resource id
  (deploy validation previously dereferenced the nil exit server —
  regression test locks the fix)
- UI: exit target segmented control, link paste box that parses
  vless:// / ss:// / socks5:// links into the form, per-protocol
  credential fields (blank keeps the stored value on edit)
- golden: new manualCreate/manualAssign/manualDeploy/manualJobs/
  manualNodes sections — exactly one entry-side job whose outbound
  targets the manual address; all prior sections unchanged
- the generated combined sing-box config passes the real sing-box
  1.13.21 check
2026-10-21 11:18:00 +08:00
..

Go 面板金标准回归基线(golden)

2026-10-21 起 Node 实现冻结退役、Go 单一真源,difftest(Node 差分)随之退役。 本目录把 Go 面板在种子库上的当前行为冻结为回归基线,替代 difftest 的 守门角色:

  • golden.mjs — 抓取/校验脚本。复用 ../difftest/ 的种子库(seed.json) 与学习式 Normalizer(../difftest/lib.mjs):以种子副本启动一个 Go 面板, 按固定剧本驱动(登录 → 种子 agent 心跳 → 列表 → 凭据 → 订阅全格式 → 建服务器/注册 agent → 建客户/节点/分配/部署并 drain 部署任务 → 用量上报 两轮 → 呈现投影 → UI 式全量 PATCH 节点 → /api/system 结构 → 备份导出 → 错误用例),全部响应归一化后存入 golden.json(25 个 section)。
  • golden.json — 冻结的行为快照(2026-10-21,基线提交时的 Go 现状, 二进制由 HEAD 156a31c 构建)。

用法:

node golden.mjs capture [--bin /path/to/nexusgate-panel]   # 重新冻结(仅在确认行为变更为预期时)
node golden.mjs verify  [--bin /path/to/nexusgate-panel]   # 与基线比对,有差异退出码 1 并打印首个 diff 路径

约定:

  • verify 出现 diff 时,先判定是预期变更(本版 9 项修改各自的预期 diff 在 NEXT-ROUND-REPORT.md 中逐项登记)还是回归;预期变更在对应项提交里 一并重新 capture 并在提交说明中注明 section 名。
  • /api/system 的数值多为实时采样,脚本只保留结构与确定性计数 (nodesTotal/customersTotal/online* /connections),其余数值与 IP 压成 占位;uptime 类键同样压平。其余 section 的数值都是剧本确定性结果, 逐字比对。
  • 剧本对时间的依赖已被窗口设计吸收(presence 180s 窗口、心跳在线判定), 正常复跑应恒 PASS;偶发 FAIL 先复跑一次区分抖动与真回归。