Skip to content

fix: codedb update downloads directly from GitHub releases#176

Merged
justrach merged 1 commit intomainfrom
fix/update-command
Apr 6, 2026
Merged

fix: codedb update downloads directly from GitHub releases#176
justrach merged 1 commit intomainfrom
fix/update-command

Conversation

@justrach
Copy link
Copy Markdown
Owner

@justrach justrach commented Apr 6, 2026

Problem

codedb update silently fails on macOS. The CDN install script's set -euo pipefail causes early exit when xattr -c returns non-zero on a file with no quarantine attributes.

Fix

Bypass the CDN install script entirely. The update command now:

  1. Detects platform (darwin-arm64, linux-x86_64, etc.)
  2. Fetches latest version from codedb.codegraff.com/latest.json
  3. Downloads binary directly from GitHub releases
  4. mv -f in-place

Tested: 0.2.53 → 0.2.54 update confirmed working on macOS ARM64.

The CDN install script fails silently on macOS due to set -euo pipefail
interacting with xattr -c returning non-zero. Bypass the install script
entirely — detect platform, fetch latest version from CDN, download
binary directly from GitHub releases, and mv in-place.

Generated with AI

Co-Authored-By: AI <ai@example.com>
@justrach justrach merged commit e80dfa1 into main Apr 6, 2026
1 check passed
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Benchmark Regression Report

Threshold: 10.00%

Tool Base (ns) Head (ns) Delta Status
codedb_bundle 639916 649858 +1.55% OK
codedb_changes 112245 111547 -0.62% OK
codedb_deps 31253 30294 -3.07% OK
codedb_edit 18633 18155 -2.57% OK
codedb_find 138180 140385 +1.60% OK
codedb_hot 165615 162962 -1.60% OK
codedb_outline 415084 435186 +4.84% OK
codedb_read 178115 171829 -3.53% OK
codedb_search 267513 260151 -2.75% OK
codedb_snapshot 3690725 3684921 -0.16% OK
codedb_status 28222 29530 +4.63% OK
codedb_symbol 63062 62533 -0.84% OK
codedb_tree 94951 100886 +6.25% OK
codedb_word 92436 92006 -0.47% OK

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4f0a97961f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

\\VERSION=$(curl -fsSL https://codedb.codegraff.com/latest.json | grep -oE '"version"\s*:\s*"[^"]*"' | cut -d'"' -f4)
\\echo " latest: v${VERSION}"
\\TMP=$(mktemp)
\\curl -fsSL "https://github.com/justrach/codedb/releases/download/v${VERSION}/${BIN}" -o "$TMP"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Verify update binary checksum before replacing executable

This update path now installs whatever curl returns from GitHub directly into the live codedb executable without any integrity check, which is a security regression from the installer flow (install/install.sh) that validates SHA-256 before mv. If the download is corrupted or tampered in transit/upstream, codedb update will replace the trusted binary with an unverified one.

Useful? React with 👍 / 👎.

\\ darwin-arm64) BIN="codedb-darwin-arm64" ;;
\\ darwin-x86_64) BIN="codedb-darwin-x86_64" ;;
\\ linux-x86_64) BIN="codedb-linux-x86_64" ;;
\\ linux-aarch64) BIN="codedb-linux-aarch64" ;;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Map Linux ARM64 to the correct release asset name

On Linux ARM64, this mapping chooses codedb-linux-aarch64, but the repo’s documented/referenced asset naming uses codedb-linux-arm64 (see README and installer/worker logic). Because codedb update now bypasses the worker’s name normalization and hits GitHub release URLs directly, ARM64 users will request a non-existent asset and updates will fail.

Useful? React with 👍 / 👎.

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