summaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
authorJustin Nuß <justin.nuss@hmmh.de>2014-07-24 15:19:59 +0200
committerJustin Nuß <justin.nuss@hmmh.de>2014-07-24 15:19:59 +0200
commitbfe5b86004791823b198be76084aa128d262b290 (patch)
tree95e7e6f9633793f20d43309412fe9c2e66b1527f /modules/setting
parent43e5de7f830a098582b519706f9c5da6eecd2c3e (diff)
downloadgitea-bfe5b86004791823b198be76084aa128d262b290.tar.gz
gitea-bfe5b86004791823b198be76084aa128d262b290.zip
Add file upload for attachments
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/setting.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index ba9e86dc8f..349ef11595 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -74,6 +74,8 @@ var (
// Attachment settings.
AttachmentPath string
AttachmentAllowedTypes string
+ AttachmentMaxSize int64
+ AttachmentMaxFiles int
// Cache settings.
Cache cache.Cache
@@ -172,6 +174,8 @@ func NewConfigContext() {
AttachmentPath = Cfg.MustValue("attachment", "PATH", "files/attachments")
AttachmentAllowedTypes = Cfg.MustValue("attachment", "ALLOWED_TYPES", "*/*")
+ AttachmentMaxSize = Cfg.MustInt64("attachment", "MAX_SIZE", 32)
+ AttachmentMaxFiles = Cfg.MustInt("attachment", "MAX_FILES", 10)
if err = os.MkdirAll(AttachmentPath, os.ModePerm); err != nil {
log.Fatal("Could not create directory %s: %s", AttachmentPath, err)