Unverified Commit f8e015e8 authored by zeripath's avatar zeripath Committed by GitHub
Browse files

Move LFS directory creation out of NewContext (#11362)


Fix #9481
(probably others too)
Signed-off-by: default avatarAndrew Thornton <art27@cantab.net>
Co-authored-by: default avatarLauris BH <lauris@nix.lv>
Showing with 9 additions and 4 deletions
+9 -4
......@@ -749,10 +749,6 @@ func NewContext() {
LFS.HTTPAuthExpiry = sec.Key("LFS_HTTP_AUTH_EXPIRY").MustDuration(20 * time.Minute)
if LFS.StartServer {
if err := os.MkdirAll(LFS.ContentPath, 0700); err != nil {
log.Fatal("Failed to create '%s': %v", LFS.ContentPath, err)
}
LFS.JWTSecretBytes = make([]byte, 32)
n, err := base64.RawURLEncoding.Decode(LFS.JWTSecretBytes, []byte(LFS.JWTSecretBase64))
......@@ -1111,11 +1107,20 @@ func loadOrGenerateInternalToken(sec *ini.Section) string {
return token
}
func ensureLFSDirectory() {
if LFS.StartServer {
if err := os.MkdirAll(LFS.ContentPath, 0700); err != nil {
log.Fatal("Failed to create '%s': %v", LFS.ContentPath, err)
}
}
}
// NewServices initializes the services
func NewServices() {
InitDBConfig()
newService()
NewLogServices(false)
ensureLFSDirectory()
newCacheService()
newSessionService()
newCORSService()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment