From 30f8409b34e0c9339917bd08a01029e04494ecac Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Wed, 13 Nov 2024 13:06:30 +0100 Subject: [PATCH] generate collaborationWOPISecret if old config does not contain any Signed-off-by: Christian Richter --- ocis/pkg/init/init.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ocis/pkg/init/init.go b/ocis/pkg/init/init.go index 5c837774f3..0808e4cb4c 100644 --- a/ocis/pkg/init/init.go +++ b/ocis/pkg/init/init.go @@ -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