ricloud-receiver is an example webhook receiver implementation. It is written in Python using the Django web framework, which gives us the benefits of:
- Years of opensource security enhancements.
- Easy to use and extensible database model layer.
- Reasonable performance and straightforward deployment.
The easiest way to run the receiver is on the command line using the GitHub source code. Django has a number of useful commands for getting setup quicky. For more in-depth details visit the Django docs.
Clone the repo with:
git clone email@example.com:reincubate/ricloud-receiver.git
Setup basic development configuration by renaming the file
local.env.example to just
local.env. The contents of this file will override the production default settings.
Run database migrations with:
Create a superuser for the built-in admin with:
Now, you can run the development server with:
Check that things are running by opening
http://localhost:8000 in a browser. You should see a friendly message.
At this point we have a running receiver, but it's only reachable locally. The simplest way to expose it to the API's event publisher is through a utility like ngrok.
Go to the ngrok site and follow their installation instructions for your operating system.
Run the program using:
ngrok http -bind-tls=true 8000
This will setup traffic forwarding from an ngrok url to your local receiver server. You will see in the details of the ngrok url next to the 'Forwarding' entry in the commands output.
To build the full webhook receiver url, add
/webhooks to the end of this url. For example,
Now, you can use this webhook receiver url to setup a webhook config by following the configuration instructions.