aboutsummaryrefslogtreecommitdiffstats
path: root/modules/setting/lfs.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-07-25 12:03:41 +0800
committerGitHub <noreply@github.com>2023-07-25 04:03:41 +0000
commitd0bdfbc5458a30c36cbf749a2976881cd4478418 (patch)
tree7c716adee39451ad2ad9281a25514320299d0582 /modules/setting/lfs.go
parent44781f9f5c4ede618660d8cfe42437f0e8dc22a0 (diff)
downloadgitea-d0bdfbc5458a30c36cbf749a2976881cd4478418.tar.gz
gitea-d0bdfbc5458a30c36cbf749a2976881cd4478418.zip
Avoid writing config file if not installed (#26107)
Just like others (oauth2 secret, internal token, etc), do not generate if no install lock
Diffstat (limited to 'modules/setting/lfs.go')
-rw-r--r--modules/setting/lfs.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/setting/lfs.go b/modules/setting/lfs.go
index 784a99582d..4d9424f997 100644
--- a/modules/setting/lfs.go
+++ b/modules/setting/lfs.go
@@ -58,7 +58,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)