Windows Server 部署
前置条件
- Windows Server 2022 或更高版本。
- 指向服务器的 DNS 域名。
- 位于
LocalMachine\My的受信任服务器证书,私钥对NETWORK SERVICE可读。 - 管理员 PowerShell。
发布与安装
.\tools\publish-server.ps1 -Version 1.0.0
把 artifacts/server/win-x64/ 复制到服务器后,以管理员身份执行:
.\LumaTunnel.Server.exe service install `
--host node.example.com `
--thumbprint 0123456789ABCDEF0123456789ABCDEF01234567
安装命令会:
- 写入
C:\ProgramData\LumaTunnel\config\server.json。 - 创建自动启动的
LumaTunnelServer,账户为NetworkService。 - 配置服务失败后的三级重启策略。
- 为
https://+:443/添加 URL ACL。 - 为
node.example.com:443添加 HTTP.sys SSL 证书绑定。 - 添加入站 TCP 443 防火墙规则并启动服务。
检查状态和配置:
.\LumaTunnel.Server.exe config validate
.\LumaTunnel.Server.exe service status
Invoke-RestMethod https://node.example.com/api/v1/health
配对与设备管理
.\LumaTunnel.Server.exe pair create --ttl 10m
.\LumaTunnel.Server.exe device list
.\LumaTunnel.Server.exe device rename DEVICE_ID "Surface Laptop"
.\LumaTunnel.Server.exe device revoke DEVICE_ID
配对码只可使用一次。服务通过设备数据库文件监视器接收 CLI 的吊销变更,并关闭该设备的现有 WSS 会话。
数据和日志
C:\ProgramData\LumaTunnel\
├─ config\server.json
├─ data\devices.json
├─ data\pairing-codes.json
├─ data\traffic.json
└─ logs\
请只授予 Administrators、SYSTEM 和服务账户访问权限。备份时把 config 和 data 视为敏感数据;虽然没有令牌明文,但设备元数据和令牌摘要仍不应公开。
卸载
.\LumaTunnel.Server.exe service uninstall
命令会停止并删除服务、URL ACL、SSL 绑定和防火墙规则。为防止误删,C:\ProgramData\LumaTunnel 数据默认保留;确认无需备份后再由管理员手动删除。
证书轮换
先导入新证书并授予私钥权限,再删除旧 hostnameport 绑定、添加新绑定并重启服务。轮换期间不要把 AllowPrivateTargets 设为 true,该设置仅用于隔离测试网。