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.

Rewrite documentation around reader tasks

d1f44d838966c0a4762073f12375ec7562582fdf · Keenan Nemetz · 21h ago · parent 9103f6a8

docs/packaging.md −251

@@ -1,251 +0,0 @@
1 # Packages and upgrades
2
3 Vole provides `.deb`, `.rpm`, and Arch packages for `amd64` and `arm64`, and an
4 MSI for Windows `amd64`. This page describes the installed files, the service,
5 and the upgrade procedure. For installation, see [Install](install.md).
6
7 ## Package repositories
8
9 Each release publishes its packages inside `apt/`, `yum/`, and
10 `pacman/<arch>/` as well as at the release root. The `apt/` tree is a flat
11 Debian repository, `yum/` is an RPM repository, and each `pacman/<arch>/` is a
12 signed Arch repository with `vole.db` and `vole.files`. A channel URL works as a
13 package source for all three clients.
14 [Add the repository by hand](install.md#add-the-repository-by-hand)
15 has the source lines for each distribution.
16
17 The apt and yum trees carry both architectures, while pacman has one database
18 per architecture: clients use `pacman/$arch`, which expands to `x86_64` or
19 `aarch64`. Move the channel to a new release to publish it; a machine following
20 the channel picks the new version up with its next upgrade.
21
22 Each release also attaches `install.sh`, served at
23 `/<repo>/channels/<channel>/install.sh`. It writes the key and source lines
24 above for the distribution it detects, then runs the package manager; on an
25 unsupported distribution it stops and points at the manual commands. On macOS it
26 installs the release binary into `/usr/local/bin` as root or `~/.local/bin`
27 otherwise, after checking it against `SHA256SUMS`, and it refuses when Homebrew
28 already owns the `vole` command. The armored copy it downloads is
29 `packaging/keys/vole-release.asc` verbatim, and the script pins that file's
30 SHA-256 and the key fingerprint, so rotating the release key means updating both
31 constants in the same change.
32
33 ### Repository signature verification
34
35 Apt verifies `InRelease` (or `Release` plus `Release.gpg`) and the hashes it
36 carries for every `.deb`. Dnf verifies `repomd.xml.asc` and, with `gpgcheck=1`,
37 each RPM's signature. Pacman verifies `vole.db` and `vole.files` and each
38 package's detached `.sig`. A missing or wrong signature fails the update or
39 install instead of accepting the package.
40
41 The installation commands and the install script download the public key from
42 the same channel. The script checks the key's SHA-256 and fingerprint before
43 writing anything and fails closed on a mismatch. To verify the key
44 independently, compare its fingerprint with the copy committed at
45 `packaging/keys/vole-release.asc` in the source repository. The release also
46 attaches the key as `vole-release-key.asc` and its fingerprint as
47 `vole-release-key.fingerprint`. The Git checkout and the release host are
48 separate paths, so one compromised host does not change both copies.
49
50 ### Pin a release
51
52 A channel follows exactly one release. To stay on a particular version, replace
53 `/channels/stable` in the package source with that release's artifact path, for
54 example `https://rodent.software/vole/releases/v0.2.0/artifacts`. A pinned apt
55 source therefore ends in `/releases/v0.2.0/artifacts/apt`. Change the source
56 when you are ready to upgrade.
57
58 ## Verify a direct download
59
60 Every release attaches `SHA256SUMS`, its detached signature `SHA256SUMS.asc`,
61 and `vole-release-key.asc`. Set `tag` to the release you downloaded, then verify
62 the signature before trusting the checksum list:
63
64 ```sh
65 tag=v0.2.0
66 base=https://rodent.software/vole/releases/$tag/artifacts
67 curl -fLO "$base/vole-release-key.asc"
68 curl -fLO "$base/SHA256SUMS"
69 curl -fLO "$base/SHA256SUMS.asc"
70 gpg --import vole-release-key.asc
71 gpg --verify SHA256SUMS.asc SHA256SUMS
72 sha256sum -c --ignore-missing SHA256SUMS
73 ```
74
75 `gpg --verify` must print `Good signature`. Compare the key's fingerprint with
76 the committed copy described in
77 [Repository signature verification](#repository-signature-verification).
78 `SHA256SUMS` covers every file attached to the release, including the `apt/`,
79 `yum/`, and pacman trees and the macOS binaries; `--ignore-missing` checks the
80 files you downloaded and skips the rest.
81
82 On macOS, `sha256sum` is not installed by default: use
83 `shasum -a 256 -c --ignore-missing SHA256SUMS`, and install `gpg` first if you
84 need to verify the signature (`brew install gnupg`).
85
86 HTTPS authenticates the host that served the key. If that is not enough for your
87 threat model, clone the source repository over SSH and compare the committed
88 key, or build Vole from that checkout.
89
90 ## What the package installs
91
92 | Path | Purpose |
93 |---|---|
94 | `/usr/bin/vole` | Vole binary with the release version embedded |
95 | `/usr/lib/systemd/system/vole.service` | Hardened forge service |
96 | `/usr/lib/systemd/system/vole-runner.service` | Runner service, disabled until configured |
97 | `/etc/vole/vole.toml` | Forge configuration, preserved as a conffile or Arch backup entry |
98 | `/etc/vole/runner.env` | Runner arguments, preserved as a conffile or Arch backup entry |
99 | `/etc/containers/registries.conf.d/50-vole-runner.conf` | Short-name registry resolution for rootless Podman |
100 | `/etc/containers/containers.conf.d/50-vole-runner.conf` | `cgroupfs` configuration for the system runner unit |
101 | `/usr/share/vole/sshd/vole.conf` | sshd drop-in for the front door; shipped, never installed |
102 | `/usr/lib/vole/ssh-shell` | Login shell of the `git` account: runs one command, refuses the rest |
103 | `/usr/lib/tmpfiles.d/vole.conf` | Creates `/run/vole` as `vole:git` mode `2770` at boot |
104 | `/usr/share/doc/vole/` | `LICENSE` and `NOTICE` |
105 | `/var/lib/vole/data` | Repositories, databases, objects, logs, secrets, and host key |
106
107 The packages depend on Git and nothing else. SQLite is compiled into the binary
108 by a pure-Go driver, so the executable is static and no package names a runtime
109 database library. That is also what lets the release publish one Linux binary
110 and two macOS binaries that run without a matching system SQLite; see
111 [Install a release binary](install.md#install-a-release-binary) and
112 [Install on macOS](install.md#install-on-macos).
113
114 Installation creates the `vole` service account, creates a `git` account for the
115 SSH front door, and initializes the data directory. It does not create an
116 instance admin, enable the forge service, or touch `/etc/ssh`: putting sshd in
117 front of Vole is a change to your sshd, so the drop-in is shipped and not
118 installed. `/usr/share/vole/sshd/vole.conf` opens with the four steps.
119
120 ## The Windows package
121
122 The Windows release artifact is `vole-windows-amd64.msi`, built by
123 `packaging/windows/vole.wxs`. It is compiled with
124 [wixl](https://wiki.gnome.org/msitools) rather than the WiX toolset: WiX refuses
125 to build an MSI anywhere but Windows (it canonicalizes every relative path
126 against `C:\`), and the release runs on a Linux runner. wixl implements the WiX
127 v3 schema, which is why the source is version 3. Its limits shape the package:
128 the MSI cannot preserve files across an uninstall, cannot edit `PATH`, and
129 cannot schedule rollback actions, so the configuration and the data directory
130 belong to `vole service install` instead of the package.
131
132 | Path | Purpose |
133 |---|---|
134 | `%ProgramFiles%\Vole\vole.exe` | Vole binary with the release version embedded |
135 | `%ProgramFiles%\Vole\LICENSE`, `NOTICE` | The same documents the Linux package installs |
136 | `%ProgramData%\Vole\vole.toml` | Configuration, written by `vole service install` when absent; not a package file |
137 | the configured `data_dir` | Repositories, databases, objects, logs, secrets, and host key; not a package file |
138
139 The MSI registers the `Vole` service by running the binary's own
140 `vole service install`, so the account, recovery actions, and command line are
141 the same for an MSI, `install.ps1`, and a hand-run install. The service runs as
142 the virtual account `NT SERVICE\Vole`, starts automatically with a short delay,
143 and restarts after a failure. The install prepares the data directory and the
144 configuration's access list for that account and starts the service; `uninstall`
145 stops and deletes the service before the files go, and leaves the configuration
146 and the instance data in place.
147
148 Upgrading is installing a newer MSI: wixl schedules the old product's removal
149 before the new files are copied, so the running service is stopped before its
150 executable would be locked. Pre-release tags have no MSI — an MSI version cannot
151 carry a pre-release suffix here, and wixl cannot express the same-version
152 upgrade that would let a release candidate and the final release share one — so
153 those releases publish the Windows binary only.
154
155 The MSI is not Authenticode-signed yet, so Windows shows an unknown-publisher
156 prompt. Verify the download against the GPG-signed `SHA256SUMS` instead. See
157 [Windows packaging](https://rodent.software/vole/n/408) for signing and winget.
158
159 The `git` account runs the forced command sshd hands it and has no access to
160 `/var/lib/vole`. If the machine already has a `git` account for another forge,
161 the package leaves it alone — including its shell — and says so at install time.
162 Create your own account for Vole, set `ssh_user` to it, and change the `Match`
163 line in your copy of the drop-in to name it.
164 Follow [Deploy a server](deploy/index.md) to configure the origin, create the
165 first admin, and start Vole. Follow [Set up a runner](deploy/runner.md) to
166 configure the separate runner unit.
167
168 Run local administration as the service user so new files retain the correct
169 ownership:
170
171 ```sh
172 sudo -u vole vole admin --config /etc/vole/vole.toml account list
173 ```
174
175 ## Service sandbox
176
177 The forge unit drops capabilities, sets `UMask=0027`, provides private temporary
178 and device trees, hides other processes, and makes `/var/lib/vole` its only
179 writable path. The front door adds one exception, `/run/vole`, for the socket
180 `sshd`'s forced command connects to; it needs no capability because `sshd` owns
181 port 22. `MemoryDenyWriteExecute=true` is appropriate because the forge
182 runs no JIT.
183
184 To bind HTTP port 80 or HTTPS port 443, add only `CAP_NET_BIND_SERVICE`:
185
186 ```ini
187 # /etc/systemd/system/vole.service.d/bind.conf
188 [Service]
189 CapabilityBoundingSet=CAP_NET_BIND_SERVICE
190 AmbientCapabilities=CAP_NET_BIND_SERVICE
191 ```
192
193 Run `systemctl daemon-reload` and restart Vole after creating that drop-in. Do
194 not run the forge as root or relax its unit for CI; the runner has a separate
195 unit and security model.
196
197 ## Upgrading
198
199 Database migrations run in place and cannot be rolled back by installing an
200 older binary. Back up and test recovery before upgrading:
201
202 ### 1. Back up the instance
203
204 Follow [Back up an instance](operations.md#back-up-an-instance), including
205 `instance.db`, the secrets key, repositories, objects, logs, and host keys.
206
207 ### 2. Install the new package
208
209 Install with `dpkg -i`, `apt install ./<package>`, `dnf install ./<package>`, or
210 `pacman -U ./<package>`. On a machine pointed at the channel repository, use the
211 package manager instead: `sudo apt update && sudo apt upgrade vole`,
212 `sudo dnf upgrade vole`, or `sudo pacman -Syu vole`. The new release is available
213 once the channel names it. A prerelease such as `0.1.0-rc2` is
214 `0.1.0rc2-1` in an Arch package, because Arch's package version cannot carry a
215 semver hyphen.
216
217 Upgrading also creates the `git` account and `/run/vole` the first time this
218 version is installed, whether or not you intend to use the front door. An existing
219 `git` account is left alone; the install says so, and `ssh_user` is how you point
220 Vole at an account of your own.
221
222 ### 3. Rename a pre-channel account database
223
224 If `data/` still holds `users.db`, this version reads `instance.db` and will
225 refuse to start rather than create an empty one beside it. Move the file and its
226 write-ahead sibling as described in
227 [Upgrade to the instance database](operations.md#upgrade-to-the-instance-database).
228 An instance installed from a package has no `data/channels.db`; only one tracking
229 `main` in the release-channel window can have that file.
230
231 ### 4. Restart the service
232
233 Restart it if the package manager did not:
234
235 ```sh
236 sudo systemctl restart vole
237 ```
238
239 ### 5. Verify the upgrade
240
241 Check `vole version`, the service log, account sign-in, an SSH clone, and CI
242 runner connectivity.
243
244 Upgrade the instance before its runners. See
245 [Set up a runner § Upgrade](deploy/runner.md#upgrade).
246
247 ## Next
248
249 - [Operations](operations.md) — back up and restore the installed state.
250 - [Deploy a server](deploy/index.md) — configure the packaged forge.
251 - [Install](install.md) — install a package or standalone binary.