From a1986507b7f962d0bb4f02c53b8e5f56ce7d66bc Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 30 Jul 2023 09:30:36 +0200 Subject: [PATCH] Revert "Avoid writing config file if not installed (#26107) (#26113)" This reverts commit 78722734fe96ec660993191e622459a600482004. It does not create `LFS_JWT_SECRET` if `INSTALL_LOCK` is true and the value of `LFS_JWT_SECRET` found in `app.ini` is incorrect. As a result LFS_JWT_SECRET will not be set at all and the Forgejo admin will not be notified that the value in the `app.ini` was ignored. --- 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 4232b5115b..f887bfd4fd 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) && InstallLock { + if err != nil || n != 32 { LFS.JWTSecretBase64, err = generate.NewJwtSecretBase64() if err != nil { return fmt.Errorf("error generating JWT Secret for custom config: %v", err)