Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to use themes hosted on enterprise GitHub instances. #53

Merged
merged 4 commits into from
Jun 12, 2019

Conversation

jallenwork
Copy link
Contributor

@jallenwork jallenwork commented Jun 7, 2019

I'd like to use this for repos hosted in our enterprise instance at work (as would several of my coworkers) so I thought I would throw this against the wall and see if it stuck. I'm not a ruby programmer, so any stylistic feedback is welcome.
Fixes #43


View rendered README.md

@welcome
Copy link

welcome bot commented Jun 7, 2019

Welcome! Congrats on your first pull request to Jekyll Remote Theme. If you haven't already, please be sure to check out the contributing guidelines.

@benbalter
Copy link
Owner

Thanks for this @jallenwork. Curious, do you need to be able to pull from multiple enterprise instances, or could the host be set in the config file as an override?

@jallenwork
Copy link
Contributor Author

I personally don't have any need to use multiple enterprise instances, so for my use case a config file override would work fine. Would you prefer that the host get it's own entry in _config.yml?
Something like:
remote_theme_host: github.<enterprise>.com

@benbalter
Copy link
Owner

@jallenwork really appreciate the PR. Based on your work, I pushed up a minor refactor that I think makes things a bit more readable and user friendly.

Now, themes can be in the form of owner/repo or http://example.com/owner/repo.

If no host is supplied, github.com is assumed.

If a host is supplied, it must be the GitHub Enterprise instance which the site is being built on (to prevent builds on GitHub.com being sent to a malicious server).

We always download from codeload.THEME_HOST.

Does that make sense / meet your needs?

@jallenwork
Copy link
Contributor Author

@benbalter This looks great, thanks for putting in the extra effort on this, I really appreciate it. This should work famously for myself and others running GH Enterprise instances.

@benbalter benbalter merged commit 4aff02b into benbalter:master Jun 12, 2019
@welcome
Copy link

welcome bot commented Jun 12, 2019

Congrats on getting your first pull request to Jekyll Remote Theme merged! Without amazing humans like you submitting pull requests, we couldn’t run this project. You rock! 🎉

If you're interested in tackling another bug or feature, take a look at the open issues, especially those labeled help wanted.

@dmittman
Copy link

dmittman commented Dec 5, 2021

From reading through the comments and by administering a GitHub Enterprise Server for a number of years, I think I have an understanding of the requirements for hosting remote themes on GHES, but I thought I'd double-check my understanding.

The comments mention codeload, which suggests that your GHES is required to have subdomain isolation enabled for this approach to work.

Also, the code, I think, mentions that the repo hosting the remote must be "public." The term public can mean a few things, depending on how your GHES is configured, but I'm assuming that it means that the repo hosting the remote theme must not require authentication of any kind.

GHES's that either don't have subdomain isolation enabled or are using private mode can't use this approach.

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

Successfully merging this pull request may close these issues.

Github Enterprise Support
3 participants