wai-middleware-consul alternatives and similar packages
Based on the "wai" category.
Alternatively, view wai-middleware-consul alternatives based on common mentions on social networks and blogs.
-
wai-middleware-auth
Authentication middleware that secures WAI application -
wai-middleware-static
WAI middleware that intercepts requests to static files and serves them if they exist. -
wai-middleware-throttle
WAI Request Throttling Middleware -
wai-middleware-metrics
WAI middleware that collects requests metrics -
wai-middleware-rollbar
Middleware that communicates to Rollbar. -
wai-cli
Command line runner for Wai apps (using Warp) with TLS, CGI, socket activation & graceful shutdown | now on https://codeberg.org/unrelentingtech/wai-cli -
wai-enforce-https
Enforce HTTPS in Wai server app safely. -
wai-middleware-crowd
Middleware and utilities for using Atlassian Crowd authentication -
wai-session-postgresql
WAI Session that keeps its data in a PostgreSQL database -
wai-util
Utility functions for WAI that haven't found another home yet -
wai-session-clientsession
Session store based on clientsession -
wai-slack-middleware
A Slack middleware for wai -
wai-middleware-etag
WAI ETag middleware for static files -
wai-middleware-json-errors
Convert errors to json -
wai-middleware-hmac
WAI HMAC Authentication Middleware and Client -
wai-session-tokyocabinet
Session store based on Tokyo Cabinet -
wai-hastache
Nice wrapper around hastache for use with WAI -
wai-middleware-preprocessor
WAI middleware for static file preprocessors -
wai-digestive-functors
Helpers to bind digestive-functors onto wai requests -
wai-middleware-headers
addHeaders and cors for Haskell's Network.Wai -
wai-middleware-cache
Caching middleware for WAI -
wai-middleware-caching
WAI Middleware to cache (contains generic, LRUCache and Redis Cache backend) -
wai-middleware-delegate
A WAI middleware that enables proxying WAI requests to another server. -
wai-middleware-static-embedded
Serve static files embedded in your executable as a wai middleware. -
wai-middleware-static-caching
WAI middleware that intercepts requests to static files and serves them if they exist. -
wai-git-http
Haskell Wai Application for git http-backend -
wai-middleware-travisci
WAI middleware for authenticating webhook payloads from Travis CI -
wai-feature-flags
Feature flag support for WAI applications. -
wai-logger-buffered
A buffered logger for wai applications -
wai-middleware-slack-verify
WAI Slack request verification middleware -
wai-handler-snap
Web Application Interface handler using snap-server. (deprecated)
Build time-series-based applications quickly and at scale.
Do you think we are missing an alternative of wai-middleware-consul or a related project?
README
WAI Consul Middleware
This library assists you in monitoring Consul k/v data & with proxying data to Consul safely from the Internet. The first use case is receiving Github 'push' notifications when a repository is updated and doing a git pull on all webservers to update content. The [example](./example) app shows GitHub Webhooks working.
┌─────────┐ ┌─────────┐
│ Github │ │ │
│ Repo │─────▶│ AWS ELB │
│ Webhook │ │ │
└─────────┘ └─────────┘
│
┌────────────┬──────┘─ ─ ─
│ │
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ │ │ │ │ │
┌──│ WAI App │ │ WAI App │ │ WAI App │
│ │ │ │ │ │ │
│ └─────────┘ └─────────┘ └─────────┘
│ ▲ ▲
│ │ │
│ ┌────────────┴────────────┘
│ │
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐
│ │ │ │ │ │ │
└─▶│ Consul │──│ Consul │──│ Consul │
│ │ │ │ │ │
└─────────┘ └─────────┘ └─────────┘
Install
cabal install wai-middleware-consul
Or if you want to play with the example github webhook web-app:
cabal install -fexample wai-middleware-consul
Example
You'll need to launch a small Consul cluster to try the example app. It's easy to do with Docker. Please use the following steps:
Launch 4 containers of Docker w/ Consul running on each
docker run -d --name node1 -h node1 progrium/consul -server -bootstrap-expect 3
sleep 10
JOIN_IP="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' node1)"
docker run -d --name node2 -h node2 progrium/consul -server -join $JOIN_IP
docker run -d --name node3 -h node3 progrium/consul -server -join $JOIN_IP
docker run -d -p 8400:8400 -p 8500:8500 -p 8600:53/udp --name node4 -h node4 progrium/consul -join $JOIN_IP
sleep 10
Try out all the interfaces of Consul
- Browse the Web UI Interface
Query Consul at the command line
consul members
Query the HTTP Interface
curl 0.0.0.0:8500/v1/catalog/nodes
Query the DNS Interface
dig @0.0.0.0 -p 8600 node1.node.consul
Setting up a Github Webhook
First we start `ngrok` to proxy HTTP requests from the Internet to our local machine (most likely behind a firewall). Then we'll start the example web application to receive webhooks from Github.
Run the example application (in the root Github directory for wai-middleware-consul). We need to be in this directory so our example app can find/read cabal & Github version status.
./.cabal-sandbox/bin/wai-middleware-consul-example
Try navigating to the example app page. http://0.0.0.0:8080
Run ngrok to expose the example application to the Internet:
ngrok 8080 ;# take note of this public web address for Github
Set up the webhook for the repo on Github. Point it to the ngrok web address and add the path /github onto that URL ( eg, https://be2f75d.ngrok.com/github ). This is the specific route in the example application for Github->Consul data updates.
Now that we have the application running and a proxy to the public Internet established, we can receive webhook events.
Try pushing to the repository. You should see notifications that an event was received in the web application STDOUT log. The event should be pushed into Consul also. The web application will be listening to events from Consul & this will fire also. You should see it try to `git pull` the repository & you should see the changes if you refresh the home page of the example app.
Cleanup (kill & remove Consul containers)
for n in $(seq 1 4); do
docker kill node$n
docker rm node$n
done