From 6a23252edc36a3d99b35af69a310fd31f687f3cb Mon Sep 17 00:00:00 2001 From: Unknwon Date: Tue, 10 Feb 2015 21:06:59 -0500 Subject: able to allow insecure certification of webhook for #891 --- modules/cron/manager.go | 2 +- modules/setting/setting.go | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'modules') diff --git a/modules/cron/manager.go b/modules/cron/manager.go index 135fec4faa..2990ab0604 100644 --- a/modules/cron/manager.go +++ b/modules/cron/manager.go @@ -15,7 +15,7 @@ var c = New() func NewCronContext() { c.AddFunc("Update mirrors", "@every 1h", models.MirrorUpdate) - c.AddFunc("Deliver hooks", fmt.Sprintf("@every %dm", setting.WebhookTaskInterval), models.DeliverHooks) + c.AddFunc("Deliver hooks", fmt.Sprintf("@every %dm", setting.Webhook.TaskInterval), models.DeliverHooks) if setting.Git.Fsck.Enable { c.AddFunc("Repository health check", fmt.Sprintf("@every %dh", setting.Git.Fsck.Interval), models.GitFsck) } diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 55e0a79ab8..d71a8cda55 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -68,8 +68,11 @@ var ( ReverseProxyAuthUser string // Webhook settings. - WebhookTaskInterval int - WebhookDeliverTimeout int + Webhook struct { + TaskInterval int + DeliverTimeout int + AllowInsecureCertification bool + } // Repository settings. RepoRootPath string @@ -508,8 +511,10 @@ func newNotifyMailService() { } func newWebhookService() { - WebhookTaskInterval = Cfg.Section("webhook").Key("TASK_INTERVAL").MustInt(1) - WebhookDeliverTimeout = Cfg.Section("webhook").Key("DELIVER_TIMEOUT").MustInt(5) + 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() } func NewServices() { -- cgit v1.2.3