diff options
author | Unknwon <u@gogs.io> | 2017-03-13 04:32:20 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-13 04:32:20 -0400 |
commit | 1df54ea0cde038e2057d083078f952c072d0dc67 (patch) | |
tree | c5466e010f5ed8e236f5b021e669f9aa37ea0047 /modules/setting | |
parent | e6df2259abdeb75545f53a5ca4c247491b5c3d7f (diff) |
release: able to add attchments to release (#1614)
Added new config section '[release.attachment]’.
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/setting.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index cc83de7d..3945fa90 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -146,6 +146,17 @@ var ( PagingNum int } + // Release settigns + Release struct { + Attachment struct { + Enabled bool + TempPath string + AllowedTypes []string `delim:"|"` + MaxSize int64 + MaxFiles int + } `ini:"-"` + } + // Markdown sttings Markdown struct { EnableHardLineBreak bool @@ -590,6 +601,8 @@ func NewContext() { log.Fatal(2, "Fail to map HTTP settings: %v", err) } else if err = Cfg.Section("webhook").MapTo(&Webhook); err != nil { log.Fatal(2, "Fail to map Webhook settings: %v", err) + } else if err = Cfg.Section("release.attachment").MapTo(&Release.Attachment); err != nil { + log.Fatal(2, "Fail to map Release.Attachment settings: %v", err) } else if err = Cfg.Section("markdown").MapTo(&Markdown); err != nil { log.Fatal(2, "Fail to map Markdown settings: %v", err) } else if err = Cfg.Section("smartypants").MapTo(&Smartypants); err != nil { |