|
@@ -113,7 +113,7 @@ func GetAPIConnString() string {
|
|
|
|
|
|
// GetVersion - version of netmaker
|
|
|
func GetVersion() string {
|
|
|
- version := "0.10.0"
|
|
|
+ version := "0.9.4"
|
|
|
if config.Config.Server.Version != "" {
|
|
|
version = config.Config.Server.Version
|
|
|
}
|
|
@@ -244,18 +244,6 @@ func GetGRPCPort() string {
|
|
|
return grpcport
|
|
|
}
|
|
|
|
|
|
-// GetMessageQueueEndpoint - gets the message queue endpoint
|
|
|
-func GetMessageQueueEndpoint() string {
|
|
|
- host, _ := GetPublicIP()
|
|
|
- if os.Getenv("MQ_HOST") != "" {
|
|
|
- host = os.Getenv("MQ_HOST")
|
|
|
- } else if config.Config.Server.MQHOST != "" {
|
|
|
- host = config.Config.Server.MQHOST
|
|
|
- }
|
|
|
- //Do we want MQ port configurable???
|
|
|
- return host + ":1883"
|
|
|
-}
|
|
|
-
|
|
|
// GetMasterKey - gets the configured master key of server
|
|
|
func GetMasterKey() string {
|
|
|
key := "secretkey"
|
|
@@ -319,29 +307,23 @@ func IsAgentBackend() bool {
|
|
|
return isagent
|
|
|
}
|
|
|
|
|
|
-// IsMessageQueueBackend - checks if message queue is on or off
|
|
|
-func IsMessageQueueBackend() bool {
|
|
|
- ismessagequeue := true
|
|
|
- if os.Getenv("MESSAGEQUEUE_BACKEND") != "" {
|
|
|
- if os.Getenv("MESSAGEQUEUE_BACKEND") == "off" {
|
|
|
- ismessagequeue = false
|
|
|
- }
|
|
|
- } else if config.Config.Server.MessageQueueBackend != "" {
|
|
|
- if config.Config.Server.MessageQueueBackend == "off" {
|
|
|
- ismessagequeue = false
|
|
|
- }
|
|
|
- }
|
|
|
- return ismessagequeue
|
|
|
-}
|
|
|
-
|
|
|
// IsClientMode - checks if it should run in client mode
|
|
|
func IsClientMode() string {
|
|
|
isclient := "on"
|
|
|
- if os.Getenv("CLIENT_MODE") == "off" {
|
|
|
- isclient = "off"
|
|
|
- }
|
|
|
- if config.Config.Server.ClientMode == "off" {
|
|
|
- isclient = "off"
|
|
|
+ if os.Getenv("CLIENT_MODE") != "" {
|
|
|
+ if os.Getenv("CLIENT_MODE") == "off" {
|
|
|
+ isclient = "off"
|
|
|
+ }
|
|
|
+ if os.Getenv("CLIENT_MODE") == "contained" {
|
|
|
+ isclient = "contained"
|
|
|
+ }
|
|
|
+ } else if config.Config.Server.ClientMode != "" {
|
|
|
+ if config.Config.Server.ClientMode == "off" {
|
|
|
+ isclient = "off"
|
|
|
+ }
|
|
|
+ if config.Config.Server.ClientMode == "contained" {
|
|
|
+ isclient = "contained"
|
|
|
+ }
|
|
|
}
|
|
|
return isclient
|
|
|
}
|