adding telemetry

This commit is contained in:
afeiszli
2022-01-20 17:50:42 -05:00
parent 1ba4ff3d89
commit 4d2a85f879
11 changed files with 264 additions and 0 deletions
+13
View File
@@ -85,6 +85,7 @@ func GetServerConfig() config.ServerConfig {
} else {
cfg.RCE = "off"
}
cfg.Telemetry = Telemetry()
return cfg
}
@@ -319,6 +320,18 @@ func IsClientMode() string {
return isclient
}
// IsClientMode - checks if it should run in client mode
func Telemetry() string {
telemetry := "on"
if os.Getenv("TELEMETRY") == "off" {
telemetry = "off"
}
if config.Config.Server.Telemetry == "off" {
telemetry = "off"
}
return telemetry
}
// IsDNSMode - should it run with DNS
func IsDNSMode() bool {
isdns := true