PLT-2899 adding clustering of app servers (#3682)
* PLT-2899 adding clustering of app servers * PLT-2899 base framework * PLT-2899 HA backend * PLT-2899 Fixing config file * PLT-2899 adding config syncing * PLT-2899 set System console to readonly when clustering enabled. * PLT-2899 Fixing publish API * PLT-2899 fixing strings
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
ac90f5b389
Коммит
59d971dc75
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Ссылка в новой задаче
Block a user