This application will make sure you can automatily reopen Service Desk issues on Gitlab.
- python
- pip
- requirements.txt
Please make sure you test the webhook on https://webhook.site to see what value BOT_USERNAME should have in your case:
{
"object_kind": "note",
"event_type": "confidential_note",
"user": {
"id": 1337,
"name": "GitLab Support Bot",
"username": "support-bot",
"avatar_url": "[REDACTED]",
"email": "[REDACTED]"
},
}
Create a .env
file with the following contents:
SECRET_KEY="somesecretkeyfromdjango"
BOT_USERNAME="support-bot"
GITLAB_ACCESS_TOKEN="your-specialaccestokengitlab"
GITLAB_API_URL="https://gitlab.com/api/v4/projects/support/bot"
-
Note: remember if you are using this url to make sure you will use instead of a
/
the character/
. -
Note: if you want to set the x-gitlab-token to make sure unauthorized people can not use this webhook you can use the env variable:
GITLAB_X_TOKEN
pip install -r requirements.txt
You can deploy this project directly to Heroku with:
heroku create -a automaticly-reopen --region eu
git push heroku master
heroku config:set DISABLE_COLLECTSTATIC=1
Or run it locally with:
./manage.py runserver
And if you run it locally you can use a service like ngrok / localtunnel to test the webhooks.