feat(admin): add platform-specific admin privilege checks

- Upgrade Go version from 1.21 to 1.25.0
- Update golang.org/x/sys dependency to v0.42.0
- Add Unix/Linux admin check using os.Geteuid() with sudo requirement
- Add Windows admin check using windows.SID and token membership validation
- Integrate admin privilege validation into main CLI entry point
- Enhance monitor.go with graceful signal handling for Ctrl+C interrupts
- Add signal channels for clean shutdown of monitoring loop
- Ensures VPN client runs with required elevated privileges on both platforms
This commit is contained in:
2026-04-06 19:06:03 +06:00
parent 58ffb567ce
commit d88139af1b
6 changed files with 115 additions and 2 deletions

4
go.mod
View File

@@ -1,11 +1,11 @@
module vpn-client
go 1.21
go 1.25.0
require github.com/fatih/color v1.16.0
require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/sys v0.42.0 // indirect
)