diff options
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r-- | modules/setting/setting.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 7f9d9908..acd3aae6 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -15,10 +15,11 @@ import ( "strings" "time" + "gopkg.in/ini.v1" + "github.com/Unknwon/com" "github.com/macaron-contrib/oauth2" "github.com/macaron-contrib/session" - "gopkg.in/ini.v1" "github.com/gogits/gogs/modules/bindata" "github.com/gogits/gogs/modules/log" @@ -284,9 +285,9 @@ func NewConfigContext() { if !filepath.IsAbs(AttachmentPath) { AttachmentPath = path.Join(workDir, AttachmentPath) } - AttachmentAllowedTypes = sec.Key("ALLOWED_TYPES").MustString("image/jpeg|image/png") + AttachmentAllowedTypes = strings.Replace(sec.Key("ALLOWED_TYPES").MustString("image/jpeg,image/png"), "|", ",", -1) AttachmentMaxSize = sec.Key("MAX_SIZE").MustInt64(32) - AttachmentMaxFiles = sec.Key("MAX_FILES").MustInt(10) + AttachmentMaxFiles = sec.Key("MAX_FILES").MustInt(5) AttachmentEnabled = sec.Key("ENABLE").MustBool(true) TimeFormat = map[string]string{ @@ -345,11 +346,13 @@ func NewConfigContext() { if !filepath.IsAbs(AvatarUploadPath) { AvatarUploadPath = path.Join(workDir, AvatarUploadPath) } - switch sec.Key("GRAVATAR_SOURCE").MustString("gravatar") { + switch source := sec.Key("GRAVATAR_SOURCE").MustString("gravatar"); source { case "duoshuo": GravatarSource = "http://gravatar.duoshuo.com/avatar/" - default: + case "gravatar": GravatarSource = "//1.gravatar.com/avatar/" + default: + GravatarSource = source } DisableGravatar = sec.Key("DISABLE_GRAVATAR").MustBool() if OfflineMode { |