]> source.dussan.org Git - gitea.git/commitdiff
modules/setting: mirror path issue
authorUnknwon <joe2010xtmf@163.com>
Mon, 9 Feb 2015 03:23:01 +0000 (22:23 -0500)
committerUnknwon <joe2010xtmf@163.com>
Mon, 9 Feb 2015 03:23:01 +0000 (22:23 -0500)
modules/setting/setting.go

index f5212a28673b55b72e8f4ac279fa0cf932763a24..55e0a79ab82641144710449965c6e3049b04c317 100644 (file)
@@ -237,7 +237,7 @@ func NewConfigContext() {
        ReverseProxyAuthUser = sec.Key("REVERSE_PROXY_AUTHENTICATION_USER").MustString("X-WEBAUTH-USER")
 
        sec = Cfg.Section("attachment")
-       AttachmentPath = sec.Key("PATH").MustString("data/attachments")
+       AttachmentPath = path.Join(workDir, sec.Key("PATH").MustString("data/attachments"))
        AttachmentAllowedTypes = sec.Key("ALLOWED_TYPES").MustString("image/jpeg|image/png")
        AttachmentMaxSize = sec.Key("MAX_SIZE").MustInt64(32)
        AttachmentMaxFiles = sec.Key("MAX_FILES").MustInt(10)
@@ -294,7 +294,7 @@ func NewConfigContext() {
 
        sec = Cfg.Section("picture")
        PictureService = sec.Key("SERVICE").In("server", []string{"server"})
-       AvatarUploadPath = sec.Key("AVATAR_UPLOAD_PATH").MustString("data/avatars")
+       AvatarUploadPath = path.Join(workDir, sec.Key("AVATAR_UPLOAD_PATH").MustString("data/avatars"))
        os.MkdirAll(AvatarUploadPath, os.ModePerm)
        switch sec.Key("GRAVATAR_SOURCE").MustString("gravatar") {
        case "duoshuo":