Skip to content

feat(pages): serve install scripts from the custom domain (open-codereview.ai/install.sh) #411

Description

@lizhengfeng101

Description

Now that the project has its own domain (https://open-codereview.ai/), we can serve the install scripts directly from it and shorten the install commands.

Today every install command points at the long raw GitHub URL:

# current
curl -fsSL https://raw.githubusercontent.com/alibaba/open-code-review/main/install.sh | sh
irm https://raw.githubusercontent.com/alibaba/open-code-review/main/install.ps1 | iex

With the scripts hosted on the domain, this becomes short and memorable (matching the industry convention of get.docker.com, sh.rustup.rs, etc.):

# desired
curl -fsSL https://open-codereview.ai/install.sh | sh
irm https://open-codereview.ai/install.ps1 | iex

The landing site is a static site deployed to GitHub Pages (.github/workflows/deploy-pages.yml), with the domain configured via pages/public/CNAME (open-codereview.ai). So any file that ends up in the built artifact root is reachable at https://open-codereview.ai/<file>.

Note: the install scripts do not hard-depend on the raw URL for their actual work — downloads go through the GitHub API + releases (install.sh main()); the raw.githubusercontent.com string only appears in the header comments. So hosting them under the domain is purely additive and safe.

Scope

  • Hosting mechanism (pick one, single source of truth preferred):
    • Recommended: in .github/workflows/deploy-pages.yml, extend the Prepare deployment artifact step to also copy install.sh and install.ps1 into _site/ (it already does this for logo.svg). Keeps the scripts at repo root as the single source.
    • Alternative: copy the scripts into pages/public/ (webpack's CopyPlugin copies pages/public/* into dist, see pages/webpack.config.js), at the cost of maintaining duplicate files.
  • Update install commands to the short domain URL:
  • Optionally update the header comments inside install.sh / install.ps1 to reference the short URL too.

Acceptance Criteria

  • install.sh and install.ps1 are included in the deployed Pages artifact and reachable at https://open-codereview.ai/install.sh and https://open-codereview.ai/install.ps1
  • curl -fsSL https://open-codereview.ai/install.sh | sh installs the CLI successfully
  • irm https://open-codereview.ai/install.ps1 | iex installs the CLI successfully on Windows
  • All install commands in README (all 5 locales) and docs (en/zh/ja) use the short domain URL
  • Code check passes (make check)

Context

Discovered while reviewing #408, which redesigns the Hero section and introduces three install channels still using the long raw URLs. Ideally the URL swap lands together with, or right after, that PR so the new install channels ship with the short domain.

The GitHub Pages 404.html SPA fallback (pages/webpack.config.js) should not interfere, since real files take precedence over the fallback — worth a quick verification that the raw .sh/.ps1 content is served as-is (not the HTML shell) when fetched via curl.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions