Browse Source

add host auto updated setting with default true

Anish Mukherjee 2 years ago
parent
commit
6b684d95a4
2 changed files with 2 additions and 0 deletions
  1. 1 0
      logic/hosts.go
  2. 1 0
      models/host.go

+ 1 - 0
logic/hosts.go

@@ -97,6 +97,7 @@ func CreateHost(h *models.Host) error {
 		return err
 	}
 	h.HostPass = string(hash)
+	h.AutoUpdate = true
 	// if another server has already updated proxyenabled, leave it alone
 	if !h.ProxyEnabledSet {
 		log.Println("checking default proxy", servercfg.GetServerConfig().DefaultProxyMode)

+ 1 - 0
models/host.go

@@ -33,6 +33,7 @@ type Host struct {
 	Version          string           `json:"version" yaml:"version"`
 	IPForwarding     bool             `json:"ipforwarding" yaml:"ipforwarding"`
 	DaemonInstalled  bool             `json:"daemoninstalled" yaml:"daemoninstalled"`
+	AutoUpdate       bool             `json:"autoupdate" yaml:"autoupdate"`
 	HostPass         string           `json:"hostpass" yaml:"hostpass"`
 	Name             string           `json:"name" yaml:"name"`
 	OS               string           `json:"os" yaml:"os"`