license-server
A server which watches your organization and outputs license information for repos which contain a package.json
file.
Usage
NPM:
Deploy onto Heroku:
When deploying to Heroku a few environment variables are required:
org
The organization where repos to be checked are.
gitToken
This is an api access token to communicate with Github.
To create your personal github access token go here:
- https://github.com/settings/tokens
- Press "Generate Token"
- Ensure "repo" is checked (nothing else is needed)
gitHookSecret:
This is a secret token value for Github to communicate via webhooks.
- Visit your orgs settings/hooks at this link:
https://github.com/organizations/[Your Org Here]/settings/hooks
- Press "Add Webhook"
- Enter in the url where your app will sit followed by "/git_hook" for instance: http://awesome-company-site.com/git_hook
- Generate and enter in Secret (https://developer.github.com/webhooks/securing/). This secret is what you'll set when setting
gitHookSecret
- Make sure "just push events" is selected.
- Press "Add Webhook"
Local Development
Ensure you've set the following environment variables:
$ export NODE_ENV=development$ export org=your org #(eg. Jam3) $ export gitToken=your github access token #(details below)
If you're testing webhooks (your server will need to be accessible by github) do the following:
$ export gitHookSecret=your github webhook secret
Optionally you can also do:
$ export repoRegex=regex value
The above will will check which repos licenses will be checked. For instance if the repos you'd like to check started with project-
you'd do the following:
$ export repoRegex=project-.+
License
MIT, see LICENSE.md for details.