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.

Ship the front door without installing it

09610c0f2f7abc5c729973a6a8680d25ed41571f · Keenan Nemetz · 16d ago · parent c5f2c5d4

Ship the front door without installing it

The front door works, but nothing puts it on a machine. This adds the account,
the login shell, the socket directory, the sshd drop-in, and the two deployment
templates, and it leaves every one of them opt-in.

The drop-in is rendered, not written twice. internal/sshdconfig produces the
whole file, the package ships the output for the default account and paths, and a
test compares the two, so the Match block, the account, the binary and the config
path cannot drift from what ssh-authorized-keys is given. The file is shipped at
/usr/share/vole/sshd/vole.conf and never installed: putting a Match block in
somebody's sshd is their decision, and the header says where it must go — appended
last, because everything after a Match block applies only to that match.

The account's shell is a wrapper, /usr/lib/vole/ssh-shell, because ssh_user is an
account name and a shell is a path. It execs `vole ssh-shell` with its arguments
untouched; sshd runs a forced command through the login shell, so that subcommand
has to be reachable from an account whose pw_shell cannot hold a command line.

postinstall creates git:git with no access to /var/lib/vole, creates /run/vole as
vole:git 2770, and adds vole to the group. An existing `git` account is left
exactly as it is, shell included: taking it over would break whatever forge put
it there, and the install says so and points at ssh_user. The setgid bit on
/run/vole is what gives the socket the group both sides share, and the unit gets
ReadWritePaths=/run/vole because ProtectSystem=strict would otherwise make /run
read-only — the front door needs no capability, since sshd owns 22.

The cloud-init templates take SSH_PORT, defaulting to 2222. With 2222 they render
exactly what they rendered before. With 22 they name no port at all: the runner's
--remote, its ssh-keyscan, the forge's ssh_addr and its final clone URL all switch,
and check-deploy renders both flavours and fails if anything still says 2222. The
forge templates also carry the commented front-door block, and packaging/vole.toml
documents the four settings.

check-deploy now also parses the four packaging files after one account name, and
`sh -n`s the postinstall and the shell wrapper: both run as root or as a login
shell, where a syntax error is found at the worst possible moment.

The documentation and migration are #307.

docs/packaging.md +17−3

@@ -15,6 +15,9 @@ installation, see [Install](install.md).
15 15 | `/etc/vole/runner.env` | Runner arguments, preserved as a conffile |
16 16 | `/etc/containers/registries.conf.d/50-vole-runner.conf` | Short-name registry resolution for rootless Podman |
17 17 | `/etc/containers/containers.conf.d/50-vole-runner.conf` | `cgroupfs` configuration for the system runner unit |
18 | `/usr/share/vole/sshd/vole.conf` | sshd drop-in for the front door; shipped, never installed |
19 | `/usr/lib/vole/ssh-shell` | Login shell of the `git` account: runs one command, refuses the rest |
20 | `/usr/lib/tmpfiles.d/vole.conf` | Creates `/run/vole` as `vole:git` mode `2770` at boot |
18 21 | `/usr/share/doc/vole/` | `LICENSE` and `NOTICE` |
19 22 | `/var/lib/vole/data` | Repositories, databases, objects, logs, secrets, and host key |
20 23
@@ -23,8 +26,17 @@ Ubuntu, or `sqlite-libs` on Fedora, RHEL, and Rocky. The standalone binary has
23 26 the same runtime requirements; see
24 27 [Install a release binary](install.md#install-a-release-binary).
25 28
26 Installation creates the `vole` service account and initializes the data
27 directory. It does not create an instance admin or enable the forge service.
29 Installation creates the `vole` service account, creates a `git` account for the
30 SSH front door, and initializes the data directory. It does not create an
31 instance admin, enable the forge service, or touch `/etc/ssh`: putting sshd in
32 front of Vole is a change to your sshd, so the drop-in is shipped and not
33 installed. `/usr/share/vole/sshd/vole.conf` opens with the four steps.
34
35 The `git` account runs the forced command sshd hands it and has no access to
36 `/var/lib/vole`. If the machine already has a `git` account for another forge,
37 the package leaves it alone — including its shell — and says so at install time.
38 Create your own account for Vole, set `ssh_user` to it, and change the `Match`
39 line in your copy of the drop-in to name it.
28 40 Follow [Deploy a server](deploy/index.md) to configure the origin, create the
29 41 first admin, and start Vole. Follow [Set up a runner](deploy/runner.md) to
30 42 configure the separate runner unit.
@@ -40,7 +52,9 @@ sudo -u vole vole admin --config /etc/vole/vole.toml account list
40 52
41 53 The forge unit drops capabilities, sets `UMask=0027`, provides private temporary
42 54 and device trees, hides other processes, and makes `/var/lib/vole` its only
43 writable path. `MemoryDenyWriteExecute=true` is appropriate because the forge
55 writable path. The front door adds one exception, `/run/vole`, for the socket
56 `sshd`'s forced command connects to; it needs no capability because `sshd` owns
57 port 22. `MemoryDenyWriteExecute=true` is appropriate because the forge
44 58 runs no JIT.
45 59
46 60 To bind HTTP port 80 or HTTPS port 443, add only `CAP_NET_BIND_SERVICE`: