mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 16:26:38 +00:00
Monitor network changes and restart engine on detection (#1904)
This commit is contained in:
@@ -48,6 +48,7 @@ type ConfigInput struct {
|
||||
RosenpassPermissive *bool
|
||||
InterfaceName *string
|
||||
WireguardPort *int
|
||||
NetworkMonitor *bool
|
||||
DisableAutoConnect *bool
|
||||
ExtraIFaceBlackList []string
|
||||
}
|
||||
@@ -61,6 +62,7 @@ type Config struct {
|
||||
AdminURL *url.URL
|
||||
WgIface string
|
||||
WgPort int
|
||||
NetworkMonitor bool
|
||||
IFaceBlackList []string
|
||||
DisableIPv6Discovery bool
|
||||
RosenpassEnabled bool
|
||||
@@ -188,6 +190,10 @@ func createNewConfig(input ConfigInput) (*Config, error) {
|
||||
config.WgPort = *input.WireguardPort
|
||||
}
|
||||
|
||||
if input.NetworkMonitor != nil {
|
||||
config.NetworkMonitor = *input.NetworkMonitor
|
||||
}
|
||||
|
||||
config.WgIface = iface.WgInterfaceDefault
|
||||
if input.InterfaceName != nil {
|
||||
config.WgIface = *input.InterfaceName
|
||||
@@ -279,6 +285,11 @@ func update(input ConfigInput) (*Config, error) {
|
||||
refresh = true
|
||||
}
|
||||
|
||||
if input.NetworkMonitor != nil {
|
||||
config.NetworkMonitor = *input.NetworkMonitor
|
||||
refresh = true
|
||||
}
|
||||
|
||||
if input.WireguardPort != nil {
|
||||
config.WgPort = *input.WireguardPort
|
||||
refresh = true
|
||||
|
||||
Reference in New Issue
Block a user