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/deploy/macos.md +115−15
| @@ -1,9 +1,4 @@ | |||
| 1 | # Deploy Vole on macOS | ||
| 2 | |||
| 3 | Install Vole on a Mac with Homebrew and run it under launchd. The same binary is | ||
| 4 | the server and the CLI, so the install only has to place one executable. What | ||
| 5 | differs from [the Linux deployment](index.md) is how the service starts, where it | ||
| 6 | lives, and what the operating system does and does not isolate for it. | ||
| 1 | # Deploy on macOS | ||
| 7 | 2 | ||
| 8 | 3 | ## Pick a service | |
| 9 | 4 | ||
| @@ -42,7 +37,7 @@ brew upgrade vole | |||
| 42 | 37 | ||
| 43 | 38 | A LaunchAgent serves on the default loopback addresses — HTTP on | |
| 44 | 39 | `127.0.0.1:8080` and SSH on `127.0.0.1:2222` — and stops when you log out. Put the | |
| 45 | [system sshd in front of Vole](index.md#put-sshd-in-front-of-vole) for a portless | ||
| 40 | [system sshd in front of Vole](#put-sshd-in-front-of-vole) for a portless | ||
| 46 | 41 | clone URL, or a proxy in front of HTTP for TLS. | |
| 47 | 42 | ||
| 48 | 43 | If `git --version` opens a dialog offering to install the command line tools, | |
| @@ -94,7 +89,7 @@ want: `_vole` has no login shell, no password, and no home directory it can writ | |||
| 94 | 89 | outside `/var/vole` — launchd runs it directly without a login. It is the account | |
| 95 | 90 | `vole serve` runs as, so it owns the repositories, the database, and the SSH host | |
| 96 | 91 | key. The `git` account (created when you enable the | |
| 97 | [sshd front door](index.md#put-sshd-in-front-of-vole)) reaches only the socket | ||
| 92 | [sshd front door](#put-sshd-in-front-of-vole)) reaches only the socket | ||
| 98 | 93 | directory, not this data. | |
| 99 | 94 | ||
| 100 | 95 | Install the plist at `/Library/LaunchDaemons/software.rodent.vole.plist`: | |
| @@ -117,7 +112,7 @@ Install the plist at `/Library/LaunchDaemons/software.rodent.vole.plist`: | |||
| 117 | 112 | <key>UserName</key> | |
| 118 | 113 | <string>_vole</string> | |
| 119 | 114 | <key>GroupName</key> | |
| 120 | <string>_vole</string> | ||
| 115 | <string>staff</string> | ||
| 121 | 116 | <key>WorkingDirectory</key> | |
| 122 | 117 | <string>/var/vole</string> | |
| 123 | 118 | <key>RunAtLoad</key> | |
| @@ -184,6 +179,12 @@ up the unprivileged property, and a proxy contradicts one binary to operate. | |||
| 184 | 179 | ||
| 185 | 180 | ## What launchd does not give you | |
| 186 | 181 | ||
| 182 | !!! warning "launchd has no service sandbox" | ||
| 183 | The Linux package hardens `vole.service` with `ProtectSystem=strict`, | ||
| 184 | `PrivateTmp`, `PrivateDevices`, `NoNewPrivileges`, and a | ||
| 185 | `RestrictAddressFamilies` list. launchd has no equivalent. On a Mac the | ||
| 186 | `_vole` account and its file modes are the boundary. | ||
| 187 | |||
| 187 | 188 | The Linux package hardens `vole.service` with systemd's sandboxing: | |
| 188 | 189 | `ProtectSystem=strict`, `PrivateTmp`, `PrivateDevices`, `NoNewPrivileges`, and a | |
| 189 | 190 | `RestrictAddressFamilies` list. launchd has **no equivalent** for any of these. A | |
| @@ -200,11 +201,110 @@ reach as the boundary, the same way the Linux package treats its capability set, | |||
| 200 | 201 | and keep anything you do not want the forge to touch out of `/var/vole` and out | |
| 201 | 202 | of that account's reach. | |
| 202 | 203 | ||
| 204 | ## Put sshd in front of Vole (optional) {: #put-sshd-in-front-of-vole } | ||
| 205 | |||
| 206 | Vole's own SSH listener answers on 2222, so every clone URL carries `:2222`. | ||
| 207 | Letting the system sshd authenticate and hand the session to Vole removes the | ||
| 208 | port and keeps one SSH endpoint on the host. | ||
| 209 | |||
| 210 | This page covers the full macOS deployment. The `Match` block is the same as on | ||
| 211 | Linux; everything around it is not. | ||
| 212 | The release still attaches `vole-darwin-sshd.conf`, but `vole ssh-config` renders | ||
| 213 | the drop-in with the real binary and config paths, which is what a Homebrew | ||
| 214 | install needs: | ||
| 215 | |||
| 216 | ```sh | ||
| 217 | vole ssh-config --platform darwin > vole.conf | ||
| 218 | less vole.conf | ||
| 219 | sudo install -m 0644 vole.conf /etc/ssh/vole.conf | ||
| 220 | ``` | ||
| 221 | |||
| 222 | Render and inspect the file before installing it. The header carries the macOS | ||
| 223 | steps; the `--vole`, `--config`, and `--socket` flags replace the defaults it | ||
| 224 | names. | ||
| 225 | |||
| 226 | 1. Enable Remote Login and append one line at the **end** of `/etc/ssh/sshd_config`: | ||
| 227 | |||
| 228 | ```sh | ||
| 229 | sudo systemsetup -setremotelogin on | ||
| 230 | echo 'Include /etc/ssh/vole.conf' | sudo tee -a /etc/ssh/sshd_config | ||
| 231 | ``` | ||
| 232 | |||
| 233 | 2. Check and reload sshd: | ||
| 234 | |||
| 235 | ```sh | ||
| 236 | sudo sshd -t && sudo launchctl kickstart -k system/com.openssh.sshd | ||
| 237 | ``` | ||
| 238 | |||
| 239 | 3. Install the shell wrapper and create the forced-command account. The account's | ||
| 240 | login shell has to exec exactly one thing, so a three-line wrapper hands off to | ||
| 241 | `vole ssh-shell`. Put it where the drop-in names it, pointing at your prefix | ||
| 242 | (`/usr/local` for a system install, `/opt/homebrew` for Homebrew on Apple | ||
| 243 | Silicon): | ||
| 244 | |||
| 245 | ```sh | ||
| 246 | sudo mkdir -p /usr/local/lib/vole | ||
| 247 | printf '#!/bin/sh\nexec /usr/local/bin/vole ssh-shell "$@"\n' | sudo tee /usr/local/lib/vole/ssh-shell | ||
| 248 | sudo chmod 0755 /usr/local/lib/vole/ssh-shell | ||
| 249 | sudo sysadminctl -addUser git -fullName "Vole git" -shell /usr/local/lib/vole/ssh-shell | ||
| 250 | ``` | ||
| 251 | |||
| 252 | Then set the three settings in `vole.toml` and put `ssh_socket` where both | ||
| 253 | accounts can reach it. | ||
| 254 | |||
| 255 | 4. Decide the socket directory's group. macOS has no `/run` or tmpfiles, so the | ||
| 256 | operator creates the shared directory. Use one shared group: create it, put | ||
| 257 | the service account (`_vole`) and `git` in it, and make the directory | ||
| 258 | `_vole:git` with setgid so the socket inherits the group: | ||
| 259 | |||
| 260 | ```sh | ||
| 261 | sudo dseditgroup -o create -r "Vole front door" vole | ||
| 262 | sudo dseditgroup -o edit -a _vole -t user vole | ||
| 263 | sudo dseditgroup -o edit -a git -t user vole | ||
| 264 | sudo mkdir -p /usr/local/var/vole | ||
| 265 | sudo chown _vole:git /usr/local/var/vole | ||
| 266 | sudo chmod 2770 /usr/local/var/vole | ||
| 267 | ``` | ||
| 268 | |||
| 269 | `ssh_socket` then names `/usr/local/var/vole/ssh.sock`, and the socket's `0660` | ||
| 270 | is reachable by both because setgid carries the shared group onto it. A single | ||
| 271 | shared group is the simple answer; a `vole`/`git` pair adds nothing here | ||
| 272 | because only these two accounts ever touch the socket. | ||
| 273 | |||
| 274 | 5. Restart Vole the way you started it. | ||
| 275 | |||
| 276 | `AuthorizedKeysCommandUser` is the account `vole serve` runs as. Start the | ||
| 277 | service with the LaunchAgent or LaunchDaemon in | ||
| 278 | [Deploy Vole on macOS](macos.md). | ||
| 279 | |||
| 280 | `vole whoami` returning your account name means sshd resolved your key to it and | ||
| 281 | the forced command reached the service. | ||
| 282 | |||
| 283 | The port disappears from every remote the same way, because they all use the same | ||
| 284 | SSH endpoint. A command that acts on a repository names it in the URL; | ||
| 285 | `vole admin` and `vole runner` name only the instance: | ||
| 286 | |||
| 287 | ```sh | ||
| 288 | vole whoami --role --remote ssh://forge.example.com/demo.git | ||
| 289 | vole secret list demo --remote ssh://forge.example.com/demo.git | ||
| 290 | vole change show 42 --remote ssh://forge.example.com/demo.git | ||
| 291 | vole run list --remote ssh://forge.example.com/demo.git | ||
| 292 | vole admin --remote ssh://forge.example.com account invite admin | ||
| 293 | vole runner --remote ssh://forge.example.com | ||
| 294 | ``` | ||
| 295 | |||
| 296 | Inside a clone, `--remote origin` is the shorter form of the repository ones. | ||
| 297 | |||
| 298 | A `:2222` in an example elsewhere on this site belongs to Vole's own listener; | ||
| 299 | drop it for an instance whose sshd is the front door. | ||
| 300 | |||
| 301 | ## CI runners on macOS | ||
| 302 | |||
| 303 | Vole does not ship a macOS runner service. Run the runner on a separate Linux | ||
| 304 | machine and point it at this instance; see [Set up a runner on Linux](linux.md#set-up-a-runner-on-linux). | ||
| 305 | |||
| 203 | 306 | ## Next | |
| 204 | 307 | ||
| 205 | - [Put the system sshd in front of Vole](index.md#put-sshd-in-front-of-vole) — | ||
| 206 | the macOS drop-in and the portless clone URL. | ||
| 207 | - [Install on macOS](../install.md#install-on-macos) — the standalone-binary path | ||
| 208 | without Homebrew. | ||
| 209 | - [Configuration](../configuration.md) — `vole.toml` paths, listeners, and ACME. | ||
| 210 | - [Back up an instance](../operations.md#back-up-an-instance). | ||
| 308 | - [Deploy on Windows](windows.md) — the MSI and Windows service. | ||
| 309 | - [Runners](../runner.md) — register a runner on a Linux host. | ||
| 310 | - [Configuration](../configuration.md) — the full `vole.toml` surface. | ||