mirror of
https://github.com/gogs/gogs.git
synced 2025-12-21 15:50:00 +01:00
release: able to add attchments to release (#1614)
Added new config section '[release.attachment]’.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user