Expand description
Self-update from GitHub Releases.
winx-code-agent update fetches the release metadata, downloads the bundle
for this platform together with the published SHA256SUMS, verifies the
digest, extracts the three sibling binaries, and swaps them in next to the
running executable. Downloads go through the system curl and extraction
through the system tar (bsdtar on Windows also reads zip archives), so the
server binary carries no TLS stack of its own and inherits the user’s proxy
configuration. Running daemons keep the old executables alive until they
exit; restart-daemon picks up the new winxd, and guardians are replaced
as their sessions end.
Structs§
- Release
- A published release and its downloadable assets.
- Release
Asset - Update
Options - Options for
run. - Update
Report - What
updatedecided and did.
Enums§
Constants§
- BINARIES
- Sibling binaries every bundle must contain.
- CHECKSUM_
ASSET - Checksum manifest published with every release.
- REPOSITORY
- GitHub repository that publishes the release bundles.
Functions§
- commit_
binary - Move a staged file over
destination. On Windows a running executable cannot be overwritten but can be renamed, so the old one moves aside first. - default_
install_ dir - Directory that holds the running executable, with symlinks resolved so the swap happens where the files really live.
- fetch_
release - Fetch release metadata for
tag, or the latest release whenNone. - locate_
binaries - Find the three sibling binaries under an extracted bundle.
- parse_
checksums - Parse a
sha256sum-style manifest intofile name -> lowercase hex digest. - parse_
release - Parse the GitHub release API response.
- platform_
asset_ name - Release asset built for this operating system and architecture.
- replace_
binary - Swap
sourceintodestinationwithout ever leaving a half-written executable in place:stage_binarythencommit_binary. - run
- Resolve, verify, and install a release according to
options. - stage_
binary - Copy
sourceto a private<destination>.new-<pid>-<random>(same directory, so the later rename is atomic) and mark it executable. Nothing in place changes yet, and no other process can hand us its file. - verify_
checksum - Compare the digest of
pathagainst the manifest entry forasset_name. - version_
is_ newer truewhencandidateis a strictly newerMAJOR.MINOR.PATCHthancurrent. Unparseable versions never count as newer.