_ _ _ _
_ __ | |__ | | ___ __ _ ___| |_| |__ ___ _ __
| '_ \| '_ \| |/ _ \/ _` |/ _ \ __| '_ \ / _ \| '_ \
| |_) | | | | | __/ (_| | __/ |_| | | | (_) | | | |
| .__/|_| |_|_|\___|\__, |\___|\__|_| |_|\___/|_| |_|
|_| |___/
Welcome to phlegethon
Phlegethon is a generic endpoint for Webhooks which forwards all requests to RabbitMQ.
Installation
Add this line to your application's Gemfile:
gem 'phlegethon'
And then execute:
$ bundle
Or install it yourself as:
$ gem install phlegethon
Usage
Simply run
phlegethon
It will look for a config file in the following places
./phlegethon.yml
~/.phlegethon.yml
Configuration
A phlegethon config file may look like this; these are the defaults
rabbitmq:
exchange: webhooks
host: localhost
server:
port: 3002
ssl: false
With the above config you can test you endpoint with curl
curl -d '{"hey":"ho"}' -H 'Content-type: application/json' http://localhost:3002
Prerequisites
To use phlegethon with https you have to have libssl-dev
installed
before installing eventmachine.
apt-get install libssl-dev
gem install eventmachine
Use with Docker
Works nicely with https://hub.docker.com/_/rabbitmq/, hence...
export RABBITMQ_MANAGEMENT_PORT=15672
export PHLEGETHON_PORT=3002
docker run -h rabbit --name rabbitmq -p $RABBITMQ_MANAGEMENT_PORT:15672 rabbitmq:3-management
docker run --link rabbitmq -p $PHLEGETHON_PORT:3002 branch14/phlegethon
To build the image from the Dockerfile run
docker build -t branch14/phlegethon .
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Trivia
In Greek mythology, the river Phlegethon (Φλεγέθων, English translation: "flaming") or Pyriphlegethon (Πυριφλεγέθων, English translation: "fire-flaming") was one of the five rivers in the infernal regions of the underworld, along with the rivers Styx, Lethe, Cocytus, and Acheron. Plato describes it as "a stream of fire, which coils round the earth and flows into the depths of Tartarus". It was parallel to the river Styx. It is said that the goddess Styx was in love with Phlegethon, but she was consumed by his flames and sent to Hades. Eventually when Hades allowed her river to flow through, they reunited. Wikipedia
Todo
- improve configurabilty (cli), steal from acheron
- make it work with ssl
- daemonize, steal from acheron