From d02e45f985ce371eb33fcca86bf80ca078be1d88 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 11 Feb 2015 12:04:01 -0500 Subject: better naming on #891 --- modules/setting/setting.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/setting') diff --git a/modules/setting/setting.go b/modules/setting/setting.go index d71a8cda..6664c419 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. @@ -514,7 +514,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() { -- cgit v1.2.3 From f625665d8d72fdc4d2ce28a88aaaf01eaf5c2370 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sat, 14 Feb 2015 17:49:33 -0500 Subject: modules/setting: add abs path check before add workdir prefix --- modules/setting/setting.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'modules/setting') diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 6664c419..52dca3f0 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -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": -- cgit v1.2.3