Add default storage configurations (#12813)
Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
parent
4c6ac08182
commit
3878e985b6
19 changed files with 459 additions and 185 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue