mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 06:23:17 -10:00
main
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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]>
|
||
|
|
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]> |
||
|
|
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]> |