feat: add support for GitHub download proxy in Makefile#12
feat: add support for GitHub download proxy in Makefile#120xharry wants to merge 1 commit intoopenecos-projects:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds optional GitHub download proxy support to the Makefile to help users in regions with restricted or slow access to GitHub's asset servers. By default, the proxy feature is disabled and uses https://gh-proxy.org/ when enabled. Users can enable it by running make download USE_PROXY=true.
Changes:
- Added configurable proxy support with
GH_PROXYandUSE_PROXYvariables - Modified download logic to prepend proxy URL when enabled
- Provides workaround for users experiencing GitHub connectivity issues
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| fi; \ | ||
| echo "[download] getting $(@)..."; \ | ||
| if [ "$(USE_PROXY)" = "true" ]; then \ | ||
| RELEASE_URL="$(GH_PROXY)$$RELEASE_URL"; \ |
There was a problem hiding this comment.
The URL concatenation logic assumes that GH_PROXY ends with a trailing slash. If a user overrides GH_PROXY without a trailing slash (e.g., GH_PROXY=https://my-proxy.com), the resulting URL will be malformed (e.g., https://my-proxy.comhttps://github.com/...).
Consider updating the logic to handle both cases by trimming any trailing slash from GH_PROXY and explicitly adding one during concatenation, or document that GH_PROXY must end with a trailing slash.
| RELEASE_URL="$(GH_PROXY)$$RELEASE_URL"; \ | |
| PROXY=$$(echo "$(GH_PROXY)" | sed 's:/*$$::'); \ | |
| RELEASE_URL="$$PROXY/$$RELEASE_URL"; \ |
Summary
This PR introduces an optional GitHub download proxy configuration to the Makefile to help users in regions with restricted or slow access to GitHub's asset servers. It uses
https://gh-proxy.org/by default.Key Changes
GH_PROXYvariable (default:https://gh-proxy.org/).USE_PROXYtoggle (default:false).USE_PROXYis enabled.How to use
To enable the proxy for downloading release assets, run:
Alternatively, you can modify the default value of
USE_PROXYtotruedirectly in the Makefile.