gitlab-org--gitlab-foss/app/models/hooks/system_hook.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
660 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class SystemHook < WebHook
2017-12-04 05:18:54 -05:00
include TriggerableHooks
2017-07-20 11:12:06 -04:00
2017-12-04 09:45:47 -05:00
triggerable_hooks [
2017-12-04 05:18:54 -05:00
:repository_update_hooks,
:push_hooks,
:tag_push_hooks,
:merge_request_hooks
]
2017-05-02 22:36:13 -04:00
default_value_for :push_events, false
default_value_for :repository_update_events, true
2017-09-13 11:17:34 -04:00
default_value_for :merge_requests_events, false
validates :url, system_hook_url: true
# Allow urls pointing localhost and the local network
def allow_local_requests?
Gitlab::CurrentSettings.allow_local_requests_from_system_hooks?
end
def pluralized_name
_('System Hooks')
end
def help_path
'administration/system_hooks'
end
end