summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Bröms <cez81@users.noreply.github.com>2017-10-19 08:52:37 +0200
committerLauris BH <lauris@nix.lv>2017-10-19 09:52:37 +0300
commitd4c93995764ea9d951e6d5ac4f4524b6a41c6d6f (patch)
tree98de2aa782fd2aefc1d490ee4563c39fa7511736
parent222244836fa8727918fb1f62c6295b5b51f6e258 (diff)
downloadgitea-d4c93995764ea9d951e6d5ac4f4524b6a41c6d6f.tar.gz
gitea-d4c93995764ea9d951e6d5ac4f4524b6a41c6d6f.zip
Set default lfs content path (#2521)
-rw-r--r--modules/setting/setting.go7
1 files changed, 6 insertions, 1 deletions
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 {