Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Code

527 commit(s) on main

Put job execution behind an interface Keenan Nemetz · 2h ago de3eec16
source preview history blame raw 13.2 KiB

Releasing Vole

This maintainer guide describes how Vole’s own binaries, packages, package repositories, signatures, checksums, and SBOM are produced. For creating a release in a repository hosted by Vole, see Releases. For development setup and verification, see DEVELOPMENT.md.

How the release is built

.vole/workflows/release.yaml runs on annotated v* tags. It tests and scans the tagged source, cross-compiles Linux binaries for both architectures, builds Debian, RPM, and Arch packages with nfpm, signs the RPMs and Arch packages, writes the apt, yum, and per-architecture pacman repositories those packages need, signs the repository metadata and the checksum list, generates an SBOM, and attaches the results to the tag’s release.

Arch’s pkgver cannot carry a semver hyphen, so the workflow passes 0.1.0rc2 to the Arch packager where Debian and RPM receive 0.1.0-rc2. The resulting package is vole-0.1.0rc2-1-x86_64.pkg.tar.zst.

The job requires bridge networking to download Go modules and pinned build tools, and the RELEASE_GPG_KEY repository secret. Cross-compilation means any trusted Linux runner with the required image can produce both architectures.

Reproduce the commands from a tagged checkout:

git switch --detach v0.2.0
go run ./cmd/vole workflow run release

A local workflow run checks the build in the defined container but does not publish artifacts. It reads RELEASE_GPG_KEY from the instance like a runner does; when the secret is not available it leaves the tree unsigned and says so. A pushed tag without the secret fails rather than publishing an unsigned release. The version comes from git describe --tags --exact-match; an untagged checkout stops before building. A build from an untagged checkout reports the commit Go recorded instead of claiming a release. Build outputs use the tag commit time to support byte-for-byte reproduction.

To build and sign the package repositories from packages you already have:

epoch="$(git log -1 --format=%ct)"
python3 scripts/sign-release.py packages --dist dist --epoch "$epoch"
python3 scripts/build-package-repos.py --dist dist --version 0.2.0 --epoch "$epoch"
python3 scripts/sign-release.py repositories --dist dist --epoch "$epoch"
( cd dist && find . -type f ! -name SHA256SUMS ! -name SHA256SUMS.asc \
    -printf '%P\0' | sort -z | xargs -0 sha256sum > SHA256SUMS )
python3 scripts/sign-release.py sums --dist dist --epoch "$epoch"

sign-release.py reads the armored private key from RELEASE_GPG_KEY, or from --key-file for a local test. It needs GnuPG and rpm/rpmsign; build-package-repos.py needs dpkg-scanpackages from dpkg-dev and createrepo_c from createrepo-c. Both workflow images carry them.

The release key

The private key is a repository secret named RELEASE_GPG_KEY. The public half is committed at packaging/keys/vole-release.asc; the signing script refuses to sign when that file is missing or does not match the secret’s fingerprint. That check makes a stale or uncommitted key a failure instead of a release that verifies against nothing.

Create the key once, on a trusted machine:

export GNUPGHOME="$(mktemp -d)"
chmod 700 "$GNUPGHOME"
gpg --batch --passphrase '' --quick-generate-key \
  'Vole Release <release@rodent.software>' rsa4096 sign 5y
gpg --batch --armor --export > vole-release.asc
gpg --batch --armor --export-secret-keys > vole-release.private.asc
gpg --list-keys --with-fingerprint

Store the private key on the instance, where a job reads it through the secret named in its workflow:

vole secret set vole RELEASE_GPG_KEY --from-file vole-release.private.asc

Keep an offline copy of vole-release.private.asc; vole secret get vole RELEASE_GPG_KEY can read the stored copy as a maintainer, but a single copy is not a backup. Remove the temporary file and GnuPG home afterwards, then commit the public half:

shred -u vole-release.private.asc
rm -rf "$GNUPGHOME"
install -D -m 0644 vole-release.asc packaging/keys/vole-release.asc

The key has no passphrase. The secret store is the only protection a build job can use, and a passphrase stored in the same instance would be delivered to the same job, so it would protect nothing against a compromised runner or instance. A passphrase would only help an offline copy, so protect the backup instead. Anyone who can control a trusted runner or read this repository’s secrets can sign a release; that is the same trust the rest of CI already requires.

Rotation is a change of its own: generate a new key, commit its public half in the same change that replaces the secret, and tell clients to replace their keyring. A release rebuilt from an old tag after a rotation carries the new signature, not the old one. The key recipe above expires after five years; sign before then, and rotate before expiry. An expired key fails in the signing script rather than producing a release that clients reject.

Release contents and SBOM

A Vole release includes:

  • vole-linux-amd64 and vole-linux-arm64, vole-darwin-amd64 and vole-darwin-arm64, and vole-windows-amd64.exe;
  • vole-windows-amd64.msi, the Windows package, for stable tags only: an MSI version cannot carry a pre-release suffix, and wixl cannot express the same-version upgrade a pre-release needs. Pre-release tags ship the Windows binary alone, and install.ps1 says so;
  • install.sh and install.ps1, the one-command installers, and vole-darwin-sshd.conf, the macOS front-door drop-in;
  • Debian, RPM, and Arch packages for both architectures, at the release root;
  • apt/ — a flat Debian repository: the packages, Packages, Packages.gz, Release, InRelease, and Release.gpg;
  • apt/vole.gpg — the public key as a binary keyring for signed-by=;
  • yum/ — an RPM repository: the packages, repodata/, and repodata/repomd.xml.asc;
  • yum/RPM-GPG-KEY-vole — the public key for rpm --import;
  • pacman/x86_64/ and pacman/aarch64/ — one Arch repository per architecture: the package, its .sig, vole.db, vole.files, and the two database signatures;
  • vole-release-key.asc and vole-release-key.fingerprint at the release root;
  • vole-<version>.sbom.cdx.json in CycloneDX JSON;
  • SHA256SUMS and its detached signature SHA256SUMS.asc.

SHA256SUMS covers every other attached file, including all three repository trees, the public key, and the signatures. It cannot cover its own signature, so SHA256SUMS.asc is written after the list and excluded from it.

The SBOM lists linked Go modules, their versions and go.sum hashes, the Go toolchain, and detected license evidence. One SBOM covers every architecture and both operating systems, because they share a module graph. SQLite is part of that graph: the driver compiles it in, so the SBOM names the engine version the binaries actually run, and no part of the database comes from the host.

To regenerate the SBOM from a tag:

go run github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@v1.9.0 \
  app -json -noserial -std -licenses -main cmd/vole -output SBOM.cdx.json .

Reproducibility

The release workflow replaces the SBOM tool’s wall-clock timestamp with the tag commit time. The repository metadata is pinned the same way: Release, Packages.gz, and repomd.xml carry the tag commit time, and the copied packages get that mtime so createrepo_c records it as each package’s file time.

repo-add stamps pacman database entries with the clock, so scripts/build-package-repos.py rewrites vole.db and vole.files with the tag commit time, no owner names, sorted entries, and no gzip timestamp. Signing the packages before repo-add records the same %PGPSIG% in every build.

Signatures are pinned too, as far as the tools allow. GnuPG and rpmsign are given the tag commit time through --faked-system-time (for rpmsign, through its %_gpg_sign_cmd_extra_args macro), so rebuilding one tag with the same key produces the same signed files. GnuPG refuses a signature time before the key was created, so the time used is the later of the tag commit time and the key’s creation time. The first releases signed by a fresh key therefore carry the key creation time, not an earlier commit time. A key that has expired at the signing time is an error.

Publish the package repositories

Attaching the files is not enough for a package manager: the client needs a URL that keeps working across upgrades. Vole’s own release follows the stable channel. After the release workflow finishes, move it to the new tag:

vole release channel set stable v0.2.0 -m "Recommended for production"

While the channel names a release, that release cannot be edited. Pointing the channel at the next tag is both the publish step and what allows the old release to change. Clients then use:

https://rodent.software/vole/channels/stable/apt
https://rodent.software/vole/channels/stable/yum
https://rodent.software/vole/channels/stable/pacman/$arch
https://rodent.software/vole/channels/stable/vole-release-key.asc
https://rodent.software/vole/channels/stable/install.sh

Apt verifies InRelease (or Release plus Release.gpg) and the hashes in it. Dnf verifies repomd.xml.asc and, with gpgcheck=1, each RPM. Pacman verifies vole.db/vole.files and each package’s detached .sig. The public key is served from the same channel for convenience; compare its fingerprint with the committed key at packaging/keys/vole-release.asc before trusting it.

The release attaches install.sh beside the key. It is the one-command client for the channel: it detects the distribution, writes the same key and source lines the install docs show, and hands the install to the package manager. On macOS it installs the release binary into /usr/local/bin as root or ~/.local/bin otherwise, after checking it against the release’s SHA256SUMS, and it refuses when Homebrew already owns vole. It pins the committed key’s SHA-256 and fingerprint in packaging/install.sh, and the release publishes that committed file verbatim so the pin is exact. Rotating the release key therefore means updating both constants in the same change; scripts/check-install.sh fails when they disagree.

Package verification

Branch CI (.vole/workflows/verify.yaml) does not build the packages, the repository metadata, or the signatures. Those are release-path steps, they are slow, and they only run on a tag. scripts/check-install.sh and scripts/check-deploy.py stay in verify because they are shell-only checks of files a release consumes: the installer’s pinned key, and the cloud-init deployment files.

To exercise the release path without publishing anything, run the release workflow against a tagged checkout:

git switch --detach v0.2.0
vole workflow run release

It runs the build in the release image and uploads nothing. With RELEASE_GPG_KEY available it signs; without it, it leaves the tree unsigned and says so. That is the manual smoke test for package, repository, signature, and unit errors before a tag is pushed.

See Deploy on Linux for the paths and systemd units the packages install, and Install for the client commands.

Windows sign-off

CI runs every job in a Linux container, so no release has installed the Windows MSI or run the service. wixl on Linux builds the package but cannot exercise it, and the MSI is not Authenticode-signed yet, so a packaging mistake would ship to Windows users undetected.

Before a release that carries the MSI is published, install it on a Windows machine and check:

  • msiexec /i vole-windows-amd64.msi /l*v install.log exits 0, the Vole service reports Running, and the Application event log has no error under source Vole;
  • %ProgramData%\Vole\vole.toml exists, the data directory exists, and the service account, SYSTEM, and Administrators are the only entries in both access lists;
  • HTTP answers on the configured address, the admin CLI works over the SSH listener, and a clone and push succeed;
  • a reboot brings the forge back without a login;
  • installing the MSI over the previous release upgrades it: one Programs and Features entry, the service running, the configuration and data untouched;
  • uninstalling removes the service and %ProgramFiles%\Vole and leaves %ProgramData%\Vole in place.

Do not publish a Windows MSI that has not passed this check.

macOS sign-off

CI runs every job in a Linux container, so a release has never executed the test suite on macOS. The macOS binaries (vole-darwin-amd64 and vole-darwin-arm64) are compiled by the release but not exercised by it, so a platform mistake in a server path, a socket, or a client check would ship to users undetected.

Before a release that carries a macOS binary is published, run the macOS check on a Mac:

scripts/check-macos.sh

It runs the unit suite and an end-to-end pass over the features a Mac user first touches: init, account and repository creation, clone and push over the built-in SSH listener, an issue, a change request, a release attach, a pages site, and db check/db backup. Do not publish a macOS artifact that has not passed this check. See Development for the individual commands it runs.