From 1d900bc6a9a6461b17187ec7060084b465cf83a1 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 25 Jul 2023 01:31:50 -0400 Subject: [PATCH] Avoid writing config file if not installed (#26107) (#26113) Backport #26107 by @wxiaoguang Just like others (oauth2 secret, internal token, etc), do not generate if no install lock Co-authored-by: wxiaoguang (cherry picked from commit e2596b0a999b2d2b6ce699ac8b6a3981a89d5bd5) (cherry picked from commit 78722734fe96ec660993191e622459a600482004) --- modules/setting/lfs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/setting/lfs.go b/modules/setting/lfs.go index f887bfd4fd..4232b5115b 100644 --- a/modules/setting/lfs.go +++ b/modules/setting/lfs.go @@ -63,7 +63,7 @@ func loadLFSFrom(rootCfg ConfigProvider) error { LFS.JWTSecretBytes = make([]byte, 32) n, err := base64.RawURLEncoding.Decode(LFS.JWTSecretBytes, []byte(LFS.JWTSecretBase64)) - if err != nil || n != 32 { + if (err != nil || n != 32) && InstallLock { LFS.JWTSecretBase64, err = generate.NewJwtSecretBase64() if err != nil { return fmt.Errorf("error generating JWT Secret for custom config: %v", err)