Skip to content

fix: install each node without replacing the others - #7

Merged
chenow9 merged 2 commits into
mainfrom
fix/per-node-install
Sep 29, 2026
Merged

chenow9 merged 2 commits into
mainfrom
fix/per-node-install

Conversation

@chenow9

@chenow9 chenow9 commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

摘要

同一台机器执行第二条节点安装命令时,会盖掉前一个 umbra-node:Linux / macOS / Windows 的服务名和配置路径、以及 Docker 容器名都是固定的。现在每条命令只安装或替换自己的节点。

身份来自节点 ID(nde_ab12 → nde-ab12)。多个节点共用一份 umbra-node 程序,各自有服务名、凭证和 CA。再执行同一个节点的命令(含轮换凭证)只替换该节点。新命令不会停止旧的固定名安装(umbra-node、io.umbra.node、UmbraNode、容器 umbra-node);装好后需要手动停掉那一份,避免两个进程同时占用同一次登记。

镜像标签仍是 chenow9/umbra-node:latest。与入口版本对齐是下一项,不在这个 PR。

改动

  • internal/control/enroll.go、src/lib/umbra/units.ts:安装命令按节点分开 systemd、launchd、Windows 服务和 Docker 容器
  • cmd/umbra-node/service_windows.go:服务进程用 --service-name 对接 SCM;省略时仍是 UmbraNode,已有的单节点服务可以继续启动
  • 签发、轮换和导入配置时把节点 ID 传进安装命令;复制弹窗说明这条命令只影响当前节点
  • README(中/英)和 CHANGELOG:管理命令改成带 NODE 的名字,并写明如何停掉旧的固定名服务

验证

  • go test ./internal/control/ -run 'Enroll|NodeInstance'
  • node --experimental-strip-types --test src/lib/umbra/units.test.ts
  • tsc --noEmit
  • GOOS=windows go test -c ./cmd/umbra-node/
  • 未在真实的 systemd、launchd、Windows 服务或 Docker 主机上执行安装命令

检查

  • 两个节点的命令使用不同的服务名、配置目录和容器名
  • 再执行同一节点的命令仍使用原来的名字
  • 命令里没有 systemctl restart umbra-node、launchctl … io.umbra.node、sc.exe delete UmbraNode 或 docker rm -f umbra-node 这种固定名操作
  • 二进制节点仍安装到同一个 umbra-node 程序路径;Windows 上程序文件被占用且已存在时继续安装,不停止其他节点
  • Docker 镜像标签未改

CI

go test -race 上次失败在 TestVisitorReconnectKeepsLocalPort,与安装命令无关。访问端只有在 Accept 空闲超时时才发现会话已断;这个测试会连续拨号,竞态下 Accept 一直不空闲,于是 12 秒内都不重连。现在会话一关闭就放开 Accept,本地端口仍在忙也会重连。

Console install commands shared one service name, config path, and Docker container, so a second node on the same machine replaced the first. Scope each command to its node id and leave older fixed-name installs in place.
serveTCP only noticed a closed session when Accept timed out. The
reconnect test dials continuously, so under the race detector Accept
never idled and the visitor never redialed.
@chenow9
chenow9 merged commit cf39532 into main Sep 29, 2026
2 checks passed
@chenow9
chenow9 deleted the fix/per-node-install branch September 29, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant