generate collaborationWOPISecret if old config does not contain any

Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2024-11-13 13:06:30 +01:00
parent d1bfb73f96
commit 30f8409b34

View File

@@ -83,6 +83,12 @@ func CreateConfig(insecure, forceOverwrite, diff bool, configPath, adminPassword
revaServicePassword = oldCfg.Idm.ServiceUserPasswords.RevaPassword
tokenManagerJwtSecret = oldCfg.TokenManager.JWTSecret
collaborationWOPISecret = oldCfg.Collaboration.WopiApp.Secret
if collaborationWOPISecret == "" {
collaborationWOPISecret, err = generators.GenerateRandomPassword(passwordLength)
if err != nil {
return fmt.Errorf("could not generate random wopi secret for collaboration service: %s", err)
}
}
machineAuthAPIKey = oldCfg.MachineAuthAPIKey
systemUserAPIKey = oldCfg.SystemUserAPIKey
revaTransferSecret = oldCfg.TransferSecret