diff options
author | Peter Smit <peter@smitmail.eu> | 2015-02-23 12:34:41 +0200 |
---|---|---|
committer | Peter Smit <peter@smitmail.eu> | 2015-02-23 12:34:41 +0200 |
commit | 556881964fb8137561e9f381d4a5aaef97627cc5 (patch) | |
tree | 32aebddd8c123c540cf04ac6dfd0e503450d9247 /modules/setting/setting.go | |
parent | aa68e86206d7d9fc74de8630acfa07dfd7f1bc95 (diff) | |
parent | ee68a826a55c6a4305e7f609db57501a54a5bc47 (diff) |
Merge branch 'access' into access_rewriteserv
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r-- | modules/setting/setting.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 795bcc5b..6a361056 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -245,7 +245,10 @@ func NewConfigContext() { ReverseProxyAuthUser = sec.Key("REVERSE_PROXY_AUTHENTICATION_USER").MustString("X-WEBAUTH-USER") sec = Cfg.Section("attachment") - AttachmentPath = path.Join(workDir, sec.Key("PATH").MustString("data/attachments")) + AttachmentPath = sec.Key("PATH").MustString("data/attachments") + if !filepath.IsAbs(AttachmentPath) { + AttachmentPath = path.Join(workDir, AttachmentPath) + } AttachmentAllowedTypes = sec.Key("ALLOWED_TYPES").MustString("image/jpeg|image/png") AttachmentMaxSize = sec.Key("MAX_SIZE").MustInt64(32) AttachmentMaxFiles = sec.Key("MAX_FILES").MustInt(10) @@ -302,7 +305,10 @@ func NewConfigContext() { sec = Cfg.Section("picture") PictureService = sec.Key("SERVICE").In("server", []string{"server"}) - AvatarUploadPath = path.Join(workDir, sec.Key("AVATAR_UPLOAD_PATH").MustString("data/avatars")) + AvatarUploadPath = sec.Key("AVATAR_UPLOAD_PATH").MustString("data/avatars") + if !filepath.IsAbs(AvatarUploadPath) { + AvatarUploadPath = path.Join(workDir, AvatarUploadPath) + } os.MkdirAll(AvatarUploadPath, os.ModePerm) switch sec.Key("GRAVATAR_SOURCE").MustString("gravatar") { case "duoshuo": |