Merge branch 'develop' into feature_v0.10.0_initialize_iptables

This commit is contained in:
Alex
2022-01-26 00:47:21 -05:00
committed by GitHub
42 changed files with 1125 additions and 355 deletions
+33
View File
@@ -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
}