forked from kevadesu/forgejo
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:
parent
b222dbc1d1
commit
07df6614dc
12 changed files with 62 additions and 19 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue