mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-02 21:14:05 +08:00
default proxy mode
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitl/netmaker/database"
|
||||
@@ -96,6 +97,15 @@ func CreateHost(h *models.Host) error {
|
||||
return err
|
||||
}
|
||||
h.HostPass = string(hash)
|
||||
// if another server has already updated proxyenabled, leave it alone
|
||||
if !h.ProxyEnabledSet {
|
||||
log.Println("checking default proxy", servercfg.GetServerConfig().DefaultProxyMode)
|
||||
if servercfg.GetServerConfig().DefaultProxyMode.Set {
|
||||
h.ProxyEnabledSet = true
|
||||
h.ProxyEnabled = servercfg.GetServerConfig().DefaultProxyMode.Value
|
||||
log.Println("set proxy enabled to ", h.ProxyEnabled)
|
||||
}
|
||||
}
|
||||
checkForZombieHosts(h)
|
||||
return UpsertHost(h)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user