github_status_proxy

A php proxy to fetch github status changes

GPL-3.0 License

Stars
0

github_status_proxy

A php proxy to fetch github status changes.

This collection of scripts is used to work as a receiver for GitHub's POST requests ( push hooks ) and as a scheduler for behind-firewall integration clients.

It stores the received events in a round-robin sqlite3 database.

Code Control

Install

Requires

  • PHP 5.4.0+
  • php-sqlite3 (SQLite3)
  • php-curl
  • php-mbstring

Recommented

  • sqlite3

Prepare:

  • create hook:

    curl -i -u :user -d \
      '{"name": "web", "active": true, "events": ["push", "pull_request"], \
        "config": {"url": "https://github:[email protected]", "content_type": "form"}}' \
      https://api.github.com/repos/:user/:repo/hooks
    
  • create a tooken for the config.php -> access_token:

    curl -i -u :user -d \
      '{"scopes": ["repo:status","read:org"], "note": ["GitHub Proxy"], "note_url": ["yourUrl"]}' \
      https://api.github.com/authorizations
    
  • create two random secrets:

    • for your test client to connect to your proxy/scheduler config.php -> $client_secret
    • for the salt for the keys for unauthorized users config.php -> statusSalt
    apg -m 20
    

License

This code is licensed under the GPLv3+. See LICENSE for more details.

To do

  • if a pull request gets an update, do not schedule the old commits that are still in received-state
  • move whole client handling from index.php -> testClient.php
  • create entries for each test client in test table as soon as an event
    is created OR define "no entry" = "has to be tested"
  • access tests only via the event MVC object
  • create two tables commit and pull and de-clutter event table
  • Round Robin
    http://www.mail-archive.com/[email protected]/msg60752.html
  • add Syntax Highlighting for user side views
Badges
Extracted from project README
Scrutinizer Quality Score