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

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

Open
iBug opened this issue Aug 13, 2024 · 4 comments
Open

Comments

@iBug
Copy link

iBug commented Aug 13, 2024

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
Copy link
Member

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

@iBug
Copy link
Author

iBug commented Aug 22, 2024

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:

  • Fetch /versions unconditionally and either:
    • Generate /versions.md5sum file so we (mirror sites) can serve its content as the ETag value for the /versions file, to maintain compatibility with Bundler 2.4.
    • Save the ETag server header to /versions.md5sum which may be even more compatible.
  • For every gem, fetch /info/#{gem.name} if either:
    • The target file is missing.
    • A new version of the gem is being fetched.
  • For every info file, delete it if deletion is enabled and the corresponding gem has gone.

@89ao
Copy link

89ao commented Sep 6, 2024

@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
Copy link
Author

iBug commented Oct 29, 2024

According to tuna/issues#2048, a mirror created by gem mirror without additional care is unusable with gem.

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