Skip to content

feat(installation): support asset download via GITHUB_MIRROR_DOMAIN - #893

Open
wu21-web wants to merge 13 commits into
alibaba:mainfrom
wu21-web:mirror
Open

feat(installation): support asset download via GITHUB_MIRROR_DOMAIN#893
wu21-web wants to merge 13 commits into
alibaba:mainfrom
wu21-web:mirror

Conversation

@wu21-web

@wu21-web wu21-web commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Description

Chinese users without proxies configured can't download assets fast because of network restriction. Adds a GITHUB_MIRROR_DOMAIN check and download assets from it when it is not empty or space.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring (no functional changes)
  • Documentation update
  • CI / Build / Tooling

How Has This Been Tested?

  • make test passes locally
  • Manual testing (describe below)
    Tested on aliyun cloud shell:
shell@Alicloud:~$ wget "https://gh-proxy.com/raw.githubusercontent.com/wu21-web/open-code-review/refs/heads/mirror/install.sh" -O install.sh
--2026-08-13 14:18:00--  https://gh-proxy.com/raw.githubusercontent.com/wu21-web/open-code-review/refs/heads/mirror/install.sh
Resolving gh-proxy.com (gh-proxy.com)... 104.18.42.163, 172.64.147.104, 104.18.42.54, ...
Connecting to gh-proxy.com (gh-proxy.com)|104.18.42.163|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: ‘install.sh’

install.sh                                               [ <=>                                                                                                                 ]   4.03K  --.-KB/s    in 0s      

2026-08-13 14:18:02 (28.3 MB/s) - ‘install.sh’ saved [4122]

shell@Alicloud:~$ openssl dgst -sha256 install.sh 
SHA256(install.sh)= c1309cbfe422b47245bda5e963206a6bffc36d97935c5bf81d5b5a625a863dd9
shell@Alicloud:~$ export GITHUB_MIRROR_DOMAIN='github.dpik.top'
shell@Alicloud:~$ time sh install.sh 
WARNING: Using an unofficial mirror domain, which may lead to SHA256 checksum mismatches and security risks.
downloading ocr v1.9.2 (linux/amd64)...
installed ocr v1.9.2 -> /usr/local/bin/ocr

real    1m16.726s
user    0m0.493s
sys     0m0.219s
shell@Alicloud:~$ echo 'In constrast: '
In constrast: 
shell@Alicloud:~$ time curl -fsSL https://raw.githubusercontent.com/alibaba/open-code-review/main/install.sh | sh
downloading ocr v1.9.2 (linux/amd64)...
curl: (56) Unexpected EOF
error: download failed: https://github.com/alibaba/open-code-review/releases/download/v1.9.2/opencodereview-linux-amd64

real    1m33.425s
user    0m0.074s
sys     0m0.028s

Checklist

  • My code follows the project's coding style (go fmt, go vet)
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly (if applicable)
  • I have signed the CLA

Related Issues

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🔍 OpenCodeReview found 2 issue(s) in this PR.

  • ✅ Successfully posted inline: 2 comment(s)

Comment thread install.ps1 Outdated
Comment thread install.sh Outdated
@wu21-web
wu21-web marked this pull request as draft August 13, 2026 14:16
@wu21-web wu21-web changed the title feat(installation): support asset download via GITHUB_MIRROR_DOMAIN_PREFIX feat(installation): support asset download via GITHUB_MIRROR_DOMAIN Aug 13, 2026
fix naming
@wu21-web
wu21-web marked this pull request as ready for review August 13, 2026 14:27
@wu21-web

Copy link
Copy Markdown
Contributor Author

May I request a review from @stay-foolish-forever ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant