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
+57
View File
@@ -0,0 +1,57 @@
# shellcheck shell=bash
DESCRIPTION="Downloads Element, Nextcloud and Tailscale with Gatekeeper on: Team IDs, notarization, refusals"
TIER=all
source "$CONNECTOR/configure.d/lib/json.sh"
source "$CONNECTOR/configure.d/lib/apps.sh"
gatekeeper_on() {
spctl --status | grep -q 'assessments enabled'
}
# An app no one notarized: Gatekeeper should turn it down
unnotarized_refused() {
local app="$TMPDIR/Unnotarized.app"
rm -rf "$app"
osacompile -o "$app" -e 'return' && codesign --force --sign - "$app" > /dev/null 2>&1 || return 2
! spctl --assess --type execute "$app" 2> /dev/null
}
# Tailscale's package, offered as someone else's
wrong_team_refused() {
local pkg="$TMPDIR/tailscale.pkg"
app_info tailscale
curl -fsL --max-time 600 -o "$pkg" "$APP_URL" || return 2
APP_TEAM=ZZZZZZZZZZ
! install_pkg "$pkg"
}
team_of() {
codesign -dv "$(app_path "$1")" 2>&1 | sed -n 's/^TeamIdentifier=//p'
}
nextcloud_opens() {
open -a "$(app_path nextcloud)" --args --overrideserverurl https://nextcloud.smoke.invalid
sleep 10
pgrep -x Nextcloud > /dev/null
}
scenario() {
local app
# The vanilla image turns Gatekeeper off; a real Mac has it on
sudo spctl --global-enable 2> /dev/null || sudo spctl --master-enable 2> /dev/null
check "Gatekeeper is on" gatekeeper_on
gatekeeper_on || { skip "Gatekeeper couldn't be turned on, so the checks below prove less"; }
check "Gatekeeper turns down an app no one notarized" unnotarized_refused
check "install_pkg refuses a package signed by another Team ID" wrong_team_refused
for app in element nextcloud tailscale; do
step "$app"
check "app_install $app (its Team ID and notarization check out)" app_install "$app"
app_info "$app"
check_eq "$app's Team ID is the one in apps.sh" "$APP_TEAM" "$(team_of "$app")"
done
check "Nextcloud opens with the Core's address" nextcloud_opens
pkill -x Nextcloud 2> /dev/null
skip "Tailscale's VPN approval and Nextcloud's sign-in need clicks: check those by hand"
}