frp icon indicating copy to clipboard operation
frp copied to clipboard

添加Windows服务管理和事件日志集成

Open donmor opened this issue 3 months ago • 9 comments

实现 #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服务安装功能?)

donmor avatar Sep 29 '25 07:09 donmor

PRs go stale after 14d of inactivity. Stale PRs rot after an additional 3d of inactivity and eventually close.

github-actions[bot] avatar Oct 20 '25 00:10 github-actions[bot]

自顶

donmor avatar Oct 20 '25 01:10 donmor

这个不需要frp来程序实现, win 可以用 winsw , linux 可以使用 systemd 来管理。

例如这样:

image

wuai1024 avatar Oct 23 '25 01:10 wuai1024

PRs go stale after 14d of inactivity. Stale PRs rot after an additional 3d of inactivity and eventually close.

github-actions[bot] avatar Nov 07 '25 00:11 github-actions[bot]

自顶

donmor avatar Nov 07 '25 11:11 donmor

PRs go stale after 14d of inactivity. Stale PRs rot after an additional 3d of inactivity and eventually close.

github-actions[bot] avatar Nov 22 '25 00:11 github-actions[bot]

自顶

donmor avatar Nov 22 '25 01:11 donmor

PRs go stale after 14d of inactivity. Stale PRs rot after an additional 3d of inactivity and eventually close.

github-actions[bot] avatar Dec 08 '25 00:12 github-actions[bot]

自顶

donmor avatar Dec 08 '25 00:12 donmor