2019-07-08 08:50:38 +00:00
|
|
|
# Webhooks administration **(CORE ONLY)**
|
2014-05-27 12:12:15 +00:00
|
|
|
|
2020-04-28 06:09:49 +00:00
|
|
|
GitLab provides Rake tasks for webhooks management.
|
|
|
|
|
|
|
|
Requests to the [local network by webhooks](../security/webhooks.md) can be allowed or blocked by an
|
|
|
|
administrator.
|
|
|
|
|
|
|
|
## Add a webhook to all projects
|
|
|
|
|
|
|
|
To add a webhook to all projects, run:
|
2013-06-05 14:32:22 +00:00
|
|
|
|
2020-01-30 15:09:15 +00:00
|
|
|
```shell
|
2019-07-01 04:24:02 +00:00
|
|
|
# omnibus-gitlab
|
|
|
|
sudo gitlab-rake gitlab:web_hook:add URL="http://example.com/hook"
|
2020-04-28 06:09:49 +00:00
|
|
|
|
2019-07-01 04:24:02 +00:00
|
|
|
# source installations
|
|
|
|
bundle exec rake gitlab:web_hook:add URL="http://example.com/hook" RAILS_ENV=production
|
2019-07-01 03:36:23 +00:00
|
|
|
```
|
2013-06-05 14:32:22 +00:00
|
|
|
|
2020-04-28 06:09:49 +00:00
|
|
|
## Add a webhook to projects in a namespace
|
|
|
|
|
|
|
|
To add a webhook to all projects in a specific namespace, run:
|
2013-06-05 14:32:22 +00:00
|
|
|
|
2020-01-30 15:09:15 +00:00
|
|
|
```shell
|
2019-07-01 04:24:02 +00:00
|
|
|
# omnibus-gitlab
|
2020-04-28 06:09:49 +00:00
|
|
|
sudo gitlab-rake gitlab:web_hook:add URL="http://example.com/hook" NAMESPACE=<namespace>
|
|
|
|
|
2019-07-01 04:24:02 +00:00
|
|
|
# source installations
|
2020-04-28 06:09:49 +00:00
|
|
|
bundle exec rake gitlab:web_hook:add URL="http://example.com/hook" NAMESPACE=<namespace> RAILS_ENV=production
|
2019-07-01 03:36:23 +00:00
|
|
|
```
|
2013-06-05 14:32:22 +00:00
|
|
|
|
2020-04-28 06:09:49 +00:00
|
|
|
## Remove a webhook from projects
|
|
|
|
|
|
|
|
To remove a webhook from all projects, run:
|
2013-06-05 14:32:22 +00:00
|
|
|
|
2020-01-30 15:09:15 +00:00
|
|
|
```shell
|
2019-07-01 04:24:02 +00:00
|
|
|
# omnibus-gitlab
|
|
|
|
sudo gitlab-rake gitlab:web_hook:rm URL="http://example.com/hook"
|
2020-04-28 06:09:49 +00:00
|
|
|
|
2019-07-01 04:24:02 +00:00
|
|
|
# source installations
|
|
|
|
bundle exec rake gitlab:web_hook:rm URL="http://example.com/hook" RAILS_ENV=production
|
2019-07-01 03:36:23 +00:00
|
|
|
```
|
2013-06-05 14:32:22 +00:00
|
|
|
|
2020-04-28 06:09:49 +00:00
|
|
|
## Remove a webhook from projects in a namespace
|
|
|
|
|
|
|
|
To remove a webhook from projects in a specific namespace, run:
|
2013-06-05 14:32:22 +00:00
|
|
|
|
2020-01-30 15:09:15 +00:00
|
|
|
```shell
|
2019-07-01 04:24:02 +00:00
|
|
|
# omnibus-gitlab
|
2020-04-28 06:09:49 +00:00
|
|
|
sudo gitlab-rake gitlab:web_hook:rm URL="http://example.com/hook" NAMESPACE=<namespace>
|
|
|
|
|
2019-07-01 04:24:02 +00:00
|
|
|
# source installations
|
2020-04-28 06:09:49 +00:00
|
|
|
bundle exec rake gitlab:web_hook:rm URL="http://example.com/hook" NAMESPACE=<namespace> RAILS_ENV=production
|
2019-07-01 03:36:23 +00:00
|
|
|
```
|
2013-06-05 14:32:22 +00:00
|
|
|
|
2020-04-28 06:09:49 +00:00
|
|
|
## List all webhooks
|
|
|
|
|
|
|
|
To list all webhooks, run:
|
2013-06-05 14:32:22 +00:00
|
|
|
|
2020-01-30 15:09:15 +00:00
|
|
|
```shell
|
2019-07-01 04:24:02 +00:00
|
|
|
# omnibus-gitlab
|
|
|
|
sudo gitlab-rake gitlab:web_hook:list
|
2020-04-28 06:09:49 +00:00
|
|
|
|
2019-07-01 04:24:02 +00:00
|
|
|
# source installations
|
|
|
|
bundle exec rake gitlab:web_hook:list RAILS_ENV=production
|
2019-07-01 03:36:23 +00:00
|
|
|
```
|
2013-06-05 14:32:22 +00:00
|
|
|
|
2020-04-28 06:09:49 +00:00
|
|
|
## List webhooks for projects in a namespace
|
|
|
|
|
|
|
|
To list all webhook for projects in a specified namespace, run:
|
2013-06-05 14:32:22 +00:00
|
|
|
|
2020-01-30 15:09:15 +00:00
|
|
|
```shell
|
2019-07-01 04:24:02 +00:00
|
|
|
# omnibus-gitlab
|
2020-04-28 06:09:49 +00:00
|
|
|
sudo gitlab-rake gitlab:web_hook:list NAMESPACE=<namespace>
|
|
|
|
|
2019-07-01 04:24:02 +00:00
|
|
|
# source installations
|
2020-04-28 06:09:49 +00:00
|
|
|
bundle exec rake gitlab:web_hook:list NAMESPACE=<namespace> RAILS_ENV=production
|
2019-07-01 04:24:02 +00:00
|
|
|
```
|