Feature for editing, creating, uploading and deleting files

This commit is contained in:
Richard Mahn
2016-07-15 18:35:42 -06:00
parent 3d93532c87
commit fa1b752be2
19 changed files with 2848 additions and 1057 deletions

View File

@@ -110,6 +110,8 @@ var (
ForcePrivate bool
MaxCreationLimit int
PullRequestQueueLength int
LineWrapExtensions []string
PreviewTabApis []string
}
RepoRootPath string
ScriptType string
@@ -129,6 +131,7 @@ var (
Markdown struct {
EnableHardLineBreak bool
CustomURLSchemes []string `ini:"CUSTOM_URL_SCHEMES"`
MdFileExtensions []string
}
// Picture settings
@@ -148,6 +151,13 @@ var (
AttachmentMaxFiles int
AttachmentEnabled bool
// Repo Upload settings
UploadTempPath string
UploadAllowedTypes string
UploadMaxSize int64
UploadMaxFiles int
UploadEnabled bool
// Time settings
TimeFormat string
@@ -437,6 +447,16 @@ func NewContext() {
log.Fatal(4, "Fail to map Repository settings: %v", err)
}
sec = Cfg.Section("upload")
UploadTempPath = sec.Key("UPLOAD_TEMP_PATH").MustString(path.Join(AppDataPath, "tmp/uploads"))
if !filepath.IsAbs(UploadTempPath) {
UploadTempPath = path.Join(workDir, UploadTempPath)
}
UploadAllowedTypes = strings.Replace(sec.Key("UPLOAD_ALLOWED_TYPES").MustString(""), "|", ",", -1)
UploadMaxSize = sec.Key("UPLOAD_FILE_MAX_SIZE").MustInt64(32)
UploadMaxFiles = sec.Key("UPLOAD_MAX_FILES").MustInt(10)
UploadEnabled = sec.Key("ENABLE_UPLOADS").MustBool(true)
// UI settings.
sec = Cfg.Section("ui")
ExplorePagingNum = sec.Key("EXPLORE_PAGING_NUM").MustInt(20)