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

2
go.sum
View File

@@ -9,3 +9,5 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=