feat(installation): support asset download via OCR_GITHUB_MIRROR - #893
feat(installation): support asset download via OCR_GITHUB_MIRROR#893wu21-web wants to merge 19 commits into
OCR_GITHUB_MIRROR#893Conversation
|
🔍 OpenCodeReview found 2 issue(s) in this PR.
|
GITHUB_MIRROR_DOMAIN_PREFIXGITHUB_MIRROR_DOMAIN
fix naming
|
Nice, this is a real pain point and the change is refreshingly small. A few things I'd want sorted before this lands, roughly in order of how much they matter: The mirror doesn't cover version resolution. When Please prefix the variable. Everything else here is Consider fetching Smaller stuff:
Docs across all four locales is appreciated, and the security note is honest rather than hand-wavy — thanks for that. One last thing: |
|
@lizhengfeng101 Here are the answers to your questions:
|
|
@lizhengfeng101 Most of time there is no problem with api.github.com access in China.
|
|
I pulled No change for existing users. With The checksum fetch can hang for 75s before falling back. This is the one I'd sort before merging. I simulated the case the mirror exists for — mirror reachable, direct GitHub not — by pointing None of the With a timeout on that one call: 89.7s → 20.0s, one line: curl -fsSL --connect-timeout 5 --max-time 15 -o "$tmp/sha256sum.txt" "$checksum_url"Edge inputs behave as predicted upthread:
The whitespace difference also cuts both ways: So: the sh + PS timeouts, the PS stderr consistency, and one real run of |
GITHUB_MIRROR_DOMAINOCR_GITHUB_MIRROR
|
Here are the updates:
|

Description
Chinese users without proxies configured can't download assets fast because of network restriction. Adds a OCR_GITHUB_MIRROR check and download assets from it when it is not empty or space.
Type of Change
How Has This Been Tested?
make testpasses locallyTested on aliyun cloud shell:
Checklist
go fmt,go vet)Related Issues
n/a