From 862f748b2b33adb571b8b87e8d1635b8e8ac50d9 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Tue, 25 Jul 2023 13:06:31 +0800 Subject: [PATCH] Fix loading `LFS_JWT_SECRET` from wrong section (#26109) Regression of #25408. `LFS_JWT_SECRET_URI` and `LFS_JWT_SECRET` are under the `server` section, not `lfs`. So each time gitea restarts, it resets `LFS_JWT_SECRET`. image --- 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 4d9424f997..0e0f7b74e3 100644 --- a/modules/setting/lfs.go +++ b/modules/setting/lfs.go @@ -53,7 +53,7 @@ func loadLFSFrom(rootCfg ConfigProvider) error { return nil } - LFS.JWTSecretBase64 = loadSecret(rootCfg.Section("lfs"), "LFS_JWT_SECRET_URI", "LFS_JWT_SECRET") + LFS.JWTSecretBase64 = loadSecret(rootCfg.Section("server"), "LFS_JWT_SECRET_URI", "LFS_JWT_SECRET") LFS.JWTSecretBytes = make([]byte, 32) n, err := base64.RawURLEncoding.Decode(LFS.JWTSecretBytes, []byte(LFS.JWTSecretBase64))