Skip to content

Commit

Permalink
Avoid writing config file if not installed (#26107)
Browse files Browse the repository at this point in the history
Just like others (oauth2 secret, internal token, etc), do not generate
if no install lock
  • Loading branch information
wxiaoguang committed Jul 25, 2023
1 parent 44781f9 commit d0bdfbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/setting/lfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d0bdfbc

Please sign in to comment.