carlos / platform Public

Devbox mode on macOS: peer identity and launchd Feature Request open

Why

One of our two shared devboxes runs macOS. Devbox mode (merged as 2c66e56) can't run there:

  • Caller identity. internal/devbox/peer_other.go returns ErrUnsupported, so the registrar refuses every request on a non-Linux system. That's by design: it fails closed.
  • The service definition. infra/devbox/carlos-devbox.service is a systemd unit.
  • Port 443. On Linux, binding 443 as a non-root user comes from CAP_NET_BIND_SERVICE.

Work

  1. Peer identity on darwin. PeerUID uses unix.GetsockoptXucred (LOCAL_PEERCRED) or getpeereid, keeping the rule that a connection with no identity is refused. Add a darwin socket attribution test, mirroring TestSocketCallerIdentity.
  2. A launchd plist in infra/devbox/, running carlos devbox serve as a dedicated non-admin user, with the same env file contract. Plus a macOS section in the runbook. That prose goes through copy review.
  3. Binding 443 without root. Check on the machine whether macOS lets a non-root user bind 443 on a specific (tailnet) address. If not, choose between a high port and a root-owned launchd socket handed to the service. Record the finding.

Out of scope: the full platform box layer (instances, isolation, deploys). It depends on systemd, cgroups and namespaces, and stays Linux-only. #487 (per-app dev instances) therefore needs a Linux devbox.

Each devbox gets its own wildcard name and its own DNS key, scoped to its own _acme-challenge record. The names are in #474.

LLM

Devbox mode (#474) is Linux-only: SOPEERCRED, a systemd unit, CAPNETBINDSERVICE. Port the registrar's caller identity to macOS (getpeereid), add a launchd plist, and settle binding 443 without root, so a macOS devbox can serve live and folder links.

launchd socket activation for :443 (Paul's ruling), LOCAL_PEERCRED, serve --env-file (refuses ACLs, FIFOs and open modes), the LaunchDaemon plist and a macOS runbook. Astra reviewed the whole branch and all its findings are fixed. Darwin tests passed on tito-studio. DNS *.tito-studio.dev.platform.tito.io and the challenge-only IAM user carlos-devbox-acme-tito-studio (no key yet) are in place.

LLM

MERGED to main as 90c4d3a (not released). Next: release, then install on the macOS devbox from infra/devbox/README.md.

LLM

Not in v0.33.1 (cut from 11c8c864). Rides the next normal release (Paul: no special cut). The tito-studio install waits for it.

Installed and working on the macOS devbox:

  • the v0.33.4 darwin-arm64 binary, _carlos-devbox (uid 451), and the launchd plist on 100.76.110.54:443;
  • the wildcard *.tito-studio.dev.platform.tito.io, issued by Let's Encrypt (YE1) at 18:46Z and valid until 2027-01-30;
  • smoke checks: a live link answers end to end, list attributes the owner correctly through LOCAL_PEERCRED, an unknown name gives 404, and unshare works.

Findings:

  1. tailscale serve on :443 wins on macOS. The Tailscale Mac app intercepts tailnet traffic to a port it serves before the socket ever sees it. tito-studio had a serve entry on :443 (→127.0.0.1:7181), so handshakes failed with alert 80 even though our listener was up and had its certificate. Paul moved that entry to :17181. The runbook's macOS section should tell installers to check tailscale serve status for :443 first, and that wording needs copy review.
  2. The carlos on PATH can be an older Homebrew build without devbox. Run brew upgrade carlos, or use /usr/local/bin/carlos.

The one-time key mint and the install scripts for this box are in ~/.cache/devbox-install on docs-t1.

LLM

LIVE on tito-studio (v0.33.4, 2026-11-01): launchd :443 hand-off, wildcard cert, live link end to end. Two install findings.