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 12.0 KiB

Deploy on macOS

Pick a service

There are two ways to run vole serve on a Mac, and they have different limits.

LaunchAgent LaunchDaemon
Started by brew services start vole a plist you install in /Library/LaunchDaemons
Runs as your account as a service account (_vole)
On logout stops keeps running
Privileged ports (below 1024) no yes
Ships with the Homebrew formula’s service block not yet — install the plist below

Start with the LaunchAgent. It is one command, it runs as you, and its data is yours. Choose a LaunchDaemon when the forge must outlive your login session or bind a privileged port without running as root.

Install with Homebrew

The tap is hosted on the Rodent Software forge, not GitHub, so Homebrew has to be told the clone URL rather than guessing GitHub:

brew tap rodent-software/homebrew-tap https://rodent.software/homebrew-tap.git
brew install vole
vole version

The formula installs the vole binary and a LaunchAgent service:

brew services start vole
brew services stop vole
brew upgrade vole

A LaunchAgent serves on the default loopback addresses — HTTP on 127.0.0.1:8080 and SSH on 127.0.0.1:2222 — and stops when you log out. Put the system sshd in front of Vole for a portless clone URL, or a proxy in front of HTTP for TLS.

If git --version opens a dialog offering to install the command line tools, run xcode-select --install first. The dialog is a macOS shim, not Vole; the formula declares depends_on "git" and Homebrew installs Git itself.

Where things live

The Homebrew formula installs only the binary, so the instance state is yours to choose. The conventional layout matches the Linux package but under the Homebrew prefix, which is /opt/homebrew on Apple Silicon and /usr/local on Intel (brew --prefix prints it):

<prefix>/bin/vole                 the binary
<prefix>/etc/vole/vole.toml       your configuration
<prefix>/var/vole/                the instance: repositories, database, LFS

vole admin init --dir . also works in a plain directory, for a laptop forge that lives next to the repository it hosts. The prefix layout above is the choice to make when Vole is the machine’s service rather than one project’s tool.

Run as a LaunchDaemon

A LaunchAgent cannot bind a privileged port and dies with your session. For a machine-wide forge, install a LaunchDaemon that runs vole serve as a dedicated _vole account.

Create the service account and its data directory first. Pick an unused system UID — macOS service accounts live in the low hundreds; dscl . -list /Users UniqueID | sort -n -k2 shows what is taken. 350 is used here:

sudo dscl . -create /Users/_vole
sudo dscl . -create /Users/_vole UniqueID 350
sudo dscl . -create /Users/_vole PrimaryGroupID 20
sudo dscl . -create /Users/_vole RealName "Vole service"
uuid=$(uuidgen)
sudo dscl . -create /Users/_vole GeneratedUID "$uuid"
sudo dscl . -create /Users/_vole NFSHomeDirectory /var/vole
sudo dscl . -create /Users/_vole UserShell /usr/bin/false
sudo mkdir -p /var/vole
sudo chown _vole:staff /var/vole

dscl does not add the record to its group or set a password, which is what you want: _vole has no login shell, no password, and no home directory it can write outside /var/vole — launchd runs it directly without a login. It is the account vole serve runs as, so it owns the repositories, the database, and the SSH host key. The git account (created when you enable the sshd front door) reaches only the socket directory, not this data.

Install the plist at /Library/LaunchDaemons/software.rodent.vole.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>software.rodent.vole</string>
  <key>ProgramArguments</key>
  <array>
    <string>/opt/homebrew/bin/vole</string>
    <string>serve</string>
    <string>--config</string>
    <string>/opt/homebrew/etc/vole/vole.toml</string>
  </array>
  <key>UserName</key>
  <string>_vole</string>
  <key>GroupName</key>
  <string>staff</string>
  <key>WorkingDirectory</key>
  <string>/var/vole</string>
  <key>RunAtLoad</key>
  <true/>
  <key>KeepAlive</key>
  <true/>
  <key>StandardOutPath</key>
  <string>/var/log/vole.log</string>
  <key>StandardErrorPath</key>
  <string>/var/log/vole.log</string>
</dict>
</plist>

On an Intel Mac, /opt/homebrew/bin/vole is /usr/local/bin/vole; use brew --prefix to get the right value. Load it:

sudo cp software.rodent.vole.plist /Library/LaunchDaemons/
sudo launchctl bootstrap system /Library/LaunchDaemons/software.rodent.vole.plist
sudo launchctl kickstart -k system/software.rodent.vole

Stop and unload with sudo launchctl bootout system/software.rodent.vole.

Serve HTTPS with socket activation

ACME needs port 80 (HTTP-01) or 443 (TLS-ALPN-01), and macOS refuses ports below 1024 to a non-root process. The answer is socket activation: a LaunchDaemon owns 80 and 443 as root and hands the ready sockets to vole serve, which keeps running unprivileged. The same mechanism is systemd’s LISTEN_FDS, so one code path serves both operating systems.

serve reads LISTEN_FDS/LISTEN_PID (and launchd’s Listeners) at startup. When inherited descriptors are present it serves HTTP and HTTPS from them instead of binding http_addr/https_addr; when they are absent it binds exactly as a hand-run or containerized instance always has. The ACME cache, challenge handler, and certificate manager do not care which descriptor is underneath them.

Install the daemon that owns the sockets. share/launchd/software.rodent.vole.plist in the tap is a Sockets block for 80 and 443; copy it to /Library/LaunchDaemons/, set the _vole account, and load it:

sudo cp software.rodent.vole.plist /Library/LaunchDaemons/
sudo launchctl bootstrap system /Library/LaunchDaemons/software.rodent.vole.plist

With it loaded, vole.toml names the privileged ports and the daemon delivers them:

http_addr = ":80"
https_addr = ":443"
acme_email = "admin@example.com"
acme_domains = ["forge.example.com"]

vole serve never runs as root. A LaunchAgent cannot own a privileged socket, so brew services keeps serving the unprivileged loopback addresses; the daemon is the HTTPS path. The trade-offs that chose this arrangement over running as root or putting a terminator proxy in front are the three options worth naming: root gives up the unprivileged property, and a proxy contradicts one binary to operate.

What launchd does not give you

!!! warning “launchd has no service sandbox” The Linux package hardens vole.service with ProtectSystem=strict, PrivateTmp, PrivateDevices, NoNewPrivileges, and a RestrictAddressFamilies list. launchd has no equivalent. On a Mac the _vole account and its file modes are the boundary.

The Linux package hardens vole.service with systemd’s sandboxing: ProtectSystem=strict, PrivateTmp, PrivateDevices, NoNewPrivileges, and a RestrictAddressFamilies list. launchd has no equivalent for any of these. A macOS service is sandboxed by two things only:

  • the account it runs as (_vole, not root), and
  • file modes — vole sets a restrictive umask and writes its own secrets at 0600, but nothing stops the process from reading or writing whatever that account can reach.

There is no read-only root, no private /tmp, no capability drop, and no way to restrict the socket families the process can open. Treat the _vole account’s reach as the boundary, the same way the Linux package treats its capability set, and keep anything you do not want the forge to touch out of /var/vole and out of that account’s reach.

Put sshd in front of Vole (optional) {: #put-sshd-in-front-of-vole }

Vole’s own SSH listener answers on 2222, so every clone URL carries :2222. Letting the system sshd authenticate and hand the session to Vole removes the port and keeps one SSH endpoint on the host.

This page covers the full macOS deployment. The Match block is the same as on Linux; everything around it is not. The release still attaches vole-darwin-sshd.conf, but vole ssh-config renders the drop-in with the real binary and config paths, which is what a Homebrew install needs:

vole ssh-config --platform darwin > vole.conf
less vole.conf
sudo install -m 0644 vole.conf /etc/ssh/vole.conf

Render and inspect the file before installing it. The header carries the macOS steps; the --vole, --config, and --socket flags replace the defaults it names.

  1. Enable Remote Login and append one line at the end of /etc/ssh/sshd_config:

    sudo systemsetup -setremotelogin on
    echo 'Include /etc/ssh/vole.conf' | sudo tee -a /etc/ssh/sshd_config
    
  2. Check and reload sshd:

    sudo sshd -t && sudo launchctl kickstart -k system/com.openssh.sshd
    
  3. Install the shell wrapper and create the forced-command account. The account’s login shell has to exec exactly one thing, so a three-line wrapper hands off to vole ssh-shell. Put it where the drop-in names it, pointing at your prefix (/usr/local for a system install, /opt/homebrew for Homebrew on Apple Silicon):

    sudo mkdir -p /usr/local/lib/vole
    printf '#!/bin/sh\nexec /usr/local/bin/vole ssh-shell "$@"\n' | sudo tee /usr/local/lib/vole/ssh-shell
    sudo chmod 0755 /usr/local/lib/vole/ssh-shell
    sudo sysadminctl -addUser git -fullName "Vole git" -shell /usr/local/lib/vole/ssh-shell
    

    Then set the three settings in vole.toml and put ssh_socket where both accounts can reach it.

  4. Decide the socket directory’s group. macOS has no /run or tmpfiles, so the operator creates the shared directory. Use one shared group: create it, put the service account (_vole) and git in it, and make the directory _vole:git with setgid so the socket inherits the group:

    sudo dseditgroup -o create -r "Vole front door" vole
    sudo dseditgroup -o edit -a _vole -t user vole
    sudo dseditgroup -o edit -a git -t user vole
    sudo mkdir -p /usr/local/var/vole
    sudo chown _vole:git /usr/local/var/vole
    sudo chmod 2770 /usr/local/var/vole
    

    ssh_socket then names /usr/local/var/vole/ssh.sock, and the socket’s 0660 is reachable by both because setgid carries the shared group onto it. A single shared group is the simple answer; a vole/git pair adds nothing here because only these two accounts ever touch the socket.

  5. Restart Vole the way you started it.

AuthorizedKeysCommandUser is the account vole serve runs as. Start the service with the LaunchAgent or LaunchDaemon in Deploy Vole on macOS.

vole whoami returning your account name means sshd resolved your key to it and the forced command reached the service.

The port disappears from every remote the same way, because they all use the same SSH endpoint. A command that acts on a repository names it in the URL; vole admin and vole runner name only the instance:

vole whoami --role --remote ssh://forge.example.com/demo.git
vole secret list demo --remote ssh://forge.example.com/demo.git
vole change show 42 --remote ssh://forge.example.com/demo.git
vole run list --remote ssh://forge.example.com/demo.git
vole admin --remote ssh://forge.example.com account invite admin
vole runner --remote ssh://forge.example.com

Inside a clone, --remote origin is the shorter form of the repository ones.

A :2222 in an example elsewhere on this site belongs to Vole’s own listener; drop it for an instance whose sshd is the front door.

CI runners on macOS

Vole does not ship a macOS runner service. Run the runner on a separate Linux machine and point it at this instance; see Set up a runner on Linux.

Next