2
0
abhishek9686 3 сар өмнө
parent
commit
6be6304a64

+ 1 - 1
logic/peers.go

@@ -163,7 +163,7 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
 		HostNetworkInfo: models.HostInfoMap{},
 		ServerConfig:    GetServerInfo(),
 	}
-	if host.DNS == "off" {
+	if host.DNS == "no" {
 		hostPeerUpdate.ManageDNS = false
 	}
 	defer func() {

+ 6 - 3
migrate/migrate.go

@@ -196,11 +196,11 @@ func updateHosts() {
 				continue
 			}
 		}
-		if host.DNS == "" {
+		if host.DNS == "" || (host.DNS != "yes" && host.DNS != "no") {
 			if logic.GetServerSettings().ManageDNS {
-				host.DNS = "on"
+				host.DNS = "yes"
 			} else {
-				host.DNS = "off"
+				host.DNS = "no"
 			}
 		}
 	}
@@ -582,5 +582,8 @@ func settings() {
 	if settings.AuditLogsRetentionPeriodInDays == 0 {
 		settings.AuditLogsRetentionPeriodInDays = 30
 	}
+	if settings.DefaultDomain == "" {
+		settings.DefaultDomain = servercfg.GetDefaultDomain()
+	}
 	logic.UpsertServerSettings(settings)
 }

+ 1 - 1
models/api_host.go

@@ -125,6 +125,6 @@ func (a *ApiHost) ConvertAPIHostToNMHost(currentHost *Host) *Host {
 	h.TurnEndpoint = currentHost.TurnEndpoint
 	h.PersistentKeepalive = time.Duration(a.PersistentKeepalive) * time.Second
 	h.AutoUpdate = a.AutoUpdate
-	h.DNS = a.DNS
+	h.DNS = strings.ToLower(a.DNS)
 	return &h
 }