Project

phlegethon

0.0
No commit activity in last 3 years
No release in over 3 years
Bridging PayPal Webhooks to RabbitMQ
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

>= 0
>= 0
 Project Readme
       _     _                 _   _
 _ __ | |__ | | ___  __ _  ___| |_| |__   ___  _ __
| '_ \| '_ \| |/ _ \/ _` |/ _ \ __| '_ \ / _ \| '_ \
| |_) | | | | |  __/ (_| |  __/ |_| | | | (_) | | | |
| .__/|_| |_|_|\___|\__, |\___|\__|_| |_|\___/|_| |_|
|_|                 |___/

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. 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