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

Added support for private repositories #23

Merged
merged 8 commits into from Oct 24, 2017
Merged

Added support for private repositories #23

merged 8 commits into from Oct 24, 2017

Conversation

dominiklessel
Copy link
Contributor

This PR allows to set two new environment variables to enable support for private repos:

  • GH_TOKEN - GitHub personal access token needed to access the private repo.
  • PRIVATE_BASE_URL - Base URL of the update server (e.g. update.example.com).

Both are required to make hazel work with private repos.

The proxyPrivateDownload helper found in routes.js uses node-fetch to proxy the private file through hazel. This obviously leads to higher server load and increased bandwidth usage, but should be okay for this specific use case 😸

Copy link
Contributor

@leo leo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good! 😲 Just a few things:

  • GH_TOKEN => TOKEN
  • PRIVATE_BASE_URL => URL

Can we also add support for Now's NOW_URL environment flag (which contains the URL of the current deployment)?

.gitignore Outdated
@@ -3,3 +3,9 @@ node_modules

# logs
npm-debug.log

# Docker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove all of this after here? I don't see how it's necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will do. Just added it for internal testing purposes

@dominiklessel
Copy link
Contributor Author

Just updated the PR 👨‍🔧

@leo leo changed the title Add private repo support Added support for private repositories Oct 24, 2017
@leo leo merged commit 163e494 into vercel:master Oct 24, 2017
@leo
Copy link
Contributor

leo commented Oct 24, 2017

Thank you so much! 😍

@leo leo mentioned this pull request Oct 24, 2017
@dominiklessel
Copy link
Contributor Author

Nice! Thank you for merging 😃

@zeke
Copy link

zeke commented Oct 24, 2017

Thanks, @dominiklessel!

@karanjthakkar
Copy link
Contributor

@leo This was unfortunately broken with this commit For private repos, browser_download_url is not used. The url from the asset object is also needed. Would you accept a PR which doesn't break #26 but also supports this?

@leo
Copy link
Contributor

leo commented Nov 7, 2017

@karanjthakkar Yep. That would be wonderful!

@apurvaSynerzip
Copy link

@dominiklessel @leo Can you share working example for Github private repo?

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.

None yet

5 participants