From 7102c4ff7c2c839e1628e302af928423d4477ffd Mon Sep 17 00:00:00 2001 From: Antoine RENELEAU Date: Wed, 12 Aug 2015 14:51:18 +0200 Subject: [PATCH] Enhance readme and config example --- README.md | 11 +++++++++-- config/config.json.dist | 32 ++++++++++++++++++-------------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 160c15f..178842e 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,14 @@ Options : * *projects* : an array of Github repository's names (optional, default get all repositories), * *org* : an array of Github organizations, * *apiUrl* : url of your Github API (optional, default is `https://api.github.com`), - * *token* : authorization token for API calls (optional, it can increase API rate limit). * *descendingOrder* : allow to change ordering of pull requests (optional, default is `true`). + * *token* : authorization token for API calls (optional, it can allow access to more repos and increase API rate limit) NB: if a token is set, OAuth will be ignored for the team + * *oauthAppClientId* : clientId of the OAuth app the team depends on (optional) +* **githubOAuth** : OAuth config (optional) + * *gatekeeperBaseUrl* : url to [Gatekeeper](https://github.com/M6Web/gatekeeper) (see OAuth section) + * *apps* : list of the apps you use to auth + * *url* : base url of GitHub (should be https://github.com or the base url of your GitHub enterprise) + * *clientId* : clientId of the app ## Run the server @@ -54,6 +60,7 @@ To use GTR with GitHub OAuth you must : * Register a new application on GitHub (in Settings > Applications) * Install [Gatekeeper](https://github.com/M6Web/gatekeeper) and launch it * Set your "gatekeeperBaseUrl" and type in your app data (clientId and GitHub URL) in config/config.json (example in config.json.dist) +* Don't forget to link the OAuth app to the teams thanks to the oauthAppClientId property Then, you should see the Auth button in the upper-right corner of the app ! @@ -89,7 +96,7 @@ $ cp Vagrantfile.dist Vagrantfile ```shell $ vagrant up -$ vagrant provision # because of npm issue on the first vagrant up +$ vagrant provision # because of npm issue on the first vagrant up $ vagrant ssh $ cd /vagrant ``` diff --git a/config/config.json.dist b/config/config.json.dist index 2b89c32..843ea65 100644 --- a/config/config.json.dist +++ b/config/config.json.dist @@ -1,29 +1,33 @@ { "config": { + "refreshInterval": 90, + "teams": { + "teamWithStaticToken": { + "members": ["username1", "username2", "username3"], + "projects": ["repo1", "repo2"], + "orgs": ["orgname1", "orgname2"], + "token": "apiToken", + "descendingOrder": true + }, + "teamWithOAuth": { + "members": ["username4", "username2", "username5"], + "orgs": ["orgname2", "orgname4"], + "apiUrl": "https://github.enterprise.fr/api/v3", + "oauthAppClientId":"c13n71D" + } + }, "githubOAuth": { "gatekeeperBaseUrl": "http://localhost:9999", "apps": [ { "url": "https://github.enterprise.fr", - "clientId":"" + "clientId":"c13n71D" }, { "url": "https://github.com", - "clientId":"" + "clientId":"t0k3n5" } ] - }, - "refreshInterval": 90, - "teams": { - "myTeam": { - "members": ["username1", "username2", "username3"], - "projects": ["repo1", "repo2"], - "orgs": ["orgname1", "orgname2"], - "apiUrl": "https://api.github.com", - "token": "apiToken", - "descendingOrder": true, - "oauthAppClientId":"" - } } } }