From cd3d5a65421780a22e0527b49a65a6bed8ed8049 Mon Sep 17 00:00:00 2001 From: qiffang Date: Sun, 27 Sep 2026 23:32:20 +0800 Subject: [PATCH] fix: download Drive9 companion from GitHub --- README.md | 2 +- docs/priciples.md | 2 +- e2e/installer_test.go | 4 ++-- internal/update/update.go | 2 +- scripts/install.ps1 | 5 +++-- scripts/install.sh | 4 ++-- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 662924c..037388f 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ ti --version The installer writes `ti` and `ti-drive9` to `~/.ti/bin` without sudo. Add the `export PATH=...` line to your shell profile to make it persistent. -The macOS/Linux installer downloads both binaries and their checksum files from CDN-fronted sources and verifies the checksums before installation. +The shell and PowerShell installers download `ti` from GitHub Releases and `ti-drive9` from the [`drive9-fe` GitHub repository](https://github.com/mem9-ai/drive9-fe/tree/main/site/releases). Both installers and `ti update` verify the companion against `checksums.txt` from the same GitHub directory before installation. Windows users: diff --git a/docs/priciples.md b/docs/priciples.md index 838d122..f6a441e 100644 --- a/docs/priciples.md +++ b/docs/priciples.md @@ -215,7 +215,7 @@ GitHub Releases and GoReleaser produce release archives and checksums. Supported - Installation and update do not require sudo. - Installers do not edit shell profiles automatically; they print the command that prepends `~/.ti/bin` to `PATH`. -- Installers support ti release version pinning and checksum verification. The shell installer downloads the companion and its checksums from Drive9's CloudFront-fronted release endpoint (`releases.drive9.ai/latest`); the PowerShell installer and updater use Drive9's origin release endpoint. These companion sources are unversioned; ti does not yet negotiate a companion version range. +- Installers support ti release version pinning and checksum verification. The shell installer, PowerShell installer, and updater download the companion and `checksums.txt` from `mem9-ai/drive9-fe` on GitHub (`main/site/releases`, served by `raw.githubusercontent.com`). This companion source is unversioned; ti does not yet negotiate a companion version range. - `ti update --check` checks explicitly; there is no background update. - `ti update` is itself explicit consent and does not require `--yes`. - The updater stages and verifies ti and its companion before replacement. diff --git a/e2e/installer_test.go b/e2e/installer_test.go index 6333f79..11d2f02 100644 --- a/e2e/installer_test.go +++ b/e2e/installer_test.go @@ -172,8 +172,8 @@ done case "$url" in */ti_checksums.txt) source=%q ;; */%s) source=%q ;; - https://releases.drive9.ai/latest/SHA256SUMS) source=%q ;; - https://releases.drive9.ai/latest/%s) source=%q ;; + https://raw.githubusercontent.com/mem9-ai/drive9-fe/main/site/releases/checksums.txt) source=%q ;; + https://raw.githubusercontent.com/mem9-ai/drive9-fe/main/site/releases/%s) source=%q ;; *) printf 'unexpected URL: %%s\n' "$url" >&2; exit 1 ;; esac if [ -n "$out" ]; then diff --git a/internal/update/update.go b/internal/update/update.go index 1e825e3..80d5b98 100644 --- a/internal/update/update.go +++ b/internal/update/update.go @@ -28,7 +28,7 @@ import ( const ( DefaultReleaseAPIBaseURL = "https://api.github.com/repos/tidbcloud/ti-cli" checksumAssetName = "ti_checksums.txt" - drive9ReleaseBaseURL = "https://drive9.ai/releases" + drive9ReleaseBaseURL = "https://raw.githubusercontent.com/mem9-ai/drive9-fe/main/site/releases" drive9ChecksumAssetName = "checksums.txt" ) diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 3374fef..979099d 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -184,8 +184,9 @@ $ArchiveUrl = "$ReleaseBase/$Artifact" $ChecksumsUrl = "$ReleaseBase/ti_checksums.txt" $Target = Join-Path $InstallDir "ti.exe" $CompanionArtifact = "drive9-windows-amd64.exe" -$CompanionUrl = "https://drive9.ai/releases/$CompanionArtifact" -$CompanionChecksumsUrl = "https://drive9.ai/releases/checksums.txt" +$CompanionBase = "https://raw.githubusercontent.com/mem9-ai/drive9-fe/main/site/releases" +$CompanionUrl = "$CompanionBase/$CompanionArtifact" +$CompanionChecksumsUrl = "$CompanionBase/checksums.txt" $CompanionTarget = Join-Path $InstallDir "ti-drive9.exe" if ($DryRun) { diff --git a/scripts/install.sh b/scripts/install.sh index 40d928b..241d8da 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -189,9 +189,9 @@ ARCHIVE_URL="${RELEASE_BASE}/${ARTIFACT}" CHECKSUMS_URL="${RELEASE_BASE}/ti_checksums.txt" TARGET="${INSTALL_DIR}/ti" COMPANION_ARTIFACT="drive9-${OS}-${ARCH}" -COMPANION_BASE="https://releases.drive9.ai/latest" +COMPANION_BASE="https://raw.githubusercontent.com/mem9-ai/drive9-fe/main/site/releases" COMPANION_URL="${COMPANION_BASE}/${COMPANION_ARTIFACT}" -COMPANION_CHECKSUMS_URL="${COMPANION_BASE}/SHA256SUMS" +COMPANION_CHECKSUMS_URL="${COMPANION_BASE}/checksums.txt" COMPANION_TARGET="${INSTALL_DIR}/ti-drive9" if [ "$DRY_RUN" -eq 1 ]; then