diff options
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r-- | modules/setting/setting.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 0f293b6905..49bd11c4c2 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -66,9 +66,10 @@ var ( ScriptType string // Picture settings. - PictureService string - GravatarSource string - DisableGravatar bool + PictureService string + AvatarUploadPath string + GravatarSource string + DisableGravatar bool // Log settings. LogRootPath string @@ -259,6 +260,9 @@ func NewConfigContext() { ScriptType = Cfg.MustValue("repository", "SCRIPT_TYPE", "bash") PictureService = Cfg.MustValueRange("picture", "SERVICE", "server", []string{"server"}) + AvatarUploadPath = Cfg.MustValue("picture", "AVATAR_UPLOAD_PATH", "data/avatars") + os.MkdirAll(AvatarUploadPath, os.ModePerm) + switch Cfg.MustValue("picture", "GRAVATAR_SOURCE", "gravatar") { case "duoshuo": GravatarSource = "http://gravatar.duoshuo.com/avatar/" |