gitrob
gitrob copied to clipboard
✨ Add support for Github Enterprise
This adds support for GitHub Enterprise which can be configured using the three new command line arguments with the enterprise prefix (see documentation).
The URL of the Github Enterprise installation (-enterprise-url
) must be specified. The username should be specified (-enterprise-user
, defaults to the first target). Depending on the configuration of the Github Enterprise instance, the upload URL must be specified (-enterprise-upload-url
) if it differs from the main URL.
Authentication is supported through an access token that must be created in the settings of the Github Enterprise account.
Closes #145 Closes #148
Tested this branch out. There are a few comments I have.
There are two instances where "github.com" and "rawgithubcontent.com" are hardcoded and do not use the enterprise URL.
I'd like to see these both use the enterprise url for a smooth user experience.
I'd like a better example of how to use the additional enterprise flags. This could either be done in the options or on the readme. Write out the expected input.
Cheers @wdahlenburg, good spot. The incorrect URLs for GHE instances broke the preview in the web interface which should be fixed now. I also clarified the use of the new flags.
Thanks for the updates. It works as intended and the documentation helps.
One interesting side effect from this is that when the rate limit is exhausted a user can not access files on the webpage. The content from clicking on a path will not load until the rate limit timeout has been reached.
In an enterprise if the rate limit is not configured this will not be an issue. For standard users, this might be an issue if they are pulling many files. The documentation is here.
I am admittedly a Go novice, but when I attempted to build this fork with go build .
I got the following errors:
./main.go:106:20: sess.GithubURL undefined (type *core.Session has no field or method GithubURL)
./main.go:120:69: cannot use sess (type *core.Session) as type int in argument to core.CloneRepository
./main.go:168:35: too many arguments in call to finding.Initialize
I'm sure I'm missing something easy, do you think you could point me to it?