-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Implement go mod proxy strategy #43
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
base: main
Are you sure you want to change the base?
Conversation
| }) | ||
|
|
||
| // Register a catch-all handler that filters for Go module proxy patterns | ||
| mux.Handle("GET /{path...}", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this not be a sub-path? eg. /gomod/...?
I want to rethink how strategies get mounted, but in the interim I'd prefer to namespace them if possible. When we're mounting multiple strategies, it's hard to reason about how they'll interact.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can and should! I'll fix this.
Co-authored-by: Alec Thomas <aat@block.xyz>
|
I had another thought - I think we should enforce private repository blocking here, to prevent leaking to upstream public module proxies. |
|
Which did also lead me to wonder whether we should be implementing a full proxy...but I think that's a question for another time. |
|
Actually... https://github.com/goproxy/goproxy is explicitly designed to be embeddable, and has an extensible caching interface. Let's do some due diligence around whether this would be worthwhile to embed. The advantage this could give us is the ability to cache private repositories. |
What
Implements a caching strategy for the Go module proxy as described in https://proxy.golang.org/
Why
To add support for caching go modules
Tests
Implemented unit tests. In addition manual testing was performed as follows...
cachew.hcl:Run the proxy
./cachewd --config cachew.hclManual verification...