Skip to content

Commit

Permalink
Improve doc and versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrimee committed Aug 3, 2016
1 parent 05aa911 commit 022e86c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ NAME = $(REPO)

DOCKERCMD ?= docker

VERSION ?= $(shell git describe --tags)
VERSION ?= $(shell git describe --abbrev=0 HEAD --tags)

current_dir = $(shell pwd)

Expand Down
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,42 @@ This proxy can be used when an application needs to receive json web hooks from

## Usage

whproxy --host my.publichost.com --port 12345
whproxy --host my.publichost.com --port 8080

At the moment the same port is used for webhooks and websockets.

Then establish a websocket connection to my.publichost.com:12345 and you will receive a json payload with the URL of your private webhook endpoint.
Then establish a websocket connection to my.publichost.com:8080 and you will receive a json payload with the URL of your private webhook endpoint.
Incoming webhooks events are passed on to the websocket, encapsulated inside the 'data' field of the json object.

## Encryption

Encryption is enabled by providing a certificate and key file

whproxy --host my.publichost.com --port 80 --sslport 443 --cert cert.pem --key key.unencrypted.pem
whproxy --host my.publichost.com --port 8443 --cert cert.pem --key key.unencrypted.pem

If you use self-signed certificates, be sure to enable cert pinning on the client.

openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 360
openssl rsa -in key.pem -out key.unencrypted.pem -passin pass:TYPE_YOUR_PASS
openssl rsa -in key.pem -out key.unencrypted.pem

## Validation

You can enforce the presence of a valid HMAC in the header of incoming webhooks but giving the '-validate' option

## Docker

docker run -it -p 12345:12345 quay.io/sgrimee/whproxy -host my.docker.host
docker run -it -p 12345:12345 quay.io/sgrimee/whproxy:v0.2.0 -host my.docker.host

Available versions can be found at: https://quay.io/repository/sgrimee/whproxy?tab=tags

If you use certificates, mount them with

```
docker run -it -p 12345:12345 -p 12346:12346 \
docker run -it -p 8080:12345 \
-v $(pwd)/cert.pem:/cert.pem \
-v $(pwd)/key.unencrypted.pem:/key.pem \
quay.io/sgrimee/whproxy -host my.docker.host -cert /cert.pem -key /key.pem
quay.io/sgrimee/whproxy:v0.2.0 \
-host my.docker.host \
-cert /cert.pem -key /key.pem
```

0 comments on commit 022e86c

Please sign in to comment.