{"action":"created","issue":{"url":"https://api.github.com/repos/IonicaBizau/repository-downloader/issues/14","repository_url":"https://api.github.com/repos/IonicaBizau/repository-downloader","labels_url":"https://api.github.com/repos/IonicaBizau/repository-downloader/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/IonicaBizau/repository-downloader/issues/14/comments","events_url":"https://api.github.com/repos/IonicaBizau/repository-downloader/issues/14/events","html_url":"https://github.com/IonicaBizau/repository-downloader/issues/14","id":129235761,"number":14,"title":"Enterprise Github Support","user":{"login":"tegansnyder","id":1200195,"avatar_url":"https://avatars.githubusercontent.com/u/1200195?v=3","gravatar_id":"","url":"https://api.github.com/users/tegansnyder","html_url":"https://github.com/tegansnyder","followers_url":"https://api.github.com/users/tegansnyder/followers","following_url":"https://api.github.com/users/tegansnyder/following{/other_user}","gists_url":"https://api.github.com/users/tegansnyder/gists{/gist_id}","starred_url":"https://api.github.com/users/tegansnyder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tegansnyder/subscriptions","organizations_url":"https://api.github.com/users/tegansnyder/orgs","repos_url":"https://api.github.com/users/tegansnyder/repos","events_url":"https://api.github.com/users/tegansnyder/events{/privacy}","received_events_url":"https://api.github.com/users/tegansnyder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-01-27T19:01:13Z","updated_at":"2016-08-02T08:08:43Z","closed_at":null,"body":"A small change to the `github.js` file will allow this to work on enterprise Github accounts. I'm suggesting a new item added to the `config.json` template to control the API endpoint for Github.\r\n\r\nFor instance changing the url to support Enterprise 2.4 below:\r\n```js\r\nfunction makeApiRequest(api, callback) {\r\n    Request({\r\n        url: \"https://github.mydomain.com/api/v3/\" + api\r\n      , auth: Config.github\r\n      , json: true\r\n      , headers: {\r\n            \"user-agent\": \"Repo Downloader\"\r\n        }\r\n    }, function (err, res, body) {\r\n        err = err || body.error || body.message;\r\n        if (err) { return callback(err); }\r\n        callback(null, body);\r\n    });\r\n}\r\n```\r\n\r\nThis endpoint URL could be added to the `config.json` file so it could be referenced like:\r\n```js\r\nfunction makeApiRequest(api, callback) {\r\n    Request({\r\n        url: Config.github.endpoint + api\r\n...\r\n```\r\n\r\nAdditionally the SSH URL needs similar treatment to reference the enterprise Github domain instead of Github.com:\r\n\r\n```js\r\nc.ssh_url = \"git@github.mydomain.com:\" + c.full_name + \".git\";\r\n```\r\nI'm thinking a similar `config.js` for this could be added. \r\n\r\nHeck here is my proposal:\r\n* Add two new entries to `config.js` template for Enterprise Github support:\r\n - `Config.github.domain`\r\n - `Config.github.api_path`\r\n\r\nThen they can be set like this:\r\n```js\r\nConfig.github.domain = 'github.mydomain.com';\r\nConfig.github.api_path = '/api/v3';\r\n```\r\n\r\nAnd referenced in `github.js` like this:\r\n\r\n```js\r\nfunction makeApiRequest(api, callback) {\r\n    Request({\r\n        url: Config.github.domain + '/' + Config.github.api_path + api\r\n      , auth: Config.github\r\n      , json: true\r\n      , headers: {\r\n            \"user-agent\": \"Repo Downloader\"\r\n        }\r\n    }, function (err, res, body) {\r\n        err = err || body.error || body.message;\r\n        if (err) { return callback(err); }\r\n        callback(null, body);\r\n    });\r\n}\r\n```\r\n\r\n```js\r\nc.ssh_url = \"git@\" + Config.github.domain + \":\" + c.full_name + \".git\";\r\n```\r\n\r\nThoughts?"},"comment":{"url":"https://api.github.com/repos/IonicaBizau/repository-downloader/issues/comments/236833560","html_url":"https://github.com/IonicaBizau/repository-downloader/issues/14#issuecomment-236833560","issue_url":"https://api.github.com/repos/IonicaBizau/repository-downloader/issues/14","id":236833560,"user":{"login":"IonicaBizau","id":2864371,"avatar_url":"https://avatars.githubusercontent.com/u/2864371?v=3","gravatar_id":"","url":"https://api.github.com/users/IonicaBizau","html_url":"https://github.com/IonicaBizau","followers_url":"https://api.github.com/users/IonicaBizau/followers","following_url":"https://api.github.com/users/IonicaBizau/following{/other_user}","gists_url":"https://api.github.com/users/IonicaBizau/gists{/gist_id}","starred_url":"https://api.github.com/users/IonicaBizau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IonicaBizau/subscriptions","organizations_url":"https://api.github.com/users/IonicaBizau/orgs","repos_url":"https://api.github.com/users/IonicaBizau/repos","events_url":"https://api.github.com/users/IonicaBizau/events{/privacy}","received_events_url":"https://api.github.com/users/IonicaBizau/received_events","type":"User","site_admin":false},"created_at":"2016-08-02T08:08:43Z","updated_at":"2016-08-02T08:08:43Z","body":"@tegansnyder I realize that I totally missed this issue.  Sorry for that (next time, ping me)!\r\n\r\nI'd be happy to add this in the core if you raise a PR. :rocket: "}}
{"actor":{"display_login":"IonicaBizau"}}