Skip to content

Commit e771d91

Browse files
authored
Merge pull request #2053 from yearski/hotfix_0.17.1_remove-orphans
remove orphaned code
2 parents 029d3f5 + f7ed4bb commit e771d91

File tree

8 files changed

+3
-77
lines changed

8 files changed

+3
-77
lines changed

config/config.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,14 @@ type ServerConfig struct {
4242
AllowedOrigin string `yaml:"allowedorigin"`
4343
NodeID string `yaml:"nodeid"`
4444
RestBackend string `yaml:"restbackend"`
45-
AgentBackend string `yaml:"agentbackend"`
4645
MessageQueueBackend string `yaml:"messagequeuebackend"`
4746
DNSMode string `yaml:"dnsmode"`
4847
DisableRemoteIPCheck string `yaml:"disableremoteipcheck"`
4948
Version string `yaml:"version"`
5049
SQLConn string `yaml:"sqlconn"`
5150
Platform string `yaml:"platform"`
5251
Database string `yaml:"database"`
53-
DefaultNodeLimit int32 `yaml:"defaultnodelimit"`
5452
Verbosity int32 `yaml:"verbosity"`
55-
ServerCheckinInterval int64 `yaml:"servercheckininterval"`
5653
AuthProvider string `yaml:"authprovider"`
5754
OIDCIssuer string `yaml:"oidcissuer"`
5855
ClientID string `yaml:"clientid"`

config/environments/dev.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ server:
44
masterkey: "" # defaults to 'secretkey' or MASTER_KEY (if set)
55
allowedorigin: "" # defaults to '*' or CORS_ALLOWED_ORIGIN (if set)
66
restbackend: "" # defaults to "on" or REST_BACKEND (if set)
7-
agentbackend: "" # defaults to "on" or AGENT_BACKEND (if set)
87
dnsmode: "" # defaults to "on" or DNS_MODE (if set)
98
sqlconn: "" # defaults to "http://" or SQL_CONN (if set)
109
disableremoteipcheck: "" # defaults to "false" or DISABLE_REMOTE_IP_CHECK (if set)

controllers/config/environments/dev.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ server:
44
masterkey: ""
55
allowedorigin: "*"
66
restbackend: true
7-
agentbackend: true
87
defaultnetname: "default"
98
defaultnetrange: "10.10.10.0/24"
10-
createdefault: true
9+
createdefault: true

dev.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,12 @@ server:
33
apiconn: "api.ping.clustercat.com:443"
44
apihost: ""
55
apiport: "8081"
6-
grpcconn: "grpc.ping.clustercat.com:443"
7-
grpchost: ""
8-
grpcport: "50051"
9-
grpcsecure: "on"
106
mqhost: "localhost"
117
masterkey: "secretkey"
128
dnskey: ""
139
allowedorigin: "*"
1410
nodeid: "netmaker"
1511
restbackend: "on"
16-
agentbackend: "on"
1712
messagequeuebackend: "on"
1813
dnsmode: "on"
1914
disableremoteipcheck: ""
@@ -22,9 +17,7 @@ server:
2217
sqlconn: ""
2318
platform: ""
2419
database: "sqlite"
25-
defaultnodelimit: ""
2620
verbosity: 3
27-
servercheckininterval: ""
2821
authprovider: ""
2922
clientid: ""
3023
clientsecret: ""

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ func startControllers() {
136136
go runMessageQueue(&waitnetwork)
137137
}
138138

139-
if !servercfg.IsAgentBackend() && !servercfg.IsRestBackend() && !servercfg.IsMessageQueueBackend() {
140-
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'.")
139+
if !servercfg.IsRestBackend() && !servercfg.IsMessageQueueBackend() {
140+
logger.Log(0, "No Server Mode selected, so nothing is being served! Set Rest mode (REST_BACKEND) or MessageQueue (MESSAGEQUEUE_BACKEND) to 'true'.")
141141
}
142142

143143
// starts the stun server

servercfg/serverconf.go

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ func GetServerConfig() config.ServerConfig {
4646
if IsRestBackend() {
4747
cfg.RestBackend = "on"
4848
}
49-
cfg.AgentBackend = "off"
50-
if IsAgentBackend() {
51-
cfg.AgentBackend = "on"
52-
}
5349
cfg.DNSMode = "off"
5450
if IsDNSMode() {
5551
cfg.DNSMode = "on"
@@ -167,15 +163,6 @@ func GetAPIHost() string {
167163
return serverhost
168164
}
169165

170-
// GetPodIP - get the pod's ip
171-
func GetPodIP() string {
172-
podip := "127.0.0.1"
173-
if os.Getenv("POD_IP") != "" {
174-
podip = os.Getenv("POD_IP")
175-
}
176-
return podip
177-
}
178-
179166
// GetAPIPort - gets the api port
180167
func GetAPIPort() string {
181168
apiport := "8081"
@@ -198,19 +185,6 @@ func GetStunAddr() string {
198185
return stunAddr
199186
}
200187

201-
// GetDefaultNodeLimit - get node limit if one is set
202-
func GetDefaultNodeLimit() int32 {
203-
var limit int32
204-
limit = 999999999
205-
envlimit, err := strconv.Atoi(os.Getenv("DEFAULT_NODE_LIMIT"))
206-
if err == nil && envlimit != 0 {
207-
limit = int32(envlimit)
208-
} else if config.Config.Server.DefaultNodeLimit != 0 {
209-
limit = config.Config.Server.DefaultNodeLimit
210-
}
211-
return limit
212-
}
213-
214188
// GetCoreDNSAddr - gets the core dns address
215189
func GetCoreDNSAddr() string {
216190
addr, _ := GetPublicIP()
@@ -313,21 +287,6 @@ func IsMetricsExporter() bool {
313287
return export
314288
}
315289

316-
// IsAgentBackend - checks if agent backed is on or off
317-
func IsAgentBackend() bool {
318-
isagent := true
319-
if os.Getenv("AGENT_BACKEND") != "" {
320-
if os.Getenv("AGENT_BACKEND") == "off" {
321-
isagent = false
322-
}
323-
} else if config.Config.Server.AgentBackend != "" {
324-
if config.Config.Server.AgentBackend == "off" {
325-
isagent = false
326-
}
327-
}
328-
return isagent
329-
}
330-
331290
// IsMessageQueueBackend - checks if message queue is on or off
332291
func IsMessageQueueBackend() bool {
333292
ismessagequeue := true
@@ -525,18 +484,6 @@ func SetNodeID(id string) {
525484
config.Config.Server.NodeID = id
526485
}
527486

528-
// GetServerCheckinInterval - gets the server check-in time
529-
func GetServerCheckinInterval() int64 {
530-
var t = int64(5)
531-
var envt, _ = strconv.Atoi(os.Getenv("SERVER_CHECKIN_INTERVAL"))
532-
if envt > 0 {
533-
t = int64(envt)
534-
} else if config.Config.Server.ServerCheckinInterval > 0 {
535-
t = config.Config.Server.ServerCheckinInterval
536-
}
537-
return t
538-
}
539-
540487
// GetAuthProviderInfo = gets the oauth provider info
541488
func GetAuthProviderInfo() (pi []string) {
542489
var authProvider = ""

swagger.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,6 @@ definitions:
565565
type: string
566566
APIPort:
567567
type: string
568-
AgentBackend:
569-
type: string
570568
AllowedOrigin:
571569
type: string
572570
AuthProvider:
@@ -585,9 +583,6 @@ definitions:
585583
type: string
586584
Database:
587585
type: string
588-
DefaultNodeLimit:
589-
format: int32
590-
type: integer
591586
DisableRemoteIPCheck:
592587
type: string
593588
DisplayKeys:
@@ -624,9 +619,6 @@ definitions:
624619
type: string
625620
Server:
626621
type: string
627-
ServerCheckinInterval:
628-
format: int64
629-
type: integer
630622
Telemetry:
631623
type: string
632624
Verbosity:

test/config/environments/dev.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ server:
44
masterkey: "secretkey"
55
allowedorigin: "*"
66
restbackend: true
7-
agentbackend: true
87
mongoconn:
98
user: "mongoadmin"
109
pass: "mongopass"

0 commit comments

Comments
 (0)