-
Notifications
You must be signed in to change notification settings - Fork 161
[master] Update GOPROXY to use default with fallback #745
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
Conversation
| RUN apt-get update && apt-get install -y curl devscripts equivs git | ||
|
|
||
| ENV GOPROXY=direct | ||
| ENV GOPROXY=https://proxy.golang.org|direct |
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.
Is it the right separator?
https://go.dev/ref/mod#environment-variables
Two keywords may be used in place of proxy URLs:
off: disallows downloading modules from any source. direct: download directly from version control repositories instead of using a module proxy.GOPROXY defaults to https://proxy.golang.org,direct. Under that configuration, the go command first contacts the Go module mirror run by Google, then falls back to a direct connection if the mirror does not have the module. See https://proxy.golang.org/privacy for the mirror's privacy policy. The GOPRIVATE and GONOPROXY environment variables may be set to prevent specific modules from being downloaded using proxies. See Privacy for information on private proxy configuration.
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.
See the other section on the same page; https://go.dev/ref/mod#goproxy-protocol
List elements may be separated by commas (,) or pipes (|), which determine error fallback behavior. When a URL is followed by a comma, the go command falls back to later sources only after a 404 (Not Found) or 410 (Gone) response. When a URL is followed by a pipe, the go command falls back to later sources after any error, including non-HTTP errors such as timeouts. This error handling behavior lets a proxy act as a gatekeeper for unknown modules. For example, a proxy could respond with error 403 (Forbidden) for modules not on an approved list (see Private proxy serving private modules).
See golang/go#37367 and golang/go@69d3a34
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.
I can include that snipped in the commit message (perhaps doesn't hurt)
Use the default proxy, to assist with LTS distros that use old git versions but fallback on any error (instead of only on 404 and 410). From the Go documentation; https://go.dev/ref/mod#goproxy-protocol > List elements may be separated by commas (,) or pipes (|), which determine error > fallback behavior. When a URL is followed by a comma, the go command falls back > to later sources only after a 404 (Not Found) or 410 (Gone) response. When a URL > is followed by a pipe, the go command falls back to later sources after any error, > including non-HTTP errors such as timeouts. This error handling behavior lets a > proxy act as a gatekeeper for unknown modules. For example, a proxy could respond > with error 403 (Forbidden) for modules not on an approved list (see Private proxy > serving private modules). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
474cd99 to
72d51db
Compare
|
thx! bringing this one in as well |
Use the default proxy, to assist with LTS distros that use old git versions but fallback on any error (instead of only on 404 and 410).
From the Go documentation; https://go.dev/ref/mod#goproxy-protocol