mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
able to allow insecure certification of webhook for #891
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
@@ -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() {
|
||||
|
Reference in New Issue
Block a user