From 3d10193be2b4476d1d0d3249a9884fcc0faa64e5 Mon Sep 17 00:00:00 2001 From: Clar Fon <15850505+clarfonthey@users.noreply.github.com> Date: Sat, 1 Oct 2022 13:26:33 -0400 Subject: Allow specifying SECRET_KEY_URI, similar to INTERNAL_TOKEN_URI (#19663) Only load SECRET_KEY and INTERNAL_TOKEN if they exist. Never write the config file if the keys do not exist, which was only a fallback for Gitea upgraded from < 1.5 Co-authored-by: wxiaoguang --- services/auth/source/oauth2/jwtsigningkey.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services/auth/source') diff --git a/services/auth/source/oauth2/jwtsigningkey.go b/services/auth/source/oauth2/jwtsigningkey.go index d6b3c05a4f..d9312ee820 100644 --- a/services/auth/source/oauth2/jwtsigningkey.go +++ b/services/auth/source/oauth2/jwtsigningkey.go @@ -364,7 +364,7 @@ func loadOrCreateSymmetricKey() (interface{}, error) { return nil, err } - setting.CreateOrAppendToCustomConf(func(cfg *ini.File) { + setting.CreateOrAppendToCustomConf("oauth2.JWT_SECRET", func(cfg *ini.File) { secretBase64 := base64.RawURLEncoding.EncodeToString(key) cfg.Section("oauth2").Key("JWT_SECRET").SetValue(secretBase64) }) -- cgit v1.2.3