Agent Self-Update¶
The Nexplane Agent checks for updates on every startup and replaces itself automatically when a newer version is available.
How It Works¶
-
Fetch version — agent downloads the
The file contains the current version string (e.g.,versionfile from S3:0.1.0). -
Compare — if the S3 version is newer than the running binary's compiled-in version, the agent proceeds with the update.
-
Download — the agent downloads the platform-appropriate binary:
-
Verify — the agent downloads the
.sha256sidecar and verifies the SHA256 checksum of the downloaded binary. If verification fails, the download is discarded and the agent continues running the current version. -
Atomic replace (Linux) — the verified binary is written to a temp file and atomically renamed over the current binary with
os.Rename. The agent then re-executes itself withsyscall.Exec, replacing the current process with the new binary with no downtime. -
Windows — atomic re-exec is not supported on Windows. The agent logs that a new version is available and requires a manual restart or Windows Service Manager restart to apply the update.
S3 Cache Headers¶
| Object | Cache-Control |
|---|---|
version file |
max-age=60 (re-fetched frequently) |
| Binary files | immutable, max-age=31536000 (binaries never change for a given version) |
Self-Hosted Distribution¶
Set NEXPLANE_AGENT_DOWNLOAD_URL in the backend environment to point to your own distribution server. The agent uses this URL (injected at registration time) for version checks and downloads. Your server must serve:
version— plain text version stringnexplane-agent-{os}-{arch}-{version}[.exe]— binarynexplane-agent-{os}-{arch}-{version}[.exe].sha256— SHA256 checksum