Giter Club home page Giter Club logo

gith's People

Contributors

agnoster avatar danheberden avatar doowb avatar naholyr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gith's Issues

Project updates?

Can we expect this project to be updated? Its a very useful app but hasn't had critical updates, like the data format change, applied so the main version has become out of date.

Payload decode issue

I'm trying to use gith with bitbucket.
Bitbucket sends payload with lot of '+' characters in payload data. which should be decoded to ' ' (space character) I believe.
But gith uses the character as such and eventually json decoding fails.

I have inspected the hook post with requestb.in and attached the screenshot. I have also attached the error screenshot.

screen_000275
screen_000276

Support GitHub API calls with OAuth

From the initial blog post about gith:

There are more features planned and unit tests to write, but we wanted you to see it as soon as possible and have an opportunity to get involved and give feedback. This is what I’m planning to attack in the immediate future:

  • Supporting github API calls with OAuth
  • ...

Support GitHub API calls with OAuth
The feature that I want added most if definitely integration to support GitHub API calls with OAuth, which can probably be easily achieved by depending on the [unofficial] github module.

Gith responding to github with status 200 but callback not called.

I have beem attempting to implement git hooks with gith have had no luck.
Even the very simple example below does not behave as I would expect.
Status code 200 is being returned to github, so the gith server
is obviously running, but the callback is not ever being called.

var gith = require('gith').create(9004); // ensure to match the port you entered in Github

gith().on( 'all', function( payload ) {
  console.log( 'Post-receive happened!' );
});

For the record I'm using Ubuntu 14.04 x64

Filtering ignores 'repo' filter when 'branch' matches

We have a situation where we have multiple platforms that all have a 'master' branch, that trigger their own build job on our CI machines. Each platform has its own repository on Github.

It turns out that a change on 'master' to one of the repo's ends up triggering the payload for all repositories with the same branch name.

As a workaround, we are double checking the value of payload.repo against the repo we're supposed to receive the hook from.

Add filter function unit tests

Need to test things like

gith({
  repo: function( payload ) {
     return /gith/.test( payload.repo );
  }
}).on( 'all', function( payload ) {
  /* do stuff */
});

and create/test

gith( function( payload ) {
  /* check payload for stuff */
  this.emit( 'customevent', payload );
}).on( 'customevent', function( payload ) {
  /* yay! */
});

Poll for new repos and auto-subscribe them

Poll for new repos and auto-subscribe them.

From the initial blog post about gith:

There are more features planned and unit tests to write, but we wanted you to see it as soon as possible and have an opportunity to get involved and give feedback. This is what I’m planning to attack in the immediate future:

  • ...
  • Polling an account for new repositories and automatically subscribing them to the WebHook url
  • ...

Only allow traffic from offical ips

Since GitHub specifies from which IPs they will send the request, gith should only accept data from these (and optionally some specified ones)

The Public IP addresses for these hooks are:
207.97.227.253,
50.57.128.197,
108.171.174.178,
50.57.231.61.

This info can be found under Settings > Service Hooks > WebHook URLs

Error parsing JSON from github

I receive this error when receiving data from github...

Application has thrown an uncaught exception and is terminated:
SyntaxError: Unexpected token %
at Object.parse (native)
at IncomingMessage. (C:\DWASFiles\Sites\gitcopy\VirtualDirectory0\site\wwwroot\node_modules\gith\lib\gith.js:235:28)
at IncomingMessage.emit (events.js:64:17)
at HTTPParser.parserOnMessageComplete as onMessageComplete
at Socket.ondata (http.js:1506:22)
at Pipe.onread (net.js:374:27)

This is caused by the data being querystring escaped. I have a pull request with a fix that I'll be submitting.

no PHP found

This project needs some serious overhaul.

require_once("moar-php.php");

Include a binary for ease of use

It would be quite cool it if were possible to execute a gith-command that automatically starts a new server based on a configuration file, much in the same way that tools like gulp and grunt do it.

The configuration file could even have some default locations, like $PWD/gith.js, ~/.gith.js or /etc/gith/gith.js. It would also make the configuration file a bit more declarative.

Doesn't work anymore, gith expects a different format of data.

Does this library even still work for anyone? In version 1.04 I am able to receiving POSTs from github webhooks, but they all seem to be failing this payload regular expression test.

req.on( "end", function() {
      if ( /^payload=/.test( data ) ) {
        var payload = JSON.parse( querystring.unescape(data.slice(8)) );
        eventaur.emit( "payload", payload );
        res.writeHead( 200, {
          'Content-type': 'text/html'
        });
      }
      res.end();
    });

However if I edit gith to just expect the payload and not playload={ /* data */ }, then it works.

req.on( "end", function() {
    var payload;
    try {
        payload = JSON.parse( data );
        eventaur.emit( "payload", payload );
        res.writeHead( 200, {
            'Content-type': 'text/html'
        });
    } catch(err) { 
        console.log(err);
    }
    res.end();
});

Has anyone else had issues?

end never call on GitHub Test

node 8.9, connectivity confirmed, testing from github hook panel (Test Hook button)

For some obscur reason, the end event is not being called.

gith.js

this.server = http.createServer( function( req, res ) {
var data = "";
if ( req.method === "POST" ) {
  req.on( "data", function( chunk ) {
     /// I DO SEE CHUNK BEING APPENED TO DATA
    data += chunk;
  });
}

req.on( "end", function() { // <<--- THIS GUY NEVER GETS CALLED
  if ( /^payload=/.test( data ) ) {
    var payload = JSON.parse( querystring.unescape(data.slice(8)) );
    eventaur.emit( "payload", payload );
  }
  res.end();
});

res.writeHead( 200, {
  'Content-type': 'text/html'
});
res.end();
  }).listen( port );

Since end doesn't get called, gith just never picks up any message....

Add secret query param to prevent false payloads

Add secret query param to prevent false payloads.

From the initial blog post about gith:

There are more features planned and unit tests to write, but we wanted you to see it as soon as possible and have an opportunity to get involved and give feedback. This is what I’m planning to attack in the immediate future:

  • ...
  • Specifying a secret query-string-argument in the url (e.g., ?secret=password) to prevent the server from receiving false payloads

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.