rubygems / rubygems-mirror

The `gem mirror` RubyGems command, creates local mirrors of all gems from a remote gem source.
http://github.com/rubygems/rubygems-mirror
MIT License
270 stars 88 forks source link

`gem mirror` should also download the `/versions` file and the `/info/` directory #80

Open iBug opened 2 months ago

iBug commented 2 months ago

According to issues like:

A full RubyGems mirror generated by gem mirror is not easy to consume - Both gem install and bundle fetches tons of gemspec.rz files if a faster index is not found (previously /api/v1/dependencies, now superseded by /versions + /info/), making a local mirror actually much slower even under terrible availability of rubygems.org (e.g. from mainland China).

If gem mirror could also fetch the versions file and populate the /info/ directory, downstream mirror sites will be much easier to use.

segiddins commented 2 months ago

That would be a great improvement, I'd be happy to review a PR if you're able to pull one together!

iBug commented 2 months ago

I took a look at the existing code and it seems too entangled for me to handle. I hope someone from Ruby could take on this.

My ideas are:

89ao commented 2 months ago

@iBug Share one of our practices, which is to redirect the /info/ directory to the official address, so that no matter what package is downloaded and installed, the original metadata will be accessed.

iBug commented 1 week ago

According to https://github.com/tuna/issues/issues/2048, a mirror created by gem mirror without additional care is unusable with gem.