]> source.dussan.org Git - gitea.git/commitdiff
Fix loading `LFS_JWT_SECRET` from wrong section (#26109)
authorJason Song <i@wolfogre.com>
Tue, 25 Jul 2023 05:06:31 +0000 (13:06 +0800)
committerGitHub <noreply@github.com>
Tue, 25 Jul 2023 05:06:31 +0000 (05:06 +0000)
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`.

<img width="1378" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/527ec9b9-eea2-4334-a274-6d1471456edd">

modules/setting/lfs.go

index 4d9424f9971f4a76636cc96de2766b0dcf7f4e3f..0e0f7b74e3f60b71b357e0b2484d102a3389a843 100644 (file)
@@ -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))