Set up a Mac for a Federated Core, like CoreDesktop's configure

A macOS counterpart of CoreDesktop's configure, with the same drop-in
items in configure.d/:

- core: Mail, Calendar and Contacts through a configuration profile,
  Superpanel as an app, Nextcloud files through the Nextcloud app, and
  Element; with test-and-fix, password change and removal
- tailscale: join the Core's network through headscale
- backup: restic to Nextcloud through rclone, run by launchd through an
  app that can be given Full Disk Access
- storage: SMB shares mounted the way Finder does, again at login and
  on network changes
- agents, claude, opencode, hermes, sandbox: install the agents and run
  them in Anthropic's sandbox runtime (Seatbelt on macOS)
- ai-servers: LLM servers on this Mac or the network, for the agents

Apps and tools macOS lacks are offered for download, checked against
their makers' Team IDs and notarization, or published SHA-256 sums.
Everything runs on macOS' bash 3.2 with only built-in tools.

smoketest/ runs scenarios in fresh macOS VMs with Tart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-11 08:34:42 -07:00
co-authored by Claude Opus 5.5
commit 08e6b2ee4f
45 changed files with 4517 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
# shellcheck shell=bash
DESCRIPTION="JSON through JavaScript for Automation, and secrets in the login keychain"
TIER=quick
source "$CONNECTOR/configure.d/lib/json.sh"
source "$CONNECTOR/configure.d/lib/keychain.sh"
scenario() {
local file="$TMPDIR/smoke.json" pass
check_eq "json_get reads a value" abc123 \
"$(echo '{"ocs":{"data":{"apppassword":"abc123"}}}' | json_get 'd.ocs.data.apppassword')"
check_not "json_get fails on false" bash -c "source '$CONNECTOR/configure.d/lib/json.sh'; echo '{\"m\":false}' | json_get d.m"
check_not "json_get fails on bad JSON" bash -c "source '$CONNECTOR/configure.d/lib/json.sh'; echo nope | json_get d.m"
check_eq "json_get passes arguments as a[]" true \
"$(echo '{"x":"a b"}' | json_get 'd.x === a[0]' 'a b')"
rm -f "$file"
check "json_edit makes a file" json_edit "$file" 'd.k = {"m.x": a[0]};' 'v"1'
check_eq "json_edit wrote it" 'v"1' "$(json_get 'd.k["m.x"]' < "$file")"
check "json_edit changes it" json_edit "$file" 'd.n = 2;'
check_eq "json_edit kept what was there" 'v"1' "$(json_get 'd.k["m.x"]' < "$file")"
echo 'not json' > "$file"
check_not "json_edit leaves bad JSON alone" json_edit "$file" 'd.n = 3;'
check_eq "...and doesn't change it" 'not json' "$(cat "$file")"
pass="$(openssl rand -base64 24)"
check "keychain_save" keychain_save federated-smoke test "$pass"
check_eq "keychain_load" "$pass" "$(keychain_load federated-smoke test)"
check "keychain_save replaces" keychain_save federated-smoke test abc
check_eq "keychain_load gets the new one" abc "$(keychain_load federated-smoke test)"
check_not "keychain_save refuses a secret with spaces or quotes" keychain_save federated-smoke bad 'a b"c'
check "keychain_delete" keychain_delete federated-smoke test
check_eq "it's gone" "" "$(keychain_load federated-smoke test)"
}