mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-06 17:29:15 +08:00
additional checks for disconnected nodes
This commit is contained in:
@@ -61,6 +61,10 @@ func GetPeerUpdate(node *models.Node) (models.PeerUpdate, error) {
|
||||
if node.NetworkSettings.IsPointToSite == "yes" && node.IsHub == "no" && peer.IsHub == "no" {
|
||||
continue
|
||||
}
|
||||
if node.Connected != "yes" {
|
||||
//skip unconnected nodes
|
||||
continue
|
||||
}
|
||||
|
||||
// if the node is not a server, set the endpoint
|
||||
var setEndpoint = !(node.IsServer == "yes")
|
||||
|
@@ -94,12 +94,14 @@ func startGoRoutines(wg *sync.WaitGroup) context.CancelFunc {
|
||||
cfg := config.ClientConfig{}
|
||||
cfg.Network = network
|
||||
cfg.ReadConfig()
|
||||
if cfg.Node.Connected == "yes" {
|
||||
if err := wireguard.ApplyConf(&cfg.Node, cfg.Node.Interface, ncutils.GetNetclientPathSpecific()+cfg.Node.Interface+".conf"); err != nil {
|
||||
logger.Log(0, "failed to start ", cfg.Node.Interface, "wg interface", err.Error())
|
||||
}
|
||||
if cfg.PublicIPService != "" {
|
||||
global_settings.PublicIPServices[network] = cfg.PublicIPService
|
||||
}
|
||||
}
|
||||
|
||||
server := cfg.Server.Server
|
||||
if !serverSet[server] {
|
||||
|
@@ -69,6 +69,7 @@ func checkin(currentRun int) {
|
||||
// defaults to iptables for now, may need another default for non-Linux OSes
|
||||
nodeCfg.Node.FirewallInUse = models.FIREWALL_IPTABLES
|
||||
}
|
||||
if nodeCfg.Node.Connected == "yes" {
|
||||
if nodeCfg.Node.IsStatic != "yes" {
|
||||
extIP, err := ncutils.GetPublicIP(nodeCfg.Server.API)
|
||||
if err != nil {
|
||||
@@ -107,6 +108,7 @@ func checkin(currentRun int) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//check version
|
||||
if nodeCfg.Node.Version != ncutils.Version {
|
||||
nodeCfg.Node.Version = ncutils.Version
|
||||
|
Reference in New Issue
Block a user