添加Windows服务管理和事件日志集成
实现 #2468 ,可直接使用sc.exe(cmd)/New-Service(powershell)/注册表将frps或frpc注册为服务(可使用LocalService、服务账户等提高安全性)
计划实现:
- [x] 加入
golang.org/x/sys/windows/svc包,使frps和frpc符合Windows服务程序规范 - [x] 加入
golang.org/x/sys/windows/svc/eventlog包,为Logger添加Windows事件日志后端(可使用Windows事件查看器查看) - [ ] ~~为每种日志输出添加独有的event ID(需要定义更多eid;需要改golib那边)~~ 暂时搁置
- [x] 为frpc添加pause/continue支持(并同时reload代理配置)
- [x] 日志事件源存在检测和自动安装(使用powershell命令,自动添加需要UAC提权)
- [x] 服务安装/卸载命令(在启动参数前插入install以安装,非
-c的参数和install命令间需插入--;使用uninstall命令以卸载;会同时注册/移除事件源;需UAC提权;默认使用LocalSystem身份,restricted模式使用NT AUTHORITY\LocalService和受限SID;这些命令以后也许会用于Systemd/Launchd服务安装功能?)
PRs go stale after 14d of inactivity. Stale PRs rot after an additional 3d of inactivity and eventually close.
自顶
这个不需要frp来程序实现, win 可以用 winsw , linux 可以使用 systemd 来管理。
例如这样:
PRs go stale after 14d of inactivity. Stale PRs rot after an additional 3d of inactivity and eventually close.
自顶
PRs go stale after 14d of inactivity. Stale PRs rot after an additional 3d of inactivity and eventually close.
自顶
PRs go stale after 14d of inactivity. Stale PRs rot after an additional 3d of inactivity and eventually close.
自顶