BaGet
BaGet copied to clipboard
Document how to update the package index in mirror mode
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?
Hi, you can add packages from the mirrored package source two ways:
- Use BaGet as your only package source and kick off a
dotnet restore
. BaGet will index packages as you restore them. - 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!
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 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
Any progress on this?
Any new progress ?