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

Mirroring for repos requiring authentication #247

Open
viraptor opened this issue Aug 29, 2019 · 2 comments
Open

Mirroring for repos requiring authentication #247

viraptor opened this issue Aug 29, 2019 · 2 comments

Comments

@viraptor
Copy link

I couldn't find a description of how I could run gemstack mirroring for a specific rubygems repo which requires authentication.

I've got the credentials for the repo configured in ~/.bundle/config, but if I specify BUNDLE_MIRROR__.... for it as well, the download fails. Am I missing something trivial?

@tjwp
Copy link

tjwp commented Dec 14, 2019

I just figured out how to get this to work.

The credentials from ~/.bundle/config don't get used. Maybe that is due to bundler not passing them along to the mirror when using the simpler approach described here? https://github.com/rubygems/gemstash/blob/master/docs/gemstash-mirror.7.md

The solution that I found was to include the /upstream path when specifying the gemstash mirror and include the credentials in the CGI escaped URI.

So the configuration command will look something like:

bundle config mirror.https://private.gem.host http://localhost:9292/upstream/$(ruby -rcgi -e 'puts CGI.escape("https://user:[email protected]")')

@jebentier
Copy link
Contributor

Recently tried doing the above to mirror our Gemfury repo which uses basic auth as well but just an api token of the form https://<api_token>@gem.fury.io/<repo>. Because the basic auth isn't of the form user:password, Faraday by default wasn't respecting it in the URL. I'm putting together a small PR that adds support for this, which should help anyone that using a private repo service like gemfury.

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

No branches or pull requests

3 participants