Administer On macOS
Run the macOS service day to day - launchd, logs, CLI access for other users, the bundled database, configuration and provisioning.
The macOS service is four LaunchDaemons in the system domain, all running as the hidden _vaulthalla account. This page covers the day-to-day operations: controlling the daemons, reading logs, giving other local users CLI access, the bundled database, configuration, and the provisioning tool that keeps all of it in shape.
Control The Daemons
| Label | What it is |
|---|---|
sh.vaulthalla.postgres |
Bundled PostgreSQL |
sh.vaulthalla.server |
Vaulthalla daemon |
sh.vaulthalla.web |
Web console |
sh.vaulthalla.caddy |
HTTPS front end (after vh setup caddy) |
1sudo launchctl print system/sh.vaulthalla.server # state, pid, last exit code2sudo launchctl kickstart -k system/sh.vaulthalla.server # restart3sudo launchctl bootout system/sh.vaulthalla.server # stop (and unload until the next bootstrap)4sudo launchctl bootstrap system /Library/LaunchDaemons/sh.vaulthalla.server.plist # start again
The daemons start at boot, before anyone logs in, and keep running across logouts. launchd restarts the server whenever it exits with an error (at most every 10 seconds) and keeps the web console, PostgreSQL and Caddy running whatever their exit status. The server tolerates a database that is not up yet: it exits and launchd retries until PostgreSQL answers.
Stopping the server gives it 30 seconds to shut down cleanly before launchd stops it hard; it normally takes about a second.
Logs
| File | Contents |
|---|---|
/Library/Logs/Vaulthalla/vaulthalla.log |
The daemon's own log (runtime, storage, sync, auth, audit). |
/Library/Logs/Vaulthalla/server.log |
The daemon's standard output and errors, including start-up failures. |
/Library/Logs/Vaulthalla/web.log |
The web console. |
/Library/Logs/Vaulthalla/postgres.log |
The bundled PostgreSQL. |
/Library/Logs/Vaulthalla/caddy.log |
Caddy (warnings and errors only). |
The files are private to _vaulthalla, so reading them takes sudo:
1sudo tail -n 50 /Library/Logs/Vaulthalla/vaulthalla.log2sudo tail -f /Library/Logs/Vaulthalla/server.log
CLI Access
vh talks to the daemon over /Library/Application Support/Vaulthalla/run/cli.sock. Only members of the _vaulthalla group (and root) can open it, and each member is mapped to a Vaulthalla user by uid.
The person who installed the package is already enrolled and bound to the built-in admin account. To give another local user CLI access:
Enroll them in the group
1sudo dseditgroup -o edit -a alice -t user _vaulthallaMembership takes effect immediately. If
vhstill reports permission denied, runsudo dscacheutil -flushcache.Map them to a Vaulthalla user
As an administrator, create (or update) a Vaulthalla user with their uid:
1vh user create alice --role unprivileged --linux-uid "$(id -u alice)"2vh user set alice --linux-uid "$(id -u alice)" # for an existing userThe option is named
--linux-uidon every platform; on macOS it takes the macOS uid.Grant access
Give them roles on the vaults they should reach: see Users, Groups And Roles.
To revoke CLI access, remove them from the group (sudo dseditgroup -o edit -d alice -t user _vaulthalla) or clear their mapping. A local account that is not in the group is refused at the socket before any Vaulthalla check runs.
admin is bound to the uid of the user who installed the package, unless someone was already bound. To check which account holds it, run vh setup assign-admin as that user: it reports whether the binding is new or already in place, and refuses to rebind to another account.
Configuration
The configuration file is /Library/Application Support/Vaulthalla/config.yaml, owned by root and readable by _vaulthalla (mode 0640). The keys are the same as on Linux: see Configuration. After editing it, restart the server:
1sudo "${EDITOR:-nano}" "/Library/Application Support/Vaulthalla/config.yaml"2sudo launchctl kickstart -k system/sh.vaulthalla.server
Installs and upgrades never replace an edited config. A config that is still byte-for-byte the shipped template is treated as never configured and is pointed at the bundled database.
The Bundled Database
The package's PostgreSQL 16 cluster lives in /Library/Application Support/Vaulthalla/postgres. It listens on 127.0.0.1:36971 (password authentication, used by the daemon) and on a socket inside that directory (peer authentication for _vaulthalla, used for administration). No other local user can reach the socket.
1PG=/usr/local/libexec/vaulthalla/postgresql/bin2SOCK="/Library/Application Support/Vaulthalla/postgres"3sudo -u _vaulthalla "$PG/pg_isready" -h "$SOCK" -p 369714sudo -u _vaulthalla "$PG/psql" -h "$SOCK" -p 36971 -d vaulthalla5sudo -u _vaulthalla "$PG/pg_dump" -h "$SOCK" -p 36971 -Fc vaulthalla > vaulthalla-db.dump
The daemon's database password was generated at install time and handed over through run/db_password, which the daemon sealed and removed on its first start. Pointing macOS at a remote PostgreSQL is not automated (vh setup remote-db is a Linux command).
Provisioning
vaulthalla-provision sets up and repairs everything outside the program files: the account, directories, database, configuration and LaunchDaemons. The installer runs it; you can run it to check or repair an install. Without options it only prints what it would change.
1P=/usr/local/lib/vaulthalla/vaulthalla-provision2sudo "$P" # plan: what would change (nothing, on a healthy install)3sudo "$P" --apply # make it so4sudo "$P" --apply --enroll alice # also enroll alice for vh (and bind admin if nobody holds it)5sudo "$P" --remove # stop and remove the LaunchDaemons; data and account stay
It refuses rather than repairs anything that doesn't look like its own: a _vaulthalla account with different settings, a symlinked or foreign-owned directory, a non-empty database directory that isn't a cluster. --remove --purge additionally deletes the data and the account, after checking that nothing is mounted under the directories; prefer the uninstaller, which also removes the program files.
Disk Encryption And Key Protection
Master keys (the vault master key, the database password, API-key and gateway secrets) are sealed with the Mac's Secure Enclave, and vh status reports secrets backend: secure-enclave. The daemon creates the keys itself on its first start under launchd, and only the daemon can use them: not sudo, a login session or a copy of the server started by hand, even as root. The sealed blobs in the state directory open only on this Mac, so export vault keys and internal secrets to a GPG recipient for recovery: see Encryption and macOS Key Recovery.
Upgrades keep the keys. An install from before the Secure Enclave backend had its keys in 0600 files; the first start of the new version moves each into the Secure Enclave and deletes the file.
If the Secure Enclave can't be used (the daemon tries a throwaway key at startup; some virtual machines refuse it), the daemon falls back to the file backend and says so in its log and in vh status (secrets backend: file (development: no hardware binding)): the keys are then plain files protected only by the state directory's permissions and FileVault.
Keep FileVault on either way: vault data and the database are on the same disk.
Restarts And FileVault
The keys are available from the first unlock after a boot, before anyone logs in. What starts the daemon depends on FileVault:
-
FileVault on, cold boot or plain restart: the Mac stops at the FileVault login screen with the disk still locked, so no daemon runs, Vaulthalla included, until someone logs in or unlocks the disk. This is how FileVault works, not a Vaulthalla failure.
-
FileVault on, unattended restart: restart with
1sudo fdesetup authrestartIt unlocks the disk once on the way back up. The Mac comes back to the login window, and launchd starts Vaulthalla there, before anyone logs in. Use it for updates and maintenance on a headless Mac. (
fdesetup authrestart -delayminutes -1arms it for the next restart instead, for example one an update triggers.) -
FileVault off: the daemon starts at every boot. The keys are still sealed by the Secure Enclave, but the vault data and the database on disk are not encrypted at rest.
After any restart, vh status from an enrolled user confirms the daemon unsealed its keys.
Isolated Development Instance
Contributors can install a development build beside the packaged service with make dev. It uses its own account (_vaulthalla_dev), paths (…/Vaulthalla-dev), LaunchDaemons (sh.vaulthalla.dev.*), database and ports (+100), and a vh-dev CLI, so it never touches the production install. See Development Setup.
