aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-09-29 17:05:13 +0800
committerGitHub <noreply@github.com>2020-09-29 12:05:13 +0300
commit3878e985b66cc6d4cb4d2b0e7406d5cf91af6191 (patch)
tree31229c29c2b57041d1941ec28b043165cbe4642d /routers
parent4c6ac08182b5a14eaaffaafafef160bd90c4ae81 (diff)
downloadgitea-3878e985b66cc6d4cb4d2b0e7406d5cf91af6191.tar.gz
gitea-3878e985b66cc6d4cb4d2b0e7406d5cf91af6191.zip
Add default storage configurations (#12813)
Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'routers')
-rw-r--r--routers/install.go2
-rw-r--r--routers/repo/attachment.go2
-rw-r--r--routers/repo/lfs.go6
3 files changed, 4 insertions, 6 deletions
diff --git a/routers/install.go b/routers/install.go
index 9eda18f941..028b5d3eea 100644
--- a/routers/install.go
+++ b/routers/install.go
@@ -71,7 +71,7 @@ func Install(ctx *context.Context) {
// Application general settings
form.AppName = setting.AppName
form.RepoRootPath = setting.RepoRootPath
- form.LFSRootPath = setting.LFS.ContentPath
+ form.LFSRootPath = setting.LFS.Path
// Note(unknown): it's hard for Windows users change a running user,
// so just use current one if config says default.
diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go
index d3201faec0..313704bc38 100644
--- a/routers/repo/attachment.go
+++ b/routers/repo/attachment.go
@@ -19,7 +19,7 @@ import (
func renderAttachmentSettings(ctx *context.Context) {
ctx.Data["IsAttachmentEnabled"] = setting.Attachment.Enabled
- ctx.Data["AttachmentStoreType"] = setting.Attachment.StoreType
+ ctx.Data["AttachmentStoreType"] = setting.Attachment.Storage.Type
ctx.Data["AttachmentAllowedTypes"] = setting.Attachment.AllowedTypes
ctx.Data["AttachmentMaxSize"] = setting.Attachment.MaxSize
ctx.Data["AttachmentMaxFiles"] = setting.Attachment.MaxFiles
diff --git a/routers/repo/lfs.go b/routers/repo/lfs.go
index 481a3e57ad..6bee2dd107 100644
--- a/routers/repo/lfs.go
+++ b/routers/repo/lfs.go
@@ -12,7 +12,6 @@ import (
"io"
"io/ioutil"
"path"
- "path/filepath"
"sort"
"strconv"
"strings"
@@ -29,7 +28,6 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/storage"
- "code.gitea.io/gitea/modules/util"
gogit "github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
@@ -355,8 +353,8 @@ func LFSDelete(ctx *context.Context) {
// FIXME: Warning: the LFS store is not locked - and can't be locked - there could be a race condition here
// Please note a similar condition happens in models/repo.go DeleteRepository
if count == 0 {
- oidPath := filepath.Join(oid[0:2], oid[2:4], oid[4:])
- err = util.Remove(filepath.Join(setting.LFS.ContentPath, oidPath))
+ oidPath := path.Join(oid[0:2], oid[2:4], oid[4:])
+ err = storage.LFS.Delete(oidPath)
if err != nil {
ctx.ServerError("LFSDelete", err)
return