mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 06:23:17 -10:00
main
18
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
bc185ec80e |
fix(release): every file release.sh writes is 0755 or 0644, whatever the umask
minisign writes its signatures with the process umask, so on a host whose umask is 0002, as Ubuntu's is, dist/SHA256SUMS.minisig came out 0664, and --ci-sign's SHA256SUMS.ci.minisig, --sign-legacy's signature, --formula-from's formulas and --ci's folder for the co-signer were group-writable too. release.sh now sets umask 022 once at its top, for the host and the container alike, in place of the two copies in build and modules. release_head.txtar's modes check builds under umask 0002, checks the signature is 0644, and labels the catch-all lines so a stray mode can't pass as an expected one; release_ci.txtar's --ci-sign runs under umask 0002 and checks its signature is 0644. Both failed before the fix. Co-Authored-By: Claude Opus 5.5 <[email protected]> |
||
|
|
19ae9a7071 |
feat(release): the switch: the maintainer signs and pushes the tag, and CI and the co-signer do the rest
scripts/publish.sh's default is now the maintainer's whole part of a release that CI builds and the co-signer publishes: the tag's checks, then main and the tag pushed to origin, which starts the Release workflow, and what comes next. It needs git alone. It refuses a tag whose commit has no release keys, which CI's workflow would refuse, and a version with no changelog entry, which the co-signer takes the notes from. - scripts/publish.sh --sign-legacy, the one command for the bridge: VERSION's draft release, which the co-signer made, has SHA256SUMS, SHA256SUMS.ci.minisig and SHA256SUMS.cosign.minisig downloaded, and scripts/release.sh --sign-legacy checks both signatures with this checkout's packaging/keys and devvm-release <version>, then signs SHA256SUMS with the old key, devvm <version>, and checks that with packaging/minisign.pub; after asking once, SHA256SUMS.minisig goes on the draft, which the co-signer waits for, then publishes. A draft that has it already, or a published release, or a draft without the co-signer's signature yet, is said so, and nothing is uploaded. A checkout without the release keys is refused before anything is signed, pointing at github-setup.md's step 1, as is the default mode's tag without them. - scripts/publish.sh --local, the old path, as it was: built, signed with the old key alone and published from this machine. It stays until the GitHub setup for CI and the co-signer is done, and goes when the bridge ends, as a release that only the old key signed is then one no devvm accepts. A flag, not the default, because the default is what's documented and what's safe to run at any time: it publishes nothing itself, so run before the setup it only pushes a tag whose workflow run fails; and a --local release after the co-signer starts is one it alerts on, as it didn't publish it. - scripts/release.sh --check-tag: --check's tag and keys checks alone, with no container runtime or signing key, which the default mode runs. - The shared parts are one function each: check_tag (the tag, main and origin), notes (the changelog entry), ask (the question), needs_gh. - release.sh's closing line names publish.sh --local, and --tag's build, CI's and the co-signer's, has none. Tests: testdata/script/publish_tag.txtar (the modes in --help, two modes refused, no tag, another signer, a dirty tree, no release keys, no changelog entry, a tag off main's HEAD, --dry-run, n, y and the pushes in order, again with nothing to push, origin's other tag; --sign-legacy: gh logged out, no draft, no co-signer signature yet, a co-signer signature by another key, CI's for another version, --dry-run, y and the upload, which verifies as devvm 1.2.3, again with nothing to do, a published release, a checkout without the release keys), failing before the code; publish.txtar runs the old path as --local, in a repo without release keys, as devvm is until they're made: SHA256SUMS signed with the old key alone, no role signatures, install.sh's key lines empty. Co-Authored-By: Claude Opus 5.5 <[email protected]> |
||
|
|
5b2786c758 |
ci(release): CI's release workflow, which builds, signs and hands each tag over
.github/workflows/release.yml, CI's half of each release, for a pushed v* tag, in the release environment, which waits for the maintainer's approval and holds what the workflow trusts: RELEASE_TAG_SIGNERS, the SSH keys that sign release tags, and RELEASE_CI_KEY, CI's release key. The job's token has contents: read, and id-token and attestations write for the attestation alone, so it can't make or publish a release; the co-signer does. - scripts/release.sh --ci TAG DIR: the tag checked against DEVVM_RELEASE_SIGNERS, an allowed signers file, never the tagged commit's packaging/release-signer, as CI runs the tag's workflow and release.sh: annotated, a release's version, its tag object naming itself, signed by one of those keys, its commit on main (DEVVM_RELEASE_MAIN, refs/remotes/origin/main by default) and holding the three release keys. Then --tag's build, with the same signers as git's, and DIR with SHA256SUMS and exactly the files it lists, each checked against its SHA-256, and not the formulas, which the co-signer renders. - scripts/release.sh --ci-sign TAG DIR: SHA256SUMS signed with CI's key, read on standard input into the script's memory and handed to minisign through a pipe, never a file or an argument, with the trusted comment devvm-release <version>, checked with the tag's packaging/keys/release-ci.pub, which can't be marked PLACEHOLDER: a key on standard input that isn't CI's is refused, and its signature removed. The placeholders' check is placeholder(), one owner for --tag's check and this one. --ci and --ci-sign refuse a tag without the release keys, pointing at github-setup.md's step 1. - The workflow: a first step that stops a tag without the release keys before anything is installed, with the same pointer, then the tag fetched as GitHub has it, minisign alone through mise with no cache, the build under the runner's podman, the signature, an artifact attestation of every file SHA256SUMS lists (subject-checksums), and the artifact release, kept 90 days. Every action pinned by its commit; actionlint and zizmor (and zizmor's auditor persona) find nothing. - The base's workflow, base.yml, comes with the published base; the workflow's header says where it goes. - maintaining.md: CI's release workflow, its steps and its trust. Tests: testdata/script/release_ci.txtar (signers only from DEVVM_RELEASE_SIGNERS, an empty one, a tag signed by a key git trusts but the list doesn't hold, not a release's tag, a lightweight tag, a tag object of another tag, a commit off main, a folder that's there or relative, the folder's exact files and their checksums, no key on stdin, another role's key, the right key's signature and its trusted comment, a second signature, a release-ci.pub marked PLACEHOLDER, a commit with no release keys for --ci and --ci-sign), failing before the code. Co-Authored-By: Claude Opus 5.5 <[email protected]> |
||
|
|
f3052e5a8e |
feat(upgrade): releases checked by two of three release keys, bridged from the old key
devvm upgrade and install.sh accept a release's SHA256SUMS when any two
of three release keys signed it (CI's, the co-signer's and an offline
recovery key's), each in SHA256SUMS.<role>.minisig, checked only against
its own role's key, with the trusted comment devvm-release <version>
compared exactly; one signer counts once. While releases bridge from it,
the old release key's single SHA256SUMS.minisig (devvm <version>) still
passes alone, so 0.1 and 0.2 keep upgrading and --to/--version can
install them; install.sh now checks that key's trusted comment too.
The keys themselves aren't made yet, so packaging/keys holds none and
install.sh's three key lines are empty: a devvm built so checks each
release with the old release key alone, and a release that only the
release keys signed is refused. Releases go out as before, signed with
the old key, until the keys are made and added, all three at once.
- internal/minisign: the one owner of signature checks (moved from
internal/upgrade): ParsePublicKey, PublicKey.Check (comment always
compared), Role (CI, Cosign, Recovery), Kind (Release, Base),
Kind.Comment, SigName, KeyFile, Keys/NewKeys/Keys.Check (two of three,
distinct keys and key IDs). minisigntest/ signs for tests. Stdlib and
blake2b only (depguard), a leaf; FuzzCheck, FuzzKeysCheck,
FuzzParsePublicKey.
- The structure test's signatures rule: outside internal/minisign no
code calls ed25519/rsa/ecdsa's Verify functions or imports blake2b,
but signatureFree's files (ubuntu/pgp.go, proxy/nixcache.go).
- internal/upgrade: Source.Keys, checkSums (signatures.go); the bridge
in legacy.go (checkLegacy, legacyKey, Source.Key); FuzzSumOf.
- packaging/keys/release-{ci,cosign,recovery}.pub, none yet;
packaging.Key ("" without one). TestReleaseKeys (checkReleaseKeys:
none, or three distinct minisign keys, none the old key),
TestCheckReleaseKeys (fixture keys from minisigntest),
TestInstallScriptKeys (checkInstallScriptKeys: one line per role,
empty without keys), TestReleaseRefusesPlaceholders (no key in keys/
marked PLACEHOLDER).
- scripts/release.sh (a tag, --check, --tag; never a snapshot) needs
none or all three of packaging/keys' release keys. With none,
install.sh's release_<role>_key lines are empty or missing; with all
three, each is a minisign key, distinct, not the old release key, not
marked PLACEHOLDER (placeholder), and equal to its install.sh line.
- install.sh checks with minisign -VHQm: prehashed signatures only.
- The structure guard also flags dot imports of the verifier packages
and calls of x509's CheckSignature* method names.
- install.sh: release_<role>_key lines, download_signatures (a role's
signature only when the script has its key), check_signature,
signed_by_two, check_legacy; plainer warning without minisign, with
the commands to check by hand.
- Tests: signatures_test.go (TestFetchWithoutReleaseKeys among them),
upgrade.txtar (-legacy, -keys, and the keys built in, none),
install.txtar (stub minisign with -Q; NO_KEYS), install_minisign.txtar
(real minisign), release.txtar (none, nolines, nokeyline, old, marked
and the rest); DEVVM_RELEASE_KEYS override.
- Docs: internals/install.md, using/upgrading.md, maintaining.md's
Release keys, structure, tests, testing, SECURITY.md, CHANGELOG,
releases/0.2.0.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
||
|
|
d001f7be0f |
build(release): every release builds to the same bytes on any machine
The signing design's first phase. The same tag, built by two builders, now gives byte-identical archives, source tarball, install.sh, SHA256SUMS and formulas. - scripts/release.sh builds every file but the signature in one container, release_image (Debian's buildpack-deps:trixie-scm, pinned by its index's digest), under podman or Docker (DEVVM_RELEASE_RUNTIME), on this machine's processor. The image and the code that runs in the build's container (_build) are the built commit's copies, so a tag builds the same from any checkout; a commit whose release.sh pins no release_image is refused. Everything outside the build's container is the checkout's: the tag's checks, the downloads, the modules' container, the checks on what the build wrote, and the signature. - The build has no network (--network none). The Go modules come first, in a container of their own, the only one with the network, which runs only the checkout's code: its release_image, its release.sh _modules and the Go its mise.lock pins, given only the commit's go.mod and go.sum, read-only, and downloading from proxy.golang.org alone (GOVCS=*:off, GOWORK=off). The checkout's Go rather than the commit's, so a commit can't pick an old Go with a known flaw for the step with the network, and rather than refusing a commit whose Go is older than the checkout's, which would refuse every old tag once mise.lock moves on, though rebuilding old tags is what --tag is for; go.sum pins the module files, so the bytes don't depend on which Go downloaded them. A commit whose go.mod needs a newer Go than the checkout's is refused before anything runs. Every module path the commit's go.mod names is looked up on Google's proxy and checksum database, which the docs say. The build reads the modules read-only as a GOPROXY's files (file:///mod). - Every container runs with --cap-drop ALL, --security-opt no-new-privileges, --pids-limit 8192, --memory 8g and --entrypoint bash, so a setuid file in the commit's image gives no privileges under a rootful runtime, root in it can't chown, a fork bomb or a runaway allocation stops at the container's limits, and the image's entrypoint never runs; Go and GoReleaser are unpacked with tar --no-same-owner. Both runtimes take both limits; rootless podman applies them on cgroups v2 with the pids and memory controllers delegated, as systemd does, and CI's runner needs the same. A full build peaked at 330 processes and 1.8 GiB under Docker Desktop on 10 CPUs. Neither runtime can bound a bind mount's disk use, so the docs say that a running build can fill the temp folder's disk until the time limit. - Each container is named for its run (devvm-release-<the temp folder's suffix>-<n>), so no other run's container, even one left over, has the name, and it's removed (rm -f, then its client ended, then rm -f again): after two hours (DEVVM_RELEASE_TIMEOUT seconds) by a watchdog, and as soon as release.sh stops early. The client runs in the background, so Ctrl+C (INT), a closed terminal (HUP) and kill (TERM) run release.sh's traps at once, which exit through the EXIT trap that removes the container; in the foreground, bash would wait for the client, and the client for the container's PID 1, bash, which ignores them. After kill -9, the watchdog, which outlives release.sh and ignores INT and HUP, removes the container and the temp folder. - Go and GoReleaser are the built commit's mise.lock downloads for linux-arm64 or linux-x64, kept in ~/.cache/devvm-release by SHA-256 and checked before each use, as is the modules' Go from the checkout's mise.lock. A URL has to start with https://dl.google.com/go/ or GoReleaser's releases/download/, can't hold .. or %, which curl decodes (so %2e%2e can't be ..), and goes to curl as --url's value (a lock URL of -K<file> was curl options, run on the host); file:// only from the folder that DEVVM_RELEASE_TEST_FILE_URLS names, which only the tests set, and only when it exists and isn't /. curl: HTTPS redirects only, 30 s to connect, 15 minutes, 1 GiB. A lock with two entries for a tool, or two downloads for the platform, is refused. - The build's repository is new (git init --template=), holding only the commit and, for a tag, the tag, fetched into a pack: no other branches, tags or objects of the maintainer's, no hardlinked files the container could write, and origin set to devvm's GitHub URL, which GoReleaser needs and nothing fetches. Go stamps the binary from the tags it finds, so it finds only the release's. - The container runs as root under a rootless runtime and as you under a rootful one, from the runtime's info (podman's Host.Security.Rootless, Docker's security options), never its name; a runtime that doesn't answer stops the build. Inside: umask 022, TZ=UTC, LC_ALL=C.UTF-8, GOTOOLCHAIN=local, -mod=readonly, no git config but safe.directory, and Go's caches in a container-local folder (Docker Desktop's share lost files that parallel module downloads renamed). - The build writes its files to /out, a mount of its own that it can't swap for a link. Before anything is copied, signed or kept, the folder has to be the one release.sh made, not a link, and everything in it a file or a folder, never a link, yours, and neither setuid, setgid, sticky nor world-writable, and 2 GiB at most, counted as read (sparse files whole) and read no further. The files are then copied to dist/, never moved, as yours with mode 0755 or 0644. minisign signs outside, after the containers are gone. - release.sh --commit COMMIT builds any commit as --head does, with its VERSION; release.sh --tag TAG builds a tag as its release, with its checks, unsigned, to compare with a published SHA256SUMS. An unsigned build never replaces a dist/ that holds SHA256SUMS.minisig, and a build signed with a test key never replaces one whose SHA256SUMS verifies with the checkout's packaging/minisign.pub, the release key. - .goreleaser.yaml: builds_info and every file's info set owner and group root, mode 0755/0644 and the commit's time. - scripts/repro-check.sh [COMMIT | TAG] builds twice with the checkout's release.sh, so no commit's code runs on the host directly. Build 2 fetches from a repository with a stray tag, v0.0.0-stray, at the commit, and runs under Docker where build 1 runs under podman when both are installed (root against your user); every platform archive's files have to be root's with mode 0755 or 0644 (tar -tv). A build that leaves no release fails, whatever its exit status. CI's repro job runs it under the runner's podman and Docker, with a 45-minute limit. The docs say that building a commit runs its code, in a container only as isolated as the runtime keeps it, so an outside commit is built only with the maintainer's go-ahead, and that rebuilding an old tag needs proxy.golang.org to still serve its modules. - scripts/bump.sh release-image moves the container's digest, the SHA-256 of the index it fetched, after checking the index lists linux/amd64 and linux/arm64; TestBumpCoversPins finds the pin. - Tests: release_head.txtar, publish.txtar and the new repro_check.txtar run the scripts through podman and docker stubs and a mise.lock of file:// tarballs. New cases: -K, http://, another host, .. and a percent-encoded .. in a lock URL refused before curl runs, file:// refused without the switch, with it set to 1, to a folder that doesn't exist, to / and from another folder, curl's bounds, two go entries, the build's repository's tags, refs, objects, hardlinks and origin, a stray tag kept out, the image and build code taken from the commit, a commit with no release_image, each runtime's user (rootless and rootful podman and Docker, podman behind docker, no answer), both containers' run lines (security options, limits, entrypoint, --network none, mounts), each container's name its run's (the stub checks it against the run's temp folder), the modules' container getting only go.mod, go.sum, Go and the checkout's release.sh, in the checkout's image, with the checkout's Go, a go.mod newer than the checkout's Go refused before any container, and the build reading its modules; refused output: a link in it, the output folder swapped for a link, a mode 4755, 2755 or 0666 file, a mode 1755 or 0777 folder, a sparse file a byte over 2 GiB (a file of another user's needs root to test, which the test says); a mode 0600 file copied as 0644; a build past DEVVM_RELEASE_TIMEOUT removed by name; release.sh sent INT, HUP and TERM mid-build, ending within 10 s through its trap, and kill -9, each leaving no container, process or temp folder; an unsigned --head and --tag refused over a signed dist/, and a test-key build over a release-key one; --commit never running the commit's host code, --tag's unsigned build matching the signed SHA256SUMS, and repro-check catching a build that records its user, archives that aren't root's, and a release.sh that builds nothing; bump.txtar covers the platform check. Each fails with its fix taken out, which was checked for every fix of the third review: the name, the limits, the test-key refusal, %, the folder's existence and /, the size cap, setgid, sticky, the signal traps, the EXIT trap's removal, the watchdog's removal after kill -9, the client in the background (in the foreground, INT took 60 s), the checkout's Go and the Go version check. Proof, with a throwaway commit whose _build probes its container and leaves a mode 4755 copy of bash and a mode 0666 file in /out, built by this release.sh under Docker Desktop on an arm64 Mac, and under rootful Docker and rootless podman on x86_64 Fedora: every build ran with CapEff and CapBnd 0, NoNewPrivs 1 and no network, couldn't write /mod or rename /out, and was refused before anything was kept; rootful Docker refused its chown to root. The same image under the old run line, on Fedora's rootful Docker: CapBnd a80425fb, NoNewPrivs 0, and proxy.golang.org reachable. Real builds of this commit, stopped 20 s into the build's container: under Docker Desktop, INT, TERM and HUP ended release.sh within 3 s (exit 130, 143, 129) with no container left at once, and kill -9 left the container running for the watchdog, which had removed it and the temp folder 5 s later. The same on Fedora under rootless podman (INT, kill -9, TERM, HUP) and rootful Docker (INT, kill -9). Afterwards no devvm-release container or temp folder was left on either machine. repro-check on this commit, a prerelease (no devvm.rb), agreed on all eight files on the Mac (Docker Desktop, both builds) and on Fedora (rootless podman as root, then rootful Docker as cj), and the two machines' printouts were the same. Co-Authored-By: Claude Opus 5.5 <[email protected]> |
||
|
|
72b648df31 |
feat(release): prereleases on the Homebrew tap, as devvm-rc (#19)
Prereleases now reach the Homebrew tap through a second formula, `devvm-rc`. The stable `devvm` formula stays on the last final release. Co-authored-by: Claude Opus 5.5 <[email protected]> |
||
|
|
63e41118c6 |
feat(release): release candidates and betas, as GitHub prereleases (#13)
devvm can ship prereleases, such as release candidates and betas, for people to try before a release is out. A prerelease's version is `x.y.z-<word>.N`, such as `0.2.0-rc.1` or `0.2.0-beta.2`. `VERSION` holds it, the tag is `v0.2.0-rc.1`, and it gets a `CHANGELOG.md` entry as usual. --------- Co-authored-by: Claude Opus 5.5 <[email protected]> |
||
|
|
f3e4753445 |
build(release): the Homebrew formula installs the release's signed binary
The formula has an archive per platform (macOS and Linux, arm64 and Intel), each URL and checksum filled in by release.sh from the SHA256SUMS it wrote, and installs only the binary; no Go dependency. release.sh --formula-from DIR writes the formula for a published release from its downloaded SHA256SUMS, checked against minisign.pub. Co-Authored-By: Claude Opus 5.5 <[email protected]> |
||
|
|
a85cba7858 |
build(release): scripts/publish.sh, a release from a signed tag in one run
The maintainer tags main's HEAD (git tag -s vX.Y.Z) and runs mise exec -- scripts/publish.sh, entering the minisign password once. It checks the preconditions (release.sh --check for the tag and its signer, main's HEAD and origin, a clean tree, gh logged in, minisign, no other release, the tap's checkout clean on main), builds dist/ with release.sh, prints the version, commit, files with sizes and SHA-256s, the CHANGELOG entry and the tap's diff, asks once on the terminal, then pushes main and the tag, makes the GitHub release as a draft with every file and publishes it, and commits and pushes the tap's formula. Each step skips what's done, a draft left by a failed run gets its files again, and a failure says what was and wasn't published. --dry-run stops before the question; --help. release.sh gains --check (the tag's checks only, printing its commit), fills in the formula's @URL@ and @SHA256@ only outside its comments, and points at publish.sh in its last line. Tests: testdata/script/publish.txtar (a local bare origin and tap, a fake gh, SSH-signed tags, a passwordless minisign key): refusals (no tag, a tag release-signer doesn't pin, a dirty tree, an existing release without its files, gh logged out, no tap), --dry-run, n, y failing at gh release create then at publishing the draft, the reruns and the call order, and a run with everything done. Co-Authored-By: Claude Opus 5.5 <[email protected]> |
||
|
|
586b45f9ad |
fix(release): install.sh's checksum in the signed SHA256SUMS
release.sh wrote install.sh after it signed SHA256SUMS, so nothing signed covered the script and checking it by hand with the release key wasn't possible. It now writes install.sh, adds its checksum to SHA256SUMS, then signs. install.sh and devvm upgrade look up their archive by name, so the extra line changes nothing for them. release_head.txtar checks the line. Co-Authored-By: Claude Opus 5.5 <[email protected]> |
||
|
|
15e063c616 |
chore: the Homebrew tap is devvmhq/tap
Co-Authored-By: Claude Opus 5.5 <[email protected]> |
||
|
|
f4f2ec6a8f |
chore: the repo is devvmhq/devvm
Co-Authored-By: Claude Opus 5.5 <[email protected]> |
||
|
|
1917072228 |
refactor(backend): remove the Docker backend
devvm is about VMs, and Docker's containers aren't VMs: Lima is the default backend and smolvm stays experimental. The backend architecture (Backend, Caps, Require, the registry, backendtest.Fake) stays, so another backend is an addition. Removed: - internal/backend/docker, its registry entry and Names/Experimental's docker half; devvm _docker-connect and _docker-ports (internal/cli/dockerssh.go); assets/docker/unpack.sh. - Test-build overrides DEVVM_DOCKER_KIND, DEVVM_DOCKER_PROC_SYS, DEVVM_LINUX_BUILD_URL/_SHA256, the registry.linuxURL/linuxSHA256 ldflags vars and the CLI tests' Linux-build archive (linux_release). - Interfaces only Docker implemented, with their callers: backend.ProxySocket/ProxySocketOf (the proxy's -listen-unix), DiskUser (ls's and size's disk-over warning, size's disk_used and --json disk_used_gib), Reporter (doctor), LeftoverLister and Leftover (gc --orphans' volumes, networks, containers and images), DockerLayerVM and VMSpec.DockerLayer, SSHTarget.ProxyCommand and vmssh.SSH.Proxy, vmssh.SSH.SessionArgs, CacheEntry.Name. - The docker layer's runtime on a backend that makes VMs for it: vm/dockerlayer.go, KeyDockerLayer, chooseNet's refusal (chooseNet returns a bool now), the refusals at start and devvm network on, ls's "(sysbox)" and --json docker_layer, size_disk_default_unused. - The proxy's relay mode (relay.go, -relay, -relay-to, -listen-unix). - paths.Dirs.Docker and paths.VM.Lifeline. - assets/guest/tools.sh's linked-folder branch; services.sh's DEVVM_LOOP, DEVVM_DOCKERD and DEVVM_SSHD=inetd. - Messages: every docker_* the backend used, docker_layer_runtime, net_docker_layer, net_off_docker_layer, committing_image, pulling_image, unpacking_tools, disk_over, size_disk_default_unused, gc_orphan_volume/_network/_container/_image, docker_connect_failed; gc_orphan_elsewhere reworded. - Tests: docker.txtar, the docker stub's engine (its --from half stays), the ssh stub's login-shell branch; e2e's --backend docker, --engine, the docker host VM and Docker Desktop runs. - Release: one GoReleaser pass, no Linux-build pin in the macOS builds, no Linux devvm in the Homebrew formula's libexec. Linux builds stay. - Docs: backends/docker.md and internals/docker.md, design.md's Docker notes, the Docker column of the feature table, and every page's mentions of the Docker backend, Docker Desktop as one, and Sysbox. Kept: the docker layer in Lima VMs, devcontainer docker-in-docker, --from with images only a local Docker has, Docker Hub references. State written by a Docker VM before this reads as an unknown backend (backend_unknown_vm). Co-Authored-By: Claude Opus 5.5 <[email protected]> |
||
|
|
ee8146a5e4 |
fix: scripts and tests work without shasum, and two CLI scripts start Lima outside devvm on bash 5.2's sh
Fedora 43 has sha256sum but no shasum (Perl's Digest::SHA), and its /bin/sh is bash 5.3, which runs the last command of an `a && b` -c string in sh's place. - install.sh's check_host stops with "needs sha256sum or shasum" before downloading; its sha256 already used either. install.txtar covers shasum alone, both, sha256sum alone and neither, with made-up sums. - scripts/release.sh and scripts/bump.sh get a sha256 helper (sha256sum, else shasum -a 256) in place of four shasum calls. - gc_orphans, release, release_head and tools scripts hash with sha256sum, else shasum. tools' old fallback never fell back (the pipeline's status was cut's). - ls and existing_agents restart a VM outside devvm with `sh -c '... && limactl start ...; exit $?'`: without the exit, bash's sh exec'd the stub, whose ha.pid then named the test runner (the pid devvm recorded), so the VM still looked confined. - The install page lists sha256sum or shasum among the script's needs. Co-Authored-By: Claude Opus 5.5 <[email protected]> |
||
|
|
857c0e8c53 |
docs(site): sections in the reader's order, attack vectors and a first-VM page
The docs move into a folder per sidebar section, in the order a new user needs them: getting-started (install, first-vm, commands), using (images, customizing, from, devcontainer, coding-agents, ssh, limits), safety (attack-vectors, network, clone, git-protection, security), backends (backends.md as the section's _index.md, lima, smolvm, docker), internals (design), cli, and contributing (contributing.md as its _index.md, testing, maintaining). Each section has an _index.md listing its pages, and the docs index is grouped the same way. Commands is now Everyday commands, SSH is SSH and editors. New pages: - safety/attack-vectors.md: Staying safe first (seven habits), then common attacks sorted into Blocked, Kept inside the VM, Narrowed, not closed, and Left to you. - getting-started/first-vm.md: making a VM, the first run, what's in it, coding agents, coming back to it. Links to Staying safe from the home page, README, security, install, coding agents and clone. Every relative link, the home page's, the README's, SECURITY.md's, CONTRIBUTING.md's, AGENTS.md's, the proxy and oci READMEs', release.sh's hints and the recording's URL use the new paths. internal/msg/docs.go names pages by path (using/images#...), and checkDoc takes a section's _index.md for its folder (backends#...). contributing/_index.md describes the sections and how links name them. Also carries the docs edits made alongside the forwarder work in the tree (backends, images, limits, security, design, commands and the generated devvm ports page), whose code isn't in this commit. Co-Authored-By: Claude Opus 5.5 <[email protected]> |
||
|
|
fcbea2c744 |
feat(docker): network policy, and build confinement on Docker Desktop
A Docker VM with network policy sits alone with a relay container on an internal network of its own (inhibit_ipv4). The relay, devvm's own Linux build in an empty imported image (read-only, every capability dropped), copies the VM's connections to a unix socket of devvm's proxy on the host, so tokens, the Keychain, the CA key and agents' logins never enter Docker. On and off is docker network connect/disconnect at the next start. Desktop builds run on a network and relay of their own, through a host proxy allowing any host on ports 80 and 443. - every Docker VM drops NET_RAW; it's in the config hash, so containers are made again from their commit - confined: the start's ID, the VM alone on its network with the relay by its recorded container ID, the network still internal; a foreign member is docker_network_shared, at start and on removal - proxy: -listen-unix, -relay/-relay-to; a lifeline pid file written after the proxy started whose process has gone ends it - macOS fetches the release's Linux build on first use, checked against a SHA-256 the two-pass release.sh bakes in; builds without the pin use devvm-linux-<arch> beside devvm or refuse - the build proxy is stopped through the process devvm started - reviewed: design notes and threat check in design.md; e2e on the Linux engine and Desktop: dropped capabilities, network members and options, no IPv6 beyond the bridge's link-local, no DNS query leaving (captured, with an unconfined control), direct connections refused Co-Authored-By: Claude Opus 5.5 <[email protected]> |
||
|
|
37d2fa57e4 |
feat(install): install.sh for the per-platform release archives
install.sh picks this host's archive (devvm-<version>-<os>-<arch>.tar.gz: darwin or linux, arm64 or amd64; Apple silicon's under Rosetta, from sysctl hw.optional.arm64), checks SHA256SUMS's minisign signature (an empty key still skips it, with a warning; no minisign prints the command to check by hand), then the archive's checksum, and installs the binary with its data files in <prefix>/lib/devvm/<version>, linked from <prefix>/bin/devvm. Older versions go, except one a running process names in its arguments (a VM's proxy, QEMU's guestfwd on Linux): it's kept until a later install. Then it offers devvm doctor --fixes' fixes, asking first (Homebrew's Lima or Lima's checked release tarball, QEMU, the kvm group), and runs devvm doctor. Downloads are HTTPS only. Its text isn't messages: it runs before devvm is there. release.sh --head now needs install.sh too. Tests: testdata/script/install.txtar sources install.sh (host and archive names, Rosetta, version choice and validation, HTTPS-only fetch, run_fix as words, install and links, reinstall, an older version in use kept (and the real ps), signature good, bad, missing, no minisign, a bad checksum, no archive for this host, Lima's tarball for the host and arch and a bad checksum, the PATH hint, the fixes with --yes, the kvm re-login, no yes, Lima's release once allowed, nothing missing, main's options, and the tests' devvm binary installed and finding its files); release_head.txtar: a HEAD without install.sh is refused. docs: install.md (Homebrew and the install script, upgrading, uninstalling), maintaining.md (trying install.sh on a --head build), README. Co-Authored-By: Claude Opus 5.5 <[email protected]> |
||
|
|
f42d436350 |
build(release): release.sh around GoReleaser, bump.sh
scripts/release.sh checks the signed tag (git tag -v) and its signer against this checkout's packaging/release-signer, then runs goreleaser release --skip=publish (--snapshot with --head) in a clone of the commit, so only what's committed goes in. .goreleaser.yaml builds darwin/linux x arm64/amd64 archives with the binary and its data files, a source tarball and SHA256SUMS, with -X github.com/w3cj/devvm/internal/cli.version (VERSION's version, for HEAD too). release.sh checks the host's binary prints the version, signs SHA256SUMS with minisign and verifies it, fills in install.sh (release_version, minisign_key) and the Homebrew formula, which builds from the source tarball with Go (brew audit --strict clean). --head takes DEVVM_MINISIGN_PUB for a test key, and skips a missing install.sh; a tag without one is refused. scripts/bump.sh writes the host mise's pins in internal/tools/mise.go. VERSION and a fresh CHANGELOG.md. docs: maintaining.md (pins, releasing). Tests: testdata/script/release.txtar (unsigned tag, no pin, another signer, the checkout's pin, no install.sh), release_head.txtar (unsigned, signed and verified, install.sh and formula filled in, only committed files, wrong key, wrong version, bad install.sh, bad VERSION), bump.txtar (crane, mise in base.sh and mise.go, hostile and missing values, --check control characters, unknown tool). The sandbox sets DEVVM_REPO. Co-Authored-By: Claude Opus 5.5 <[email protected]> |