Files
hold-baby b0f5dae7de Switch terminal install scripts to assets.lbkrs.com CDN (#1101)
## Merge Verdict
**[APPROVE]** — Mechanical URL swap from `open.longbridge.com` to
`assets.lbkrs.com` for terminal release lookup + download.
> 2 files · +4 / -4 · `docs/public/longbridge-terminal/`

---
## Summary
- `install` (POSIX) and `install.ps1` (PowerShell) both switched from
`https://open.longbridge.com/...` to
`https://assets.lbkrs.com/github/release/longbridge-terminal/...` for
the latest-version probe and the binary tarball/zip download.
- Path layout also realigned: previously `/{repo}/releases/latest` with
`repo=longbridge/longbridge-terminal`; now
`/github/release/longbridge-terminal/latest` — a fixed path no longer
parameterized by `$repo`.
- `$repo` variable is still declared in `install` but no longer used for
URL construction (only referenced in code comments / future use); kept
to minimize diff.

---
## Risk Analysis
| Risk | Level | Mitigation |
|------|-------|-----------|
| `assets.lbkrs.com/github/release/longbridge-terminal/latest` endpoint
not yet live | 🟡 | Reviewer to confirm the new CDN endpoint is published
before merging — script will fail at `get_latest_release` if the URL
404s |
| Existing users who already ran the old script |  | They have
`longbridge` on PATH; this PR only affects new installs / reinstalls |
| Region build interaction |  | The CN region rewrite plugin (added in
#1100) only rewrites `open.longbridge.com` / `openapi.longbridge.com`;
`assets.lbkrs.com` is intentionally untouched and CN builds will keep
the same CDN URL |
| `$repo` variable now unused | 🟢 | Cosmetic only — script still runs;
removing it is a follow-up cleanup if desired |

---
## Design Decisions
- **Use a fixed path instead of `$repo`-templated**: The new endpoint is
a dedicated CDN slot (`/github/release/longbridge-terminal/`) rather
than a GitHub-mirror-style route, so the `$repo` indirection is no
longer meaningful. Switching to a flat path matches the actual CDN
layout.
- **Source file stays `assets.lbkrs.com` for all regions**: Unlike
`open.longbridge.com`, the assets CDN is not region-split, so no region
rewrite is needed; the file is identical for global and CN builds.

---
## Code Notes
1. **[Needs review]** Endpoint readiness on
`assets.lbkrs.com/github/release/longbridge-terminal/latest`
Reviewer should verify the CDN endpoint serves the latest version tag
(and the per-version tarballs/zips) before merging; otherwise new
installations will fail at the first `curl --silent` call.
2. **[Info]** `$repo='longbridge/longbridge-terminal'` left declared but
unused in `install` (line 5)
Not a bug — script still runs cleanly. Can be removed in a follow-up if
the team prefers a tighter diff for future edits.
— Author note: intentionally kept for now; will clean up in a follow-up.

---
## Verification
-  Both files contain only the URL constants — no logic changes, no
shell-substitution edge cases introduced.
- 📋 Manual check after merge: `curl -sSL
https://assets.lbkrs.com/github/release/longbridge-terminal/install |
sh` on Linux/macOS, and `iwr
https://assets.lbkrs.com/longbridge/longbridge-terminal/install.ps1 |
iex` on Windows.
- 📋 Confirm the CDN endpoint
`assets.lbkrs.com/github/release/longbridge-terminal/latest` returns a
version string with deploy ops.

Co-authored-by: 袁昌瑞 <changrui.yuan@longbridge-inc.com>
2026-06-18 12:38:32 +08:00
..
2026-03-18 15:00:54 +08:00