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 an sshd drop-in for each platform instead of rendering one at runtime

883ffcc941bdeb32f0587cf0574b0cfbdcd33695 · Keenan Nemetz · 12d ago · parent a4a6d1e9

Ship an sshd drop-in for each platform instead of rendering one at runtime

The drop-in was Linux-only prose: systemctl, useradd, /usr/lib/vole/ssh-shell,
/usr/bin/vole, /etc/vole/vole.toml. The Match block works on macOS, but every
operation around it differs — there is no sshd_config.d, reload is launchctl,
accounts come from sysadminctl, and the binary and config live wherever the
install put them. The only copy was rendered at build time from one fixed set of
paths, so a Mac had nothing to install.

Render two files from the same function instead: vole-linux.conf, which the
package still installs as /usr/share/vole/sshd/vole.conf, and vole-darwin.conf,
which the release publishes as vole-darwin-sshd.conf. The -update test rewrites
both and compares both, and Linux sshd parses the macOS file too because the
directives are identical and only the comments differ.

Options gain the platform, the destination the Include line names, the account
sshd runs AuthorizedKeysCommand as, the forced-command account's shell, and the
socket path. The header branches on platform; the Match block does not. The macOS
file names /usr/local paths and says so, with the one-line substitution a
Homebrew prefix needs.

check-deploy.py and nfpm.yaml follow the renamed Linux file; the package still
installs it as vole.conf, so nothing on a Debian host changes. The front-door
page gains the macOS steps, including that ssh_socket must be a directory both
accounts can reach.

Closes: 01M7ZVF5NWM5S9SV5AD00KFGC7

scripts/check-deploy.py +4−4

@@ -377,7 +377,7 @@ def check_front_door_package():
377 377 where = "packaging/nfpm.yaml"
378 378 package = read("packaging/nfpm.yaml")
379 379 for src, dst in (
380 ("packaging/sshd/vole.conf", "/usr/share/vole/sshd/vole.conf"),
380 ("packaging/sshd/vole-linux.conf", "/usr/share/vole/sshd/vole.conf"),
381 381 ("packaging/sshd/ssh-shell", "/usr/lib/vole/ssh-shell"),
382 382 ("packaging/systemd/vole.tmpfiles", "/usr/lib/tmpfiles.d/vole.conf"),
383 383 ):
@@ -414,12 +414,12 @@ def check_front_door_package():
414 414 if needed not in unit:
415 415 bad |= fail(f"the unit does not set {needed}", "packaging/systemd/vole.service")
416 416
417 dropin = read("packaging/sshd/vole.conf")
417 dropin = read("packaging/sshd/vole-linux.conf")
418 418 if f"Match User {account}" not in dropin:
419 419 bad |= fail(f"the drop-in does not match the account {account} the package creates",
420 "packaging/sshd/vole.conf")
420 "packaging/sshd/vole-linux.conf")
421 421 if "AuthorizedKeysCommandUser vole" not in dropin:
422 bad |= fail("the drop-in runs the auth command as the wrong account", "packaging/sshd/vole.conf")
422 bad |= fail("the drop-in runs the auth command as the wrong account", "packaging/sshd/vole-linux.conf")
423 423 return bad
424 424
425 425