Coder Social home page Coder Social logo

kiall / github-notification-proxy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rapid7/github-notification-proxy

0.0 2.0 0.0 67 KB

A proxy for delivering GitHub webhooks to internal locations without firewall pinholes or port forwarding.

License: MIT License

Ruby 91.61% HTML 8.39%

github-notification-proxy's Introduction

Github Notification Proxy

The Github Notification Proxy stores and delivers Github notifications to protected locations without requiring firewall pinholes or port forwarding. The server runs in the cloud or a DMZ and receives notifications from Github. The client runs inside a network and polls (or uses websockets to continuously monitor) the server for notifications.

No data from internal destinations is ever returned to Github.

At this time, the Github Notification Proxy does not support any form of authentication or authorization. It is recommended that you use host based authentication on your webserver to protect access to the server URLs.

The server is built using Sinatra. Notifications are stored in PostgreSQL and discarded as soon as they are delivered.

Reliability

The server makes no guarantees of reliability. Notification messages from Github are always accepted, regardless of whether they can be delivered.

The client acknowledges notifications regardless of whether they can be delivered.

Server

The Github Notification Proxy can run on any Rack-based server. We recommend Puma. To start the server:

puma

Websockets are only supported on servers that support socket hijacking such as Phusion Passenger and Puma. Apache is known to not work properly with WebSockets.

Client

The client polls the server for incoming notifications and delivers them internally. Handlers are defined in config/config.yml. Regular expressions are used to validate the notification URL and transform it into an internal URL for delivery.

Handler Configuration

Handler configuration is stored in config/config.yml. Configuration looks similar to:

handlers:
  jira-proxy:
    match: ^(\d+)/sync$
    url: https://myjiraserver.local/rest/bitbucket/1.0/repository/$1/sync
  jenkins-proxy:
    - match: ^my-job/([^\/]+)$
      url: https://myjenkinsserver.local/job/My-Job/build?token=myjenkinsbuildtoken&cause=$1
    - match: ^ghprbhook/$
      url: https://myjenkinsserver.local/ghprbhook/

In the above example, two handlers are defined jira-proxy and jenkins-proxy. Notifications posted to /444/sync will be delivered to https://myjiraserver.local/rest/bitbucket/1.0/repository/444/sync.

Notifications that do match a handler and regular expression will be logged and dropped.

Poll

This processes any pending notifications and then immediately exits. This is useful in a cron job.

./bin/client process

Continuous Monitoring

This monitors for notifications continuously (using a websocket). This is useful for daemons.

./bin/client start

Check for notifications

To list notifications without processing them:

./bin/client check

Chef

A chef cookbook is included in this repo for installing and configuring the notification proxy.

License

Copyright 2014, Rapid7 Inc. MIT License

github-notification-proxy's People

Contributors

blt04 avatar kiall avatar devkmsg avatar bturner-r7 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.