Avoid writing config file if not installed (#26107)
Just like others (oauth2 secret, internal token, etc), do not generate if no install lock
This commit is contained in:
parent
44781f9f5c
commit
d0bdfbc545
|
@ -58,7 +58,7 @@ func loadLFSFrom(rootCfg ConfigProvider) error {
|
||||||
LFS.JWTSecretBytes = make([]byte, 32)
|
LFS.JWTSecretBytes = make([]byte, 32)
|
||||||
n, err := base64.RawURLEncoding.Decode(LFS.JWTSecretBytes, []byte(LFS.JWTSecretBase64))
|
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()
|
LFS.JWTSecretBase64, err = generate.NewJwtSecretBase64()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error generating JWT Secret for custom config: %v", err)
|
return fmt.Errorf("error generating JWT Secret for custom config: %v", err)
|
||||||
|
|
Loading…
Reference in New Issue