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
1# Releasing Vole
2
3This maintainer guide describes how Vole's own binaries, packages, package
4repositories, signatures, checksums, and SBOM are produced. For creating a
5release in a repository hosted by Vole, see [Releases](docs/releases.md). For
6development setup and verification, see [DEVELOPMENT.md](DEVELOPMENT.md).
7
8## How the release is built
9
10`.vole/workflows/release.yaml` runs on annotated `v*` tags. It tests and scans
11the tagged source, cross-compiles Linux binaries for both architectures, builds
12Debian, RPM, and Arch packages with [nfpm](https://nfpm.goreleaser.com), signs
13the RPMs and Arch packages, writes the apt, yum, and per-architecture pacman
14repositories those packages need, signs the repository metadata and the
15checksum list, generates an SBOM, and attaches the results to the tag's release.
16
17Arch's `pkgver` cannot carry a semver hyphen, so the workflow passes
18`0.1.0rc2` to the Arch packager where Debian and RPM receive `0.1.0-rc2`. The
19resulting package is `vole-0.1.0rc2-1-x86_64.pkg.tar.zst`.
20
21The job requires bridge networking to download Go modules and pinned build
22tools, and the `RELEASE_GPG_KEY` repository secret. Cross-compilation means any
23trusted Linux runner with the required image can produce both architectures.
24
25Reproduce the commands from a tagged checkout:
26
27```sh
28git switch --detach v0.2.0
29go run ./cmd/vole workflow run release
30```
31
32A local workflow run checks the build in the defined container but does not
33publish artifacts. It reads `RELEASE_GPG_KEY` from the instance like a runner
34does; when the secret is not available it leaves the tree unsigned and says so.
35A pushed tag without the secret fails rather than publishing an unsigned
36release. The version comes from `git describe --tags --exact-match`; an untagged
37checkout stops before building. A build from an untagged checkout reports the
38commit Go recorded instead of claiming a release. Build outputs use the tag
39commit time to support byte-for-byte reproduction.
40
41To build and sign the package repositories from packages you already have:
42
43```sh
44epoch="$(git log -1 --format=%ct)"
45python3 scripts/sign-release.py packages --dist dist --epoch "$epoch"
46python3 scripts/build-package-repos.py --dist dist --version 0.2.0 --epoch "$epoch"
47python3 scripts/sign-release.py repositories --dist dist --epoch "$epoch"
48( cd dist && find . -type f ! -name SHA256SUMS ! -name SHA256SUMS.asc \
49 -printf '%P\0' | sort -z | xargs -0 sha256sum > SHA256SUMS )
50python3 scripts/sign-release.py sums --dist dist --epoch "$epoch"
51```
52
53`sign-release.py` reads the armored private key from `RELEASE_GPG_KEY`, or from
54`--key-file` for a local test. It needs GnuPG and `rpm`/`rpmsign`;
55`build-package-repos.py` needs `dpkg-scanpackages` from dpkg-dev and
56`createrepo_c` from createrepo-c. Both workflow images carry them.
57
58## The release key
59
60The private key is a repository secret named `RELEASE_GPG_KEY`. The public half
61is committed at `packaging/keys/vole-release.asc`; the signing script refuses to
62sign when that file is missing or does not match the secret's fingerprint. That
63check makes a stale or uncommitted key a failure instead of a release that
64verifies against nothing.
65
66Create the key once, on a trusted machine:
67
68```sh
69export GNUPGHOME="$(mktemp -d)"
70chmod 700 "$GNUPGHOME"
71gpg --batch --passphrase '' --quick-generate-key \
72 'Vole Release <release@rodent.software>' rsa4096 sign 5y
73gpg --batch --armor --export > vole-release.asc
74gpg --batch --armor --export-secret-keys > vole-release.private.asc
75gpg --list-keys --with-fingerprint
76```
77
78Store the private key on the instance, where a job reads it through the secret
79named in its workflow:
80
81```sh
82vole secret set vole RELEASE_GPG_KEY --from-file vole-release.private.asc
83```
84
85Keep an offline copy of `vole-release.private.asc`; `vole secret get vole
86RELEASE_GPG_KEY` can read the stored copy as a maintainer, but a single copy is
87not a backup. Remove the temporary file and GnuPG home afterwards, then commit
88the public half:
89
90```sh
91shred -u vole-release.private.asc
92rm -rf "$GNUPGHOME"
93install -D -m 0644 vole-release.asc packaging/keys/vole-release.asc
94```
95
96The key has no passphrase. The secret store is the only protection a build job
97can use, and a passphrase stored in the same instance would be delivered to the
98same job, so it would protect nothing against a compromised runner or instance.
99A passphrase would only help an offline copy, so protect the backup instead.
100Anyone who can control a trusted runner or read this repository's secrets can
101sign a release; that is the same trust the rest of CI already requires.
102
103Rotation is a change of its own: generate a new key, commit its public half in
104the same change that replaces the secret, and tell clients to replace their
105keyring. A release rebuilt from an old tag after a rotation carries the new
106signature, not the old one. The key recipe above expires after five years; sign
107before then, and rotate before expiry. An expired key fails in the signing
108script rather than producing a release that clients reject.
109
110## Release contents and SBOM
111
112A Vole release includes:
113
114- `vole-linux-amd64` and `vole-linux-arm64`, `vole-darwin-amd64` and
115 `vole-darwin-arm64`, and `vole-windows-amd64.exe`;
116- `vole-windows-amd64.msi`, the Windows package, for stable tags only: an MSI
117 version cannot carry a pre-release suffix, and `wixl` cannot express the
118 same-version upgrade a pre-release needs. Pre-release tags ship the Windows
119 binary alone, and `install.ps1` says so;
120- `install.sh` and `install.ps1`, the one-command installers, and
121 `vole-darwin-sshd.conf`, the macOS front-door drop-in;
122- Debian, RPM, and Arch packages for both architectures, at the release root;
123- `apt/` — a flat Debian repository: the packages, `Packages`,
124 `Packages.gz`, `Release`, `InRelease`, and `Release.gpg`;
125- `apt/vole.gpg` — the public key as a binary keyring for `signed-by=`;
126- `yum/` — an RPM repository: the packages, `repodata/`, and
127 `repodata/repomd.xml.asc`;
128- `yum/RPM-GPG-KEY-vole` — the public key for `rpm --import`;
129- `pacman/x86_64/` and `pacman/aarch64/` — one Arch repository per
130 architecture: the package, its `.sig`, `vole.db`, `vole.files`, and the two
131 database signatures;
132- `vole-release-key.asc` and `vole-release-key.fingerprint` at the release root;
133- `vole-<version>.sbom.cdx.json` in CycloneDX JSON;
134- `SHA256SUMS` and its detached signature `SHA256SUMS.asc`.
135
136`SHA256SUMS` covers every other attached file, including all three repository
137trees, the public key, and the signatures. It cannot cover its own signature, so
138`SHA256SUMS.asc` is written after the list and excluded from it.
139
140The SBOM lists linked Go modules, their versions and `go.sum` hashes, the Go
141toolchain, and detected license evidence. One SBOM covers every architecture and
142both operating systems, because they share a module graph. SQLite is part of
143that graph: the driver compiles it in, so the SBOM names the engine version the
144binaries actually run, and no part of the database comes from the host.
145
146To regenerate the SBOM from a tag:
147
148```sh
149go run github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@v1.9.0 \
150 app -json -noserial -std -licenses -main cmd/vole -output SBOM.cdx.json .
151```
152
153## Reproducibility
154
155The release workflow replaces the SBOM tool's wall-clock timestamp with the tag
156commit time. The repository metadata is pinned the same way: `Release`,
157`Packages.gz`, and `repomd.xml` carry the tag commit time, and the copied
158packages get that mtime so createrepo_c records it as each package's file time.
159
160`repo-add` stamps pacman database entries with the clock, so
161`scripts/build-package-repos.py` rewrites `vole.db` and `vole.files` with the tag
162commit time, no owner names, sorted entries, and no gzip timestamp. Signing the
163packages before `repo-add` records the same `%PGPSIG%` in every build.
164
165Signatures are pinned too, as far as the tools allow. GnuPG and `rpmsign` are
166given the tag commit time through `--faked-system-time` (for `rpmsign`, through
167its `%_gpg_sign_cmd_extra_args` macro), so rebuilding one tag with the same key
168produces the same signed files. GnuPG refuses a signature time before the key
169was created, so the time used is the later of the tag commit time and the key's
170creation time. The first releases signed by a fresh key therefore carry the key
171creation time, not an earlier commit time. A key that has expired at the signing
172time is an error.
173
174## Publish the package repositories
175
176Attaching the files is not enough for a package manager: the client needs a URL
177that keeps working across upgrades. Vole's own release follows the `stable`
178channel. After the release workflow finishes, move it to the new tag:
179
180```sh
181vole release channel set stable v0.2.0 -m "Recommended for production"
182```
183
184While the channel names a release, that release cannot be edited. Pointing the
185channel at the next tag is both the publish step and what allows the old
186release to change. Clients then use:
187
188```text
189https://rodent.software/vole/channels/stable/apt
190https://rodent.software/vole/channels/stable/yum
191https://rodent.software/vole/channels/stable/pacman/$arch
192https://rodent.software/vole/channels/stable/vole-release-key.asc
193https://rodent.software/vole/channels/stable/install.sh
194```
195
196Apt verifies `InRelease` (or `Release` plus `Release.gpg`) and the hashes in it.
197Dnf verifies `repomd.xml.asc` and, with `gpgcheck=1`, each RPM. Pacman verifies
198`vole.db`/`vole.files` and each package's detached `.sig`. The public key is
199served from the same channel for convenience; compare its fingerprint with the
200committed key at `packaging/keys/vole-release.asc` before trusting it.
201
202The release attaches `install.sh` beside the key. It is the one-command client
203for the channel: it detects the distribution, writes the same key and source
204lines the install docs show, and hands the install to the package manager. On
205macOS it installs the release binary into `/usr/local/bin` as root or
206`~/.local/bin` otherwise, after checking it against the release's `SHA256SUMS`,
207and it refuses when Homebrew already owns `vole`. It pins the committed key's
208SHA-256 and fingerprint in `packaging/install.sh`, and
209the release publishes that committed file verbatim so the pin is exact. Rotating
210the release key therefore means updating both constants in the same change;
211`scripts/check-install.sh` fails when they disagree.
212
213## Package verification
214
215Branch CI (`.vole/workflows/verify.yaml`) does not build the packages, the
216repository metadata, or the signatures. Those are release-path steps, they are
217slow, and they only run on a tag. `scripts/check-install.sh` and
218`scripts/check-deploy.py` stay in verify because they are shell-only checks of
219files a release consumes: the installer's pinned key, and the cloud-init
220deployment files.
221
222To exercise the release path without publishing anything, run the release
223workflow against a tagged checkout:
224
225```sh
226git switch --detach v0.2.0
227vole workflow run release
228```
229
230It runs the build in the release image and uploads nothing. With
231`RELEASE_GPG_KEY` available it signs; without it, it leaves the tree unsigned
232and says so. That is the manual smoke test for package, repository, signature,
233and unit errors before a tag is pushed.
234
235See [Deploy on Linux](docs/deploy/linux.md#what-the-package-installs) for the paths and systemd units
236the packages install, and [Install](docs/install.md#add-the-repository-by-hand)
237for the client commands.
238
239## Windows sign-off
240
241CI runs every job in a Linux container, so no release has installed the Windows
242MSI or run the service. `wixl` on Linux builds the package but cannot exercise
243it, and the MSI is not Authenticode-signed yet, so a packaging mistake would ship
244to Windows users undetected.
245
246Before a release that carries the MSI is published, install it on a Windows
247machine and check:
248
249- `msiexec /i vole-windows-amd64.msi /l*v install.log` exits 0, the `Vole`
250 service reports `Running`, and the Application event log has no error under
251 source `Vole`;
252- `%ProgramData%\Vole\vole.toml` exists, the data directory exists, and the
253 service account, `SYSTEM`, and `Administrators` are the only entries in both
254 access lists;
255- HTTP answers on the configured address, the admin CLI works over the SSH
256 listener, and a clone and push succeed;
257- a reboot brings the forge back without a login;
258- installing the MSI over the previous release upgrades it: one Programs and
259 Features entry, the service running, the configuration and data untouched;
260- uninstalling removes the service and `%ProgramFiles%\Vole` and leaves
261 `%ProgramData%\Vole` in place.
262
263Do not publish a Windows MSI that has not passed this check.
264
265## macOS sign-off
266
267CI runs every job in a Linux container, so a release has never executed the test
268suite on macOS. The macOS binaries (`vole-darwin-amd64` and `vole-darwin-arm64`)
269are compiled by the release but not exercised by it, so a platform mistake in a
270server path, a socket, or a client check would ship to users undetected.
271
272Before a release that carries a macOS binary is published, run the macOS check on
273a Mac:
274
275```sh
276scripts/check-macos.sh
277```
278
279It runs the unit suite and an end-to-end pass over the features a Mac user first
280touches: init, account and repository creation, clone and push over the built-in
281SSH listener, an issue, a change request, a release attach, a pages site, and
282`db check`/`db backup`. Do not publish a macOS artifact that has not passed this
283check. See [Development](DEVELOPMENT.md) for the individual commands it runs.
284