diff --git a/config/config.go b/config/config.go index ec80aba9..70868550 100644 --- a/config/config.go +++ b/config/config.go @@ -42,7 +42,6 @@ type ServerConfig struct { AllowedOrigin string `yaml:"allowedorigin"` NodeID string `yaml:"nodeid"` RestBackend string `yaml:"restbackend"` - AgentBackend string `yaml:"agentbackend"` MessageQueueBackend string `yaml:"messagequeuebackend"` DNSMode string `yaml:"dnsmode"` DisableRemoteIPCheck string `yaml:"disableremoteipcheck"` @@ -50,9 +49,7 @@ type ServerConfig struct { SQLConn string `yaml:"sqlconn"` Platform string `yaml:"platform"` Database string `yaml:"database"` - DefaultNodeLimit int32 `yaml:"defaultnodelimit"` Verbosity int32 `yaml:"verbosity"` - ServerCheckinInterval int64 `yaml:"servercheckininterval"` AuthProvider string `yaml:"authprovider"` OIDCIssuer string `yaml:"oidcissuer"` ClientID string `yaml:"clientid"` diff --git a/config/environments/dev.yaml b/config/environments/dev.yaml index 4107c468..8f2ce667 100644 --- a/config/environments/dev.yaml +++ b/config/environments/dev.yaml @@ -4,7 +4,6 @@ server: masterkey: "" # defaults to 'secretkey' or MASTER_KEY (if set) allowedorigin: "" # defaults to '*' or CORS_ALLOWED_ORIGIN (if set) restbackend: "" # defaults to "on" or REST_BACKEND (if set) - agentbackend: "" # defaults to "on" or AGENT_BACKEND (if set) dnsmode: "" # defaults to "on" or DNS_MODE (if set) sqlconn: "" # defaults to "http://" or SQL_CONN (if set) disableremoteipcheck: "" # defaults to "false" or DISABLE_REMOTE_IP_CHECK (if set) diff --git a/controllers/config/environments/dev.yaml b/controllers/config/environments/dev.yaml index de1101ab..2d8bb998 100644 --- a/controllers/config/environments/dev.yaml +++ b/controllers/config/environments/dev.yaml @@ -4,7 +4,6 @@ server: masterkey: "" allowedorigin: "*" restbackend: true - agentbackend: true defaultnetname: "default" defaultnetrange: "10.10.10.0/24" - createdefault: true \ No newline at end of file + createdefault: true diff --git a/dev.yaml b/dev.yaml index 86c14f9f..b1046a93 100644 --- a/dev.yaml +++ b/dev.yaml @@ -3,17 +3,12 @@ server: apiconn: "api.ping.clustercat.com:443" apihost: "" apiport: "8081" - grpcconn: "grpc.ping.clustercat.com:443" - grpchost: "" - grpcport: "50051" - grpcsecure: "on" mqhost: "localhost" masterkey: "secretkey" dnskey: "" allowedorigin: "*" nodeid: "netmaker" restbackend: "on" - agentbackend: "on" messagequeuebackend: "on" dnsmode: "on" disableremoteipcheck: "" @@ -22,9 +17,7 @@ server: sqlconn: "" platform: "" database: "sqlite" - defaultnodelimit: "" verbosity: 3 - servercheckininterval: "" authprovider: "" clientid: "" clientsecret: "" diff --git a/main.go b/main.go index d73188d8..2a86bb29 100644 --- a/main.go +++ b/main.go @@ -136,8 +136,8 @@ func startControllers() { go runMessageQueue(&waitnetwork) } - if !servercfg.IsAgentBackend() && !servercfg.IsRestBackend() && !servercfg.IsMessageQueueBackend() { - logger.Log(0, "No Server Mode selected, so nothing is being served! Set Agent mode (AGENT_BACKEND) or Rest mode (REST_BACKEND) or MessageQueue (MESSAGEQUEUE_BACKEND) to 'true'.") + if !servercfg.IsRestBackend() && !servercfg.IsMessageQueueBackend() { + logger.Log(0, "No Server Mode selected, so nothing is being served! Set Rest mode (REST_BACKEND) or MessageQueue (MESSAGEQUEUE_BACKEND) to 'true'.") } // starts the stun server diff --git a/servercfg/serverconf.go b/servercfg/serverconf.go index 588259ad..4d1f2a51 100644 --- a/servercfg/serverconf.go +++ b/servercfg/serverconf.go @@ -46,10 +46,6 @@ func GetServerConfig() config.ServerConfig { if IsRestBackend() { cfg.RestBackend = "on" } - cfg.AgentBackend = "off" - if IsAgentBackend() { - cfg.AgentBackend = "on" - } cfg.DNSMode = "off" if IsDNSMode() { cfg.DNSMode = "on" @@ -167,15 +163,6 @@ func GetAPIHost() string { return serverhost } -// GetPodIP - get the pod's ip -func GetPodIP() string { - podip := "127.0.0.1" - if os.Getenv("POD_IP") != "" { - podip = os.Getenv("POD_IP") - } - return podip -} - // GetAPIPort - gets the api port func GetAPIPort() string { apiport := "8081" @@ -198,19 +185,6 @@ func GetStunAddr() string { return stunAddr } -// GetDefaultNodeLimit - get node limit if one is set -func GetDefaultNodeLimit() int32 { - var limit int32 - limit = 999999999 - envlimit, err := strconv.Atoi(os.Getenv("DEFAULT_NODE_LIMIT")) - if err == nil && envlimit != 0 { - limit = int32(envlimit) - } else if config.Config.Server.DefaultNodeLimit != 0 { - limit = config.Config.Server.DefaultNodeLimit - } - return limit -} - // GetCoreDNSAddr - gets the core dns address func GetCoreDNSAddr() string { addr, _ := GetPublicIP() @@ -313,21 +287,6 @@ func IsMetricsExporter() bool { return export } -// IsAgentBackend - checks if agent backed is on or off -func IsAgentBackend() bool { - isagent := true - if os.Getenv("AGENT_BACKEND") != "" { - if os.Getenv("AGENT_BACKEND") == "off" { - isagent = false - } - } else if config.Config.Server.AgentBackend != "" { - if config.Config.Server.AgentBackend == "off" { - isagent = false - } - } - return isagent -} - // IsMessageQueueBackend - checks if message queue is on or off func IsMessageQueueBackend() bool { ismessagequeue := true @@ -525,18 +484,6 @@ func SetNodeID(id string) { config.Config.Server.NodeID = id } -// GetServerCheckinInterval - gets the server check-in time -func GetServerCheckinInterval() int64 { - var t = int64(5) - var envt, _ = strconv.Atoi(os.Getenv("SERVER_CHECKIN_INTERVAL")) - if envt > 0 { - t = int64(envt) - } else if config.Config.Server.ServerCheckinInterval > 0 { - t = config.Config.Server.ServerCheckinInterval - } - return t -} - // GetAuthProviderInfo = gets the oauth provider info func GetAuthProviderInfo() (pi []string) { var authProvider = "" diff --git a/swagger.yaml b/swagger.yaml index 3b03b1bf..657e1d59 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -565,8 +565,6 @@ definitions: type: string APIPort: type: string - AgentBackend: - type: string AllowedOrigin: type: string AuthProvider: @@ -585,9 +583,6 @@ definitions: type: string Database: type: string - DefaultNodeLimit: - format: int32 - type: integer DisableRemoteIPCheck: type: string DisplayKeys: @@ -624,9 +619,6 @@ definitions: type: string Server: type: string - ServerCheckinInterval: - format: int64 - type: integer Telemetry: type: string Verbosity: diff --git a/test/config/environments/dev.yaml b/test/config/environments/dev.yaml index 079e31f9..bf4f6762 100644 --- a/test/config/environments/dev.yaml +++ b/test/config/environments/dev.yaml @@ -4,7 +4,6 @@ server: masterkey: "secretkey" allowedorigin: "*" restbackend: true - agentbackend: true mongoconn: user: "mongoadmin" pass: "mongopass"