mirror of
https://github.com/gogs/gogs.git
synced 2025-12-20 15:20:01 +01:00
Squashed commit of the following:
commit0afcb843d7Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit7ecd73ff55Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commitc29b9ab531Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit23af384c53Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commitcfb8a97591Merge:7fc8a89991ce42Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit7fc8a89cb4Merge:fd3d86cc03d040Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commitfd3d86ca6bAuthor: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commitc03d0401c1Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit98e1206ccfAuthor: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commitc2895dc742Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit6aa7e46b21Merge:889e9faad7ea88Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit889e9faf1bAuthor: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit47603edf22Merge:bb57912cf85e9eAuthor: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commitbb57912558Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commitd10d128c51Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit34a3498202Merge:fa1b7521c7dcddAuthor: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commitfa1b752be2Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
This commit is contained in:
@@ -118,6 +118,12 @@ var (
|
||||
RepoRootPath string
|
||||
ScriptType string
|
||||
|
||||
// Repo editor settings
|
||||
Editor struct {
|
||||
LineWrapExtensions []string
|
||||
PreviewTabApis []string
|
||||
}
|
||||
|
||||
// UI settings
|
||||
UI struct {
|
||||
ExplorePagingNum int
|
||||
@@ -141,6 +147,7 @@ var (
|
||||
Markdown struct {
|
||||
EnableHardLineBreak bool
|
||||
CustomURLSchemes []string `ini:"CUSTOM_URL_SCHEMES"`
|
||||
MdFileExtensions []string
|
||||
}
|
||||
|
||||
// Picture settings
|
||||
@@ -162,6 +169,13 @@ var (
|
||||
AttachmentMaxFiles int
|
||||
AttachmentEnabled bool
|
||||
|
||||
// Repo Upload settings
|
||||
UploadTempPath string
|
||||
UploadAllowedTypes string
|
||||
UploadMaxSize int64
|
||||
UploadMaxFiles int
|
||||
UploadEnabled bool
|
||||
|
||||
// Time settings
|
||||
TimeFormat string
|
||||
|
||||
@@ -482,6 +496,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)
|
||||
|
||||
sec = Cfg.Section("picture")
|
||||
AvatarUploadPath = sec.Key("AVATAR_UPLOAD_PATH").MustString(path.Join(AppDataPath, "avatars"))
|
||||
forcePathSeparator(AvatarUploadPath)
|
||||
@@ -532,6 +556,8 @@ func NewContext() {
|
||||
log.Fatal(4, "Fail to map API settings: %v", err)
|
||||
} else if err = Cfg.Section("api").MapTo(&API); err != nil {
|
||||
log.Fatal(4, "Fail to map API settings: %v", err)
|
||||
} else if err = Cfg.Section("editor").MapTo(&Editor); err != nil {
|
||||
log.Fatal(4, "Fail to map Editor settings: %v", err)
|
||||
}
|
||||
|
||||
if Mirror.DefaultInterval <= 0 {
|
||||
@@ -546,6 +572,10 @@ func NewContext() {
|
||||
ShowFooterVersion = Cfg.Section("other").Key("SHOW_FOOTER_VERSION").MustBool()
|
||||
|
||||
HasRobotsTxt = com.IsFile(path.Join(CustomPath, "robots.txt"))
|
||||
|
||||
Markdown.MdFileExtensions = Cfg.Section("markdown").Key("MD_FILE_EXTENSIONS").Strings(",")
|
||||
Editor.LineWrapExtensions = Cfg.Section("editor").Key("LINE_WRAP_EXTENSIONS").Strings(",")
|
||||
Editor.PreviewTabApis = Cfg.Section("editor").Key("PREVIEW_TAB_APIS").Strings(",")
|
||||
}
|
||||
|
||||
var Service struct {
|
||||
|
||||
Reference in New Issue
Block a user