Skip to content

Updating & patching CodeNavi

How CodeNavi installs receive fixes and features, what ships, how big it is, how it is verified, and how to roll back. (Vendor release-side mechanics live in release-cut-runbook.md, internal.)

Connected update (the one-command path)

If the install host can reach the update channel, the bundled updater runs the whole delta flow, check, download only the changed layers, verify, apply, in one command. Nothing changes until you confirm, and your data/ (license, settings), your index, and your .env are never touched.

# Linux (x86-64) — from your install directory
./update.sh --check      # report what's new, apply nothing
./update.sh              # download the changed layers, then confirm before applying
./update.sh --yes        # ...or skip the confirm prompt
# Windows (Docker Desktop) — from your install folder (default %USERPROFILE%\codenavi)
.\update.ps1 -Check      # report what's new, apply nothing
.\update.ps1             # download + confirm before applying
.\update.ps1 -Yes        # ...or skip the confirm prompt

An older release is refused. The updater compares the signed version of what the channel offers with the version you run, and will not install an older one, a valid signature on an old release is what a replayed or stale answer looks like. A rollback your CodeNavi contact asks for is the one exception: ./update.sh --allow-downgrade (Windows: .\update.ps1 -AllowDowngrade). To go back on your own, use the rollback tag instead (Rolling back).

running scripts is disabled on this system (Windows): that is the built-in Windows PowerShell 5.1, whose default policy runs no scripts at all. Either run it the way the installer does, powershell -ExecutionPolicy Bypass -File .\update.ps1 -Yes (affects that one process only), or use PowerShell 7 (pwsh), which allows local scripts by default.

Under the hood this is the same signed, layer-verified delta described below; update.sh / update.ps1 just fetch the right package for your version from the channel first. Only the layers that changed are loaded into Docker or Podman: the layers your current image already holds are neither read again nor reloaded, so a code-only update stays small on disk and in time, Docker Desktop on Windows included. An engine that will not take such a partial load gets the full image instead, automatically. Air-gapped hosts (no outbound network) skip this and apply packages by hand, below.

Licence renewal

A renewed licence travels the same channel. From 1.3.52 the server itself checks, once a day, whether the vendor holds a key that runs later than the one in data/license.key; if so it downloads that key, verifies the signature, the customer and the later date, keeps the old key as license.key.bak and switches over, no restart, nothing to do. ./update.sh (Windows .\update.ps1) does the same check at once, and --check reports a waiting renewal. Anything that does not verify leaves the running key alone. A key that changes your plan (a trial becoming Personal or Professional, or a move between plans) is installed the same way, then the server restarts once so the new plan's codebase and connection limits apply; it is back in a minute or two, with the index untouched. A moved or copied install gets its own token with ./update.sh --rebind (Windows .\update.ps1 -Rebind): it asks for the token, never takes it from the command line. Mac installs get the new key by email (On a Mac). Air-gapped installs replace data/license.key by hand and restart (air-gapped).

Turning the daily check off

On a connected install the server asks once a day whether a newer build exists. To stop that and the licence download, set CODENAVI_UPDATE_CHECK=off in .env and run docker compose up -d --force-recreate (podman compose on podman). Deleting .update.conf only disables update.sh / update.ps1. What is sent: What CodeNavi sends.

The updater refreshes itself

From 1.3.53 the image carries the updater scripts (update.sh, fetch-blobs.sh, apply-update.sh, update.ps1) at /app/host-kit/. Once an update has restarted the server and /health says ok, the updater replaces the copies in your install directory with the ones from the image it just verified, only files your install already has, each one syntax-checked first, the previous copy kept as .bak. The summary line Updater says what happened. cosign.pub (the signing key the updater trusts) and bin/cosign are never replaced. After --no-restart, or at any time, do it by hand:

./update.sh --refresh-kit            # Linux
.\update.ps1 -RefreshKit             # Windows

An install made before 1.3.53 has an updater without that option. Once it has updated the image to 1.3.53 or later, copy the new updater out of the image once, then it keeps itself current:

# Linux — from your install directory
docker run --rm --entrypoint cat codenavi:secure /app/host-kit/update.sh > update.sh.new \
  && bash -n update.sh.new && chmod +x update.sh.new && mv update.sh.new update.sh \
  && ./update.sh --refresh-kit
# Windows — from your install folder (default %USERPROFILE%\codenavi)
docker run --rm --entrypoint base64 codenavi:secure -w0 /app/host-kit/update.ps1 | Set-Content -Encoding ASCII update.ps1.b64
[IO.File]::WriteAllBytes("$PWD\update.ps1", [Convert]::FromBase64String((Get-Content -Raw update.ps1.b64).Trim())); Remove-Item update.ps1.b64

The updater runs on the install host itself: Linux x86-64, an Apple Silicon Mac, or Windows with update.ps1. setup.sh refuses other architectures up front instead of failing later as a health-check timeout. On a Mac it needs python3: see On a Mac.

On a Mac (Apple Silicon)

A Mac installed with the install command updates like Linux: run ./update.sh in ~/codenavi. When the new image carries a new embedding model, it loads that model into Ollama before it restarts the server. It needs python3, which comes with the Xcode Command Line Tools (xcode-select --install).

A Mac set up by hand on 1.3.78 has no update channel: run the install command from your trial email once, in your home folder. It keeps your index and settings, and ./update.sh works from then on.

If an update is interrupted

An update is two steps: load the new image, then restart the container onto it. If the process dies in between (Ctrl-C, power cut, a failed docker compose up), the image on disk is new while the container still serves the old one.

Just re-run ./update.sh. It compares the running container's image against the one on disk, notices the half-applied update, and finishes it by restarting the container:

The codenavi:secure image on disk is NEWER than the running container.
A previous update loaded the image but never restarted. Finishing it now.

Nothing is re-downloaded, and your data is untouched. (Older updaters1 compared the tag instead of the running container, so this state reported "You're on the latest build. Nothing to update." while the old container kept serving, a security update could look applied when it wasn't. If you are on an older updater, force it with docker compose up -d --force-recreate.)

The three update sizes

CodeNavi is delivered as a signed Docker image plus install assets. Updates come in three shapes, chosen by what actually changed. None of them touch your data/ (license, settings, aliases), your index, or your .env.

Package Typical size Contains When
Assets refresh (…-assets.tar.gz) ~60 KB compose files, setup.sh, docs, plugin installer/compose/doc fixes, no server change
Offline update (codenavi-<version>-offline-update.tar.gz) ~50 MB the release's signed manifest + the image layers your install image lacks air-gapped installs, published with every release (connected installs get the same layers from ./update.sh)
Full package (….tar.gz) ~10 GB everything: image, models, license, assets first install, or an install older than the current install image

The economics: the image is ~14 GB uncompressed, but ~99.98 % of it (the embedding model, the ML runtime) almost never changes. The Docker image is built so all of that sits in stable layers and the application code is the last, ~3 MB layer, a code release only has to ship that.

Fresh installs work the same way. The image inside an install package is a base that changes only when the model or the ML runtime does. A connected install loads it, caches its layers, and then applies the current release as a small delta before starting the server, so a package downloaded today gives you today's build even if the base was built months ago. An air-gapped install has no update token, so it runs the base build until you apply the release's offline update (below). Set CODENAVI_NO_INSTALL_UPDATE=1 to skip that final step and stay on the base build.

Applying an assets refresh

tar xzf codenavi-<version>-assets.tar.gz -C <parent dir of your install>
cd <install dir> && docker compose up -d --force-recreate

Applying an offline update

Every release publishes an offline update next to the install package, on the same download page.3 Download it on any connected machine, carry it across, then:

tar xzf codenavi-<version>-offline-update.tar.gz      # anywhere on the machine
# then, from your INSTALL directory:
./bin/fetch-blobs.sh --store <path>/codenavi-<version>-offline-update
docker compose up -d --force-recreate
curl -s http://localhost:8765/health
# Windows (Docker Desktop) — from your install folder (default %USERPROFILE%\codenavi)
tar -xzf codenavi-<version>-offline-update.tar.gz    # anywhere on the machine
.\update.ps1 -Store C:\path\codenavi-<version>-offline-update   # -Check first to see what it would do

AMD installs take the …-rocm-offline-update… file. What fetch-blobs.sh (and update.ps1 -Store) does:

  1. Refuses unless the signed manifest verifies against the cosign.pub your install already holds. A file carried on a drive is the less trusted path, so there is no unsigned fallback.
  2. Takes the layers you already have from .layer-cache/ (the installer filled it from the install image) and the rest from the offline update, re-hashing every one.
  3. Keeps a rollback tag (codenavi:rollback-<id>), loads the new image, and checks the loaded layer chain against the signed manifest before declaring success.

It works from any earlier version, so skipped releases are fine: the update carries every layer that changed since the install image. If it reports a layer it cannot find, fill the cache once with ./bin/apply-update.sh --prime-cache (Windows: re-run setup.ps1, a safe re-run) and retry. Still missing after that? Your install predates the current install image (it changes only with the model or the ML runtime): apply the full package instead.

Applying a delta package (on request)

Delta packages are built per customer on request, for an install that cannot take the offline update or the full package. Each one is built against one exact version.

mkdir cn-update && tar xzf codenavi-<version>-update-<id>.tar.gz --strip-components=1 -C cn-update
cd cn-update
sha256sum -c SHA256SUMS
./apply-update.sh
# then, from your INSTALL directory:
docker compose up -d --force-recreate
curl -s http://localhost:8765/health

What apply-update.sh does, step by step:

  1. Verifies the signed update manifest (packages since 2026-07-29 bundle bin/cosign, so this verification always runs, no system install needed; on older packages without it, the SHA256SUMS you just checked covers integrity). The manifest pins the image's layer chain, so everything later is checked against a signed expectation.
  2. Confirms your current image is the one this delta was built against, by comparing layer chains, not tags. If you're on a different version it refuses and tells you to ask for a matching delta or a full package.
  3. Reassembles the full image: unchanged layers are exported from the image already in your Docker daemon; changed layers come from the package. If the old image is gone from the daemon, point it at your kept original tarball: ./apply-update.sh --from-tarball <…-image.tar.gz>.
  4. Re-hashes every layer (they are content-addressed, the file name is the checksum) and cross-checks the image manifest against the signed manifest, so a corrupt or tampered package cannot assemble into a loadable image.
  5. Keeps a rollback tag (codenavi:rollback-<id>) pointing at your previous image, loads the new one, and verifies the loaded layer chain matches the signed manifest before declaring success.

Disk note: reassembly needs roughly 2× the uncompressed image size of scratch space. It defaults to a workdir next to the package (never /tmp, which is often RAM-backed); use --workdir /big/disk if needed.

Layer cache.2 Step 3, the multi-minute docker save export, only happens on your first update. A successful apply leaves a content-addressed layer cache (default ./.layer-cache, ~1× image size on disk; --layer-cache DIR to relocate, --no-layer-cache to disable), and later updates serve the unchanged layers from it instead of round-tripping the image through the daemon. This is a speed cache, not a trust anchor: every entry is re-hashed against its digest before use (a corrupt or stale entry is just a cache miss that falls back to the export), and the assembled image is still verified blob-by-blob and chain-checked against the signed manifest exactly as before. The cache is pruned to the just-applied image after every successful update. Safe to delete at any time.

To get the speedup on your very next update (instead of the one after), prime the cache from your current image once: ./bin/apply-update.sh --prime-cache (pre-1.3.4 installs: ./apply-update.sh at the package root), one docker-save export, no update applied, no package manifest needed. Measured on the r312→r317 delta: cold apply 1m45s, primed/warm apply ~35s.

Rolling back

docker tag codenavi:rollback-<id> codenavi:secure
docker compose up -d --force-recreate

Your data and index were never touched, so rollback is just the image swap above.

Applying a full package

Same flow as a first install: unpack and ./setup.sh --airgap (Windows: powershell -ExecutionPolicy Bypass -File .\setup.ps1). An existing install's .env and data/ are preserved (setup never overwrites them).

Practical rules

  • Keep your original package tarball. It is the rollback artifact and the fallback layer source for deltas (--from-tarball).
  • Updates are cumulative only in the sense that each delta targets one specific previous version. If you skip several releases, ask for a delta against your version or take a full package.
  • After any update finishing in --force-recreate, give the server ~1–2 minutes to reload the embedding model before heavy use (on ≤12 GB GPUs, don't trigger a reindex during startup).
  • Works on both Docker storage backends (classic graphdriver and the containerd image store), the delta format deliberately uses only backend-invariant pieces.

  1. Vendor change reference CN-355. ↩

  2. Vendor change reference CN-196. ↩

  3. Vendor change reference CN-929. ↩