mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-23 05:49:07 +02:00
Make usage of WireGuard kernel configurable from env
This commit is contained in:
@@ -33,6 +33,7 @@ const (
|
|||||||
loading
|
loading
|
||||||
live
|
live
|
||||||
inuse
|
inuse
|
||||||
|
envDisableWireGuardKernel = "NB_WG_KERNEL_DISABLED"
|
||||||
)
|
)
|
||||||
|
|
||||||
type module struct {
|
type module struct {
|
||||||
@@ -83,7 +84,12 @@ func tunModuleIsLoaded() bool {
|
|||||||
|
|
||||||
// WireGuardModuleIsLoaded check if we can load WireGuard mod (linux only)
|
// WireGuardModuleIsLoaded check if we can load WireGuard mod (linux only)
|
||||||
func WireGuardModuleIsLoaded() bool {
|
func WireGuardModuleIsLoaded() bool {
|
||||||
return false
|
|
||||||
|
if os.Getenv(envDisableWireGuardKernel) == "true" {
|
||||||
|
log.Infof("WireGuard kernel module disabled because the %s env is set to true", envDisableWireGuardKernel)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if canCreateFakeWireGuardInterface() {
|
if canCreateFakeWireGuardInterface() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user