mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[PR #5227] 添加Windows服务管理和事件日志集成 #5191
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#5191
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fatedier/frp/pull/5227
Author: @donmor
Created: 3/9/2026
Status: 🔄 Open
Base:
dev← Head:patch-4📝 Commits (10+)
939f849add basic supports to run as a windows service8a9a61aadd support for changing parameters on service startdb9a3caadd support for windows eventlog46adf64fix broken compilation on non-windows platformsdb1470cimplements wait-for-startup and frpc pause/continue/reload0b31fdffix broken isWinSvc()f52035cfix broken dummy eventlog.go6521f5efix broken dummy system.go and system_android.go7b30d9ffix broken dummy eventlog.goce4f961now checks existence of event source using powershell;event source added automatically if run as privileged user📊 Changes
19 files changed (+1061 additions, -16 deletions)
View changed files
📝
cmd/frpc/main.go(+1 -1)➕
cmd/frpc/sub/install_windows.go(+263 -0)📝
cmd/frpc/sub/root.go(+21 -1)➕
cmd/frps/install_windows.go(+227 -0)📝
cmd/frps/main.go(+1 -1)📝
cmd/frps/root.go(+8 -0)📝
go.mod(+1 -1)📝
pkg/config/flags.go(+1 -1)📝
pkg/config/v1/common.go(+4 -3)➕
pkg/config/v1/svc.go(+24 -0)➕
pkg/config/v1/svc_windows.go(+24 -0)➕
pkg/util/log/eventlog.go(+50 -0)➕
pkg/util/log/eventlog_windows.go(+111 -0)➕
pkg/util/log/events/api_windows.go(+117 -0)➕
pkg/util/log/events/events.go(+36 -0)📝
pkg/util/log/log.go(+18 -7)📝
pkg/util/system/system.go(+13 -1)📝
pkg/util/system/system_android.go(+12 -0)➕
pkg/util/system/system_windows.go(+129 -0)📄 Description
重新提交#5004
实现 #2468 ,可直接使用
sc.exe(cmd)/New-Service(powershell)/注册表将frps或frpc注册为服务(可使用LocalService、服务账户等提高安全性)已实现:
golang.org/x/sys/windows/svc包,使frps和frpc符合Windows服务程序规范golang.org/x/sys/windows/svc/eventlog包,为Logger添加Windows事件日志后端(可使用Windows事件查看器查看)-c的参数和install命令间需插入--;使用uninstall命令以卸载;会同时注册/移除事件源;需在管理员cmd/powershell中执行;默认使用LocalSystem身份,restricted模式使用NT AUTHORITY\LocalService和受限SID)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.