From 1df54ea0cde038e2057d083078f952c072d0dc67 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Mon, 13 Mar 2017 04:32:20 -0400 Subject: release: able to add attchments to release (#1614) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added new config section '[release.attachment]’. --- modules/setting/setting.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'modules/setting') 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 { -- cgit v1.2.3