(action string, err error)
| 59 | } |
| 60 | |
| 61 | func wrapPermissionDeniedError(action string, err error) error { |
| 62 | if err == nil { |
| 63 | return nil |
| 64 | } |
| 65 | if errors.Is(err, syscall.EPERM) || errors.Is(err, syscall.EACCES) { |
| 66 | return fmt.Errorf( |
| 67 | "%s: permission denied; WireGuard requires CAP_NET_ADMIN and kernel support on the host (if running in Docker, add NET_ADMIN and ensure the wireguard kernel module is available on the host): %w", |
| 68 | action, |
| 69 | err, |
| 70 | ) |
| 71 | } |
| 72 | return err |
| 73 | } |
| 74 | |
| 75 | // Manager handles WireGuard interface management using wgctrl |
| 76 | type Manager struct { |
no outgoing calls
no test coverage detected