Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

✨ Add support for Github Enterprise #159

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

✨ Add support for Github Enterprise #159

wants to merge 4 commits into from

Conversation

muffix
Copy link

@muffix muffix commented Sep 7, 2018

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

This adds support for GitHub Enterprise which can be configured using
the three new command line arguments with the enterprise prefix (see
documentation).

Closes #145
Closes #148
@wdahlenburg
Copy link

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.

Fixes download of files when using Github Enterprise. It now uses the
existing Github client to download the files instead of making a manual
HTTP request.
@muffix
Copy link
Author

muffix commented Oct 20, 2018

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.

@wdahlenburg
Copy link

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.

@sa7mon
Copy link

sa7mon commented Aug 6, 2019

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

passing Github Enterprise with custom hostname Feature Request Enterprise Githubs
3 participants