npm clients need one registry for internal and public packages, but npm virtuals have no merger, so a local npm repo and npmjs cannot be served together. - merge packuments across members: union versions (member order wins), first-defined dist-tags minus ones naming missing versions - serve full and abbreviated (`install-v1`) packuments, scoped names included, via the shared virtual merge cache - point tarballs at `<virtual>/<member>/<path>` and 302 them to the owning member - reject an invalid Host with 400; serve virtual and local packuments `no-store` with `Vary: Host, X-Forwarded-Proto, Accept` - return 502 when a member errors; skip members without the package - add `docs/npm/virtual.md` and a stock `node:22` e2e-docker case Reviewed-on: #152 Co-authored-by: unkin-agent <unkin-agent@unkin.net> Co-committed-by: unkin-agent <unkin-agent@unkin.net>
This commit was merged in pull request #152.
This commit is contained in:
@@ -166,6 +166,7 @@ func (s *Server) routes() chi.Router {
|
||||
r.Mount(tfregistry.MountPath, s.tfRegistry.Routes())
|
||||
|
||||
proxyHandler := v1.NewProxyHandler(s.engine, s.virtEngine, s.db, s.store, s.localHandler)
|
||||
s.virtEngine.NPMLocal = proxyHandler.LocalNPMPackument
|
||||
r.Mount("/api/v1", proxyHandler.Routes())
|
||||
r.Mount("/v2", proxyHandler.DockerV2Routes())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user