Public | Automated Build

Last pushed: a year ago
Short Description
A small Node.js server that makes the github teams publically available via JSON and HTML.
Full Description

Open Github Teams Server



The github team api is private.

All actions against teams require at a minimum an authenticated user who is a
member of the Owners team in the :org being managed. Additionally, OAuth users
require the "read:org" scope.

This is awesome if you have a private organization but it complicates running an
open organization like NodeSchool.

open-github-teams to the rescue!!!

open-github-teams is a small Node.js server that takes
a little configuration and makes the teams accessible via JSON and HTML.

Get started!

  1. Install with $ npm i open-github-teams -g (you might need to prefix sudo)
  2. Get a private token from the github settings. The required permissions are read:org and admin:org_hook.
  3. Start it with
    $ env GITHUB_TOKEN="<your-token-here>" GITHUB_ORG="<your-org-here>" open-github-teams
    
  4. Open the url in the browser after it says its connected. Enjoy.

Docker

It is also possible to start the server with docker!

$ docker run martinheidegger:open-github-teams

Ports

By default, the server will be started on the 80 port in http mode and Additionally
at the 443 port if https is required. You can change those two values by specifying
a HTTPS_PORT and HTTP_PORT.

$ env GITHUB_TOKEN="<your-token-here>" \
     GITHUB_ORG="<your-org-here>" \
     HTTPS_PORT=8443 \
     HTTP_PORT=8000 \
     open-github-teams

Immediate update

By default the system caches the team-data in memory on the server and re-loads it
only every 20 days! To have immediate updates it is possible to setup Github hooks
that invalidate the cache.

Since its not a good idea if others can invalidate the cache you need to create
a SECRET that verifies that github is the one updating. To avoid that other
people know this code the server has to run via https. open-github-teams
automatically starts a free-ssl server using letsencrypt.
Because it is free you need to provide a email address and a pro-forma
I-agree-with-the-Terms-of-Service field that signs that you confirm with the tos.

$ env GITHUB_TOKEN="<your-token-here>" \
     GITHUB_ORG="<your-org-here>" \
     HTTP_PORT=8000 \
     SECRET="<your-secret-here" \
     HTTPS_EMAIL="<your-email-here>" \
     HTTPS_AGREE="yes" \
     HTTPS_PORT=8443 \
     open-github-teams

Note: By default the server will start with https if you pass in. You can explicitly prevent that from happening by setting the environment variable HTTP_ONLY to true.

How to generate a good secret

Generate a good secret key on Mac/Linux with

$ head -n 4096 /dev/urandom | shasum -a 256

Contribute

PR's and suggestions are always welcome! Please follow Contributing.md
or open an issue if you have any problem.

License

ISC

Docker Pull Command
Owner
martinheidegger

Comments (0)