|
@@ -145,7 +145,7 @@ func Configure() error {
|
|
|
json.Unmarshal(data, &dynConfig)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ exporter := false
|
|
|
for i, cI := range dynConfig.Clients {
|
|
|
if cI.Username == mqAdminUserName || cI.Username == mqNetmakerServerUserName {
|
|
|
salt := logic.RandomString(12)
|
|
@@ -155,6 +155,7 @@ func Configure() error {
|
|
|
cI.Salt = base64.StdEncoding.EncodeToString([]byte(salt))
|
|
|
dynConfig.Clients[i] = cI
|
|
|
} else if servercfg.Is_EE && cI.Username == mqExporterUserName {
|
|
|
+ exporter = true
|
|
|
exporterPassword := servercfg.GetLicenseKey()
|
|
|
salt := logic.RandomString(12)
|
|
|
hashed := encodePasswordToPBKDF2(exporterPassword, salt, 101, 64)
|
|
@@ -164,6 +165,16 @@ func Configure() error {
|
|
|
dynConfig.Clients[i] = cI
|
|
|
}
|
|
|
}
|
|
|
+ if servercfg.Is_EE && !exporter {
|
|
|
+ exporterPassword := servercfg.GetLicenseKey()
|
|
|
+ salt := logic.RandomString(12)
|
|
|
+ hashed := encodePasswordToPBKDF2(exporterPassword, salt, 101, 64)
|
|
|
+ exporterMQClient.Password = hashed
|
|
|
+ exporterMQClient.Iterations = 101
|
|
|
+ exporterMQClient.Salt = base64.StdEncoding.EncodeToString([]byte(salt))
|
|
|
+ dynConfig.Clients = append(dynConfig.Clients, exporterMQClient)
|
|
|
+ dynConfig.Roles = append(dynConfig.Roles, exporterMQRole)
|
|
|
+ }
|
|
|
data, err := json.MarshalIndent(dynConfig, "", " ")
|
|
|
if err != nil {
|
|
|
return err
|