From d4c93995764ea9d951e6d5ac4f4524b6a41c6d6f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20Br=C3=B6ms?= Date: Thu, 19 Oct 2017 08:52:37 +0200 Subject: [PATCH] Set default lfs content path (#2521) --- modules/setting/setting.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 85ffa643a9..10c301aa2a 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -740,9 +740,14 @@ func NewContext() { SSH.AuthorizedKeysBackup = sec.Key("SSH_AUTHORIZED_KEYS_BACKUP").MustBool(true) SSH.ExposeAnonymous = sec.Key("SSH_EXPOSE_ANONYMOUS").MustBool(false) - if err = Cfg.Section("server").MapTo(&LFS); err != nil { + sec = Cfg.Section("server") + if err = sec.MapTo(&LFS); err != nil { log.Fatal(4, "Failed to map LFS settings: %v", err) } + LFS.ContentPath = sec.Key("LFS_CONTENT_PATH").MustString(filepath.Join(AppDataPath, "lfs")) + if !filepath.IsAbs(LFS.ContentPath) { + LFS.ContentPath = filepath.Join(workDir, LFS.ContentPath) + } if LFS.StartServer { -- 2.39.5