mirror of
https://github.com/gravitl/netmaker.git
synced 2026-04-23 00:17:10 +08:00
Merge branch 'develop' into feature_v0.10.0_initialize_iptables
This commit is contained in:
@@ -85,6 +85,7 @@ func GetServerConfig() config.ServerConfig {
|
||||
} else {
|
||||
cfg.RCE = "off"
|
||||
}
|
||||
cfg.Debug = GetDebug()
|
||||
cfg.Telemetry = Telemetry()
|
||||
cfg.ManageIPTables = ManageIPTables()
|
||||
services := strings.Join(GetPortForwardServiceList(), ",")
|
||||
@@ -248,6 +249,18 @@ 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"
|
||||
@@ -311,6 +324,21 @@ 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"
|
||||
@@ -581,3 +609,8 @@ func getMacAddr() string {
|
||||
func GetRce() bool {
|
||||
return os.Getenv("RCE") == "on" || config.Config.Server.RCE == "on"
|
||||
}
|
||||
|
||||
// GetDebug -- checks if debugging is enabled, off by default
|
||||
func GetDebug() bool {
|
||||
return os.Getenv("DEBUG") == "on" || config.Config.Server.Debug == true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user