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.

Document deploying Vole on macOS with launchd

75478a9d2f27a85658aed1bf693c48ff98810ca8 · Keenan Nemetz · 3d ago · parent 5a418459

Document deploying Vole on macOS with launchd

Add a dedicated macOS deployment page covering the LaunchAgent the Homebrew
formula installs, the LaunchDaemon variant and its _vole service account, the
prefix layout, and the sandboxing launchd does not provide. Cross-link it from
the Linux page and install guide, and fix the stale 'no Homebrew formula'
sentence.

docs/deploy/macos.md +171

@@ -0,0 +1,171 @@
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.
7
8 ## Pick a service
9
10 There are two ways to run `vole serve` on a Mac, and they have different limits.
11
12 | | LaunchAgent | LaunchDaemon |
13 |---|---|---|
14 | Started by | `brew services start vole` | a plist you install in `/Library/LaunchDaemons` |
15 | Runs | as your account | as a service account (`_vole`) |
16 | On logout | stops | keeps running |
17 | Privileged ports (below 1024) | no | yes |
18 | Ships with | the Homebrew formula's `service` block | not yet — install the plist below |
19
20 Start with the LaunchAgent. It is one command, it runs as you, and its data is
21 yours. Choose a LaunchDaemon when the forge must outlive your login session or
22 bind a privileged port without running as root.
23
24 ## Install with Homebrew
25
26 The tap is hosted on the Rodent Software forge, not GitHub, so Homebrew has to be
27 told the clone URL rather than guessing GitHub:
28
29 ```sh
30 brew tap rodent-software/homebrew-tap https://rodent.software/homebrew-tap.git
31 brew install vole
32 vole version
33 ```
34
35 The formula installs the `vole` binary and a LaunchAgent service:
36
37 ```sh
38 brew services start vole
39 brew services stop vole
40 brew upgrade vole
41 ```
42
43 A LaunchAgent serves on the default loopback addresses — HTTP on
44 `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
46 clone URL, or a proxy in front of HTTP for TLS.
47
48 If `git --version` opens a dialog offering to install the command line tools,
49 run `xcode-select --install` first. The dialog is a macOS shim, not Vole; the
50 formula declares `depends_on "git"` and Homebrew installs Git itself.
51
52 ## Where things live
53
54 The Homebrew formula installs only the binary, so the instance state is yours to
55 choose. The conventional layout matches the Linux package but under the Homebrew
56 prefix, which is `/opt/homebrew` on Apple Silicon and `/usr/local` on Intel
57 (`brew --prefix` prints it):
58
59 ```text
60 <prefix>/bin/vole the binary
61 <prefix>/etc/vole/vole.toml your configuration
62 <prefix>/var/vole/ the instance: repositories, database, LFS
63 ```
64
65 `vole admin init --dir .` also works in a plain directory, for a laptop forge that
66 lives next to the repository it hosts. The prefix layout above is the choice to
67 make when Vole is the machine's service rather than one project's tool.
68
69 ## Run as a LaunchDaemon
70
71 A LaunchAgent cannot bind a privileged port and dies with your session. For a
72 machine-wide forge, install a LaunchDaemon that runs `vole serve` as a dedicated
73 `_vole` account.
74
75 Create the service account and its data directory first. Pick an unused system
76 UID — macOS service accounts live in the low hundreds; `dscl . -list /Users
77 UniqueID | sort -n -k2` shows what is taken. `350` is used here:
78
79 ```sh
80 sudo dscl . -create /Users/_vole
81 sudo dscl . -create /Users/_vole UniqueID 350
82 sudo dscl . -create /Users/_vole PrimaryGroupID 20
83 sudo dscl . -create /Users/_vole RealName "Vole service"
84 uuid=$(uuidgen)
85 sudo dscl . -create /Users/_vole GeneratedUID "$uuid"
86 sudo dscl . -create /Users/_vole NFSHomeDirectory /var/vole
87 sudo dscl . -create /Users/_vole UserShell /usr/bin/false
88 sudo mkdir -p /var/vole
89 sudo chown _vole:staff /var/vole
90 ```
91
92 `dscl` does not add the record to its group or set a password, which is what you
93 want: `_vole` has no login shell, no password, and no home directory it can write
94 outside `/var/vole` — launchd runs it directly without a login. It is the account
95 `vole serve` runs as, so it owns the repositories, the database, and the SSH host
96 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
98 directory, not this data.
99
100 Install the plist at `/Library/LaunchDaemons/software.rodent.vole.plist`:
101
102 ```xml
103 <?xml version="1.0" encoding="UTF-8"?>
104 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
105 "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
106 <plist version="1.0">
107 <dict>
108 <key>Label</key>
109 <string>software.rodent.vole</string>
110 <key>ProgramArguments</key>
111 <array>
112 <string>/opt/homebrew/bin/vole</string>
113 <string>serve</string>
114 <string>--config</string>
115 <string>/opt/homebrew/etc/vole/vole.toml</string>
116 </array>
117 <key>UserName</key>
118 <string>_vole</string>
119 <key>GroupName</key>
120 <string>_vole</string>
121 <key>WorkingDirectory</key>
122 <string>/var/vole</string>
123 <key>RunAtLoad</key>
124 <true/>
125 <key>KeepAlive</key>
126 <true/>
127 <key>StandardOutPath</key>
128 <string>/var/log/vole.log</string>
129 <key>StandardErrorPath</key>
130 <string>/var/log/vole.log</string>
131 </dict>
132 </plist>
133 ```
134
135 On an Intel Mac, `/opt/homebrew/bin/vole` is `/usr/local/bin/vole`; use
136 `brew --prefix` to get the right value. Load it:
137
138 ```sh
139 sudo cp software.rodent.vole.plist /Library/LaunchDaemons/
140 sudo launchctl bootstrap system /Library/LaunchDaemons/software.rodent.vole.plist
141 sudo launchctl kickstart -k system/software.rodent.vole
142 ```
143
144 Stop and unload with `sudo launchctl bootout system/software.rodent.vole`.
145
146 ## What launchd does not give you
147
148 The Linux package hardens `vole.service` with systemd's sandboxing:
149 `ProtectSystem=strict`, `PrivateTmp`, `PrivateDevices`, `NoNewPrivileges`, and a
150 `RestrictAddressFamilies` list. launchd has **no equivalent** for any of these. A
151 macOS service is sandboxed by two things only:
152
153 - **the account it runs as** (`_vole`, not root), and
154 - **file modes** — `vole` sets a restrictive umask and writes its own secrets at
155 `0600`, but nothing stops the process from reading or writing whatever that
156 account can reach.
157
158 There is no read-only root, no private `/tmp`, no capability drop, and no way to
159 restrict the socket families the process can open. Treat the `_vole` account's
160 reach as the boundary, the same way the Linux package treats its capability set,
161 and keep anything you do not want the forge to touch out of `/var/vole` and out
162 of that account's reach.
163
164 ## Next
165
166 - [Put the system sshd in front of Vole](index.md#put-sshd-in-front-of-vole) —
167 the macOS drop-in and the portless clone URL.
168 - [Install on macOS](../install.md#install-on-macos) — the standalone-binary path
169 without Homebrew.
170 - [Configuration](../configuration.md) — `vole.toml` paths, listeners, and ACME.
171 - [Back up an instance](../operations.md#back-up-an-instance).