diff options
author | Stefan-Code <Stefan-Code@users.noreply.github.com> | 2015-02-18 11:12:41 +0100 |
---|---|---|
committer | Stefan-Code <Stefan-Code@users.noreply.github.com> | 2015-02-18 11:12:41 +0100 |
commit | b508fb041ff83919eff6618a62658288745a2c1b (patch) | |
tree | 7fb4a602afe87800e7f24957d9702ce38bbea643 /modules/setting | |
parent | 1628ef4ba5120d338c0616e37153f9f9b2f8f236 (diff) | |
parent | a307574fbcb58bed41017fb2262852327cf050d0 (diff) |
Merge branch 'dev' of https://github.com/gogits/gogs into dev
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/setting.go | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index d71a8cda..52dca3f0 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -69,9 +69,9 @@ var ( // Webhook settings. Webhook struct { - TaskInterval int - DeliverTimeout int - AllowInsecureCertification bool + TaskInterval int + DeliverTimeout int + SkipTLSVerify bool } // Repository settings. @@ -240,7 +240,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) @@ -297,7 +300,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": @@ -514,7 +520,7 @@ func newWebhookService() { sec := Cfg.Section("webhook") Webhook.TaskInterval = sec.Key("TASK_INTERVAL").MustInt(1) Webhook.DeliverTimeout = sec.Key("DELIVER_TIMEOUT").MustInt(5) - Webhook.AllowInsecureCertification = sec.Key("ALLOW_INSECURE_CERTIFICATION").MustBool() + Webhook.SkipTLSVerify = sec.Key("SKIP_TLS_VERIFY").MustBool() } func NewServices() { |