mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 01:57:20 +00:00
Added option to disable web hooks
This mod introduces DISABLE_WEB_HOOKS parameter in [security] section of app.ini (by default set to false). If set to true it disables web hooks feature. Any existing undelivered web hook tasks will be cancelled. Any existing web hook definitions will be left untouched in db but its delivery tasks will be ignored. Author-Change-Id: IB#1105130
This commit is contained in:
@ -68,6 +68,11 @@ func checkBranch(w *models.Webhook, branch string) bool {
|
||||
}
|
||||
|
||||
func prepareWebhook(w *models.Webhook, repo *models.Repository, event models.HookEventType, p api.Payloader) error {
|
||||
// Skip sending if web hooks are disabled.
|
||||
if setting.DisableWebHooks {
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, e := range w.EventCheckers() {
|
||||
if event == e.Type {
|
||||
if !e.Has() {
|
||||
|
Reference in New Issue
Block a user