diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/config.go | 11 | ||||
-rw-r--r-- | utils/license.go | 1 |
2 files changed, 9 insertions, 3 deletions
diff --git a/utils/config.go b/utils/config.go index 868e96b51..a1a6becd1 100644 --- a/utils/config.go +++ b/utils/config.go @@ -4,6 +4,7 @@ package utils import ( + "crypto/md5" "encoding/json" "fmt" "io/ioutil" @@ -26,7 +27,7 @@ const ( var Cfg *model.Config = &model.Config{} var CfgDiagnosticId = "" -var CfgLastModified int64 = 0 +var CfgHash = "" var CfgFileName string = "" var ClientCfg map[string]string = map[string]string{} @@ -157,11 +158,10 @@ func LoadConfig(fileName string) { map[string]interface{}{"Filename": fileName, "Error": err.Error()})) } - if info, err := file.Stat(); err != nil { + if _, err := file.Stat(); err != nil { panic(T("utils.config.load_config.getting.panic", map[string]interface{}{"Filename": fileName, "Error": err.Error()})) } else { - CfgLastModified = info.ModTime().Unix() CfgFileName = fileName } @@ -185,6 +185,7 @@ func LoadConfig(fileName string) { } Cfg = &config + CfgHash = fmt.Sprintf("%x", md5.Sum([]byte(Cfg.ToJson()))) RegenerateClientConfig() // Actions that need to run every time the config is loaded @@ -298,6 +299,10 @@ func getClientConfig(c *model.Config) map[string]string { props["SamlLoginButtonText"] = *c.SamlSettings.LoginButtonText } + if *License.Features.Cluster { + props["EnableCluster"] = strconv.FormatBool(*c.ClusterSettings.Enable) + } + if *License.Features.GoogleSSO { props["EnableSignUpWithGoogle"] = strconv.FormatBool(c.GoogleSettings.Enable) } diff --git a/utils/license.go b/utils/license.go index 971b05912..246cc553e 100644 --- a/utils/license.go +++ b/utils/license.go @@ -122,6 +122,7 @@ func getClientLicense(l *model.License) map[string]string { props["LDAP"] = strconv.FormatBool(*l.Features.LDAP) props["MFA"] = strconv.FormatBool(*l.Features.MFA) props["SAML"] = strconv.FormatBool(*l.Features.SAML) + props["Cluster"] = strconv.FormatBool(*l.Features.Cluster) props["GoogleSSO"] = strconv.FormatBool(*l.Features.GoogleSSO) props["Office365SSO"] = strconv.FormatBool(*l.Features.Office365SSO) props["Compliance"] = strconv.FormatBool(*l.Features.Compliance) |