diff options
author | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2018-07-03 05:56:32 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-07-03 06:56:32 +0300 |
commit | cbee921c28b9299a0f4ee751f8fd55a430b571f2 (patch) | |
tree | a5ab67fa1703781eecc90701b2f701384ec7e3ba /modules | |
parent | 69796ddd64b89de066952ea19b6332f51bbf3f81 (diff) | |
download | gitea-cbee921c28b9299a0f4ee751f8fd55a430b571f2.tar.gz gitea-cbee921c28b9299a0f4ee751f8fd55a430b571f2.zip |
Limit uploaded avatar image-size to 4096x3072 by default (#4353)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/setting/setting.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index cf9f59853b..a5f4457f33 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -341,6 +341,8 @@ var ( // Picture settings AvatarUploadPath string + AvatarMaxWidth int + AvatarMaxHeight int GravatarSource string GravatarSourceURL *url.URL DisableGravatar bool @@ -1024,6 +1026,8 @@ func NewContext() { if !filepath.IsAbs(AvatarUploadPath) { AvatarUploadPath = path.Join(AppWorkPath, AvatarUploadPath) } + AvatarMaxWidth = sec.Key("AVATAR_MAX_WIDTH").MustInt(4096) + AvatarMaxHeight = sec.Key("AVATAR_MAX_HEIGHT").MustInt(3072) switch source := sec.Key("GRAVATAR_SOURCE").MustString("gravatar"); source { case "duoshuo": GravatarSource = "http://gravatar.duoshuo.com/avatar/" |