BaGet icon indicating copy to clipboard operation
BaGet copied to clipboard

Document how to update the package index in mirror mode

Open MarcusWichelmann opened this issue 5 years ago • 5 comments

I've set up an instance of the BaGet server using the provided Docker image and configured mirroring:

- ApiKey=<key>
- Storage__Type=FileSystem
- Storage__Path=/var/baget/packages
- Database__Type=Sqlite
- Database__ConnectionString=Data Source=/var/baget/baget.db
- Search__Type=Database
- Mirror__Enabled=True
- Mirror__PackageSource=https://api.nuget.org/v3/index.json

But the packages page is still empty. To my understanding I need to somehow trigger an index update, but I cannot find any information about this in the docs. Could you clarify this please?

MarcusWichelmann avatar Oct 22 '19 22:10 MarcusWichelmann

Hi, you can add packages from the mirrored package source two ways:

  1. Use BaGet as your only package source and kick off a dotnet restore. BaGet will index packages as you restore them.
  2. Or, navigate to https://your-baget-url/v3/registration/newtonsoft.json/12.0.1.json. This will index Newtonsoft.Json v12.0.1.

I'll improve the documentation to clarify this. Please let me know if you have any additional questions!

loic-sharma avatar Oct 23 '19 15:10 loic-sharma

The problem I'm having is that I don't see results when I press Browse from the Nuget package manager and search for a package; it shows an empty list. It does not act as a read-through cache to Nuget.org. (I have set the MIRROR__ENABLED=true env variable) Any help would be appreciated.

P.S. The goal when using read-through caching would be to completely "hide" nuget.org.

tzographos avatar Oct 23 '19 22:10 tzographos

@tzographos That's a good idea, but this is very tricky to get right. I've added an issue to track that: https://github.com/loic-sharma/BaGet/issues/406

loic-sharma avatar Oct 24 '19 00:10 loic-sharma

Any progress on this?

VAllens avatar Feb 23 '22 04:02 VAllens

Any new progress ?

Mo-GH avatar Mar 20 '23 15:03 Mo-GH