summaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-02-22 22:51:25 -0500
committerUnknwon <u@gogs.io>2015-02-22 22:51:25 -0500
commit7ccab9cd09eca8fa60fdd519c97c259d4b521abd (patch)
tree914ea87da32fd27d889b2145f559c0fdad8c62af /modules/setting
parent25f5a8d7986a710cef01d02725071d2de0a6b143 (diff)
parent2369881808a906f3072c935ab0575f08bd358821 (diff)
downloadgitea-7ccab9cd09eca8fa60fdd519c97c259d4b521abd.tar.gz
gitea-7ccab9cd09eca8fa60fdd519c97c259d4b521abd.zip
Merge branch 'dev' of github.com:gogits/gogs into access
Conflicts: gogs.go models/models.go models/user.go templates/.VERSION templates/org/home.tmpl
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/setting.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index 795bcc5ba2..6a36105691 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":