zcbot/windows-node/README.md

32 lines
1.7 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.

# zcbot Windows Node
内网 MVP 的 Windows 执行节点,目标运行环境为 Windows 11 Enterprise + .NET 10 SDK 10.0.303。仓库根目录 `global.json` 固定 SDK patch客户端只使用 .NET Windows Desktop Framework不依赖第三方 NuGet 包。
当前实现托盘状态角标、小型配置窗口、注册、DPAPI/ACL 配置保存、WebSocket `hello`/心跳和退避重连。尚未实现 `compute_jobs`、Origin Worker、任务目录和产物上传。
注册和运行必须使用同一专用 Windows 账号。MVP 通过该账号的登录后计划任务自动启动,不以 Windows Service 在 Session 0 运行。
```powershell
dotnet build windows-node/Zcbot.WindowsNode/Zcbot.WindowsNode.csproj
windows-node/Zcbot.WindowsNode/bin/Debug/net10.0-windows/Zcbot.WindowsNode.exe enroll `
--server http://zcbot.internal:8765 `
--name win-origin-01 `
--code ZCN-...
windows-node/Zcbot.WindowsNode/bin/Debug/net10.0-windows/Zcbot.WindowsNode.exe
```
直接双击 EXE 默认启动托盘 UI红点表示未注册或身份失效黄点表示正在连接绿点表示在线。双击托盘图标打开配置窗口。无界面运行使用
```powershell
Zcbot.WindowsNode.exe run --headless
```
确认前台连接正常后,为当前专用账号注册登录后启动任务:
```powershell
windows-node/install-startup.ps1 `
-ExecutablePath windows-node/Zcbot.WindowsNode/bin/Debug/net10.0-windows/Zcbot.WindowsNode.exe
```
注册结果保存在 `%ProgramData%\Zcbot\WindowsNode\node.json`。Token 使用 DPAPI `LocalMachine` 加密,目录与文件 ACL 只保留注册时的运行账号和 `SYSTEM`。复制配置到另一台机器不能解密 TokenWindows 重装、运行账号变更或身份丢失时应由管理员禁用旧节点并重新注册。