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>
33 lines
1.1 KiB
Bash
33 lines
1.1 KiB
Bash
#!/bin/bash
|
|
#
|
|
# Purpose : Keep secrets in your login keychain. Source this file; the
|
|
# scripts in system/ do too.
|
|
#
|
|
# Items the security tool makes can be read back by it without asking, so
|
|
# background jobs (backups) can use them while you're logged in.
|
|
|
|
# keychain_load <service> <account>
|
|
keychain_load() {
|
|
security find-generic-password -s "$1" -a "$2" -w 2> /dev/null
|
|
}
|
|
|
|
# keychain_save <service> <account> <secret>
|
|
# Saved through security's interactive mode, so the secret isn't in the
|
|
# process list (printf is a shell builtin). That mode splits on spaces and
|
|
# reads quotes, so only secrets without them are taken: Nextcloud's app
|
|
# passwords and the passphrases this makes.
|
|
keychain_save() {
|
|
if [[ ! "$3" =~ ^[A-Za-z0-9+/=._-]+$ ]]; then
|
|
echo "That secret has characters the keychain helper can't save." >&2
|
|
return 1
|
|
fi
|
|
printf 'add-generic-password -U -s "%s" -a "%s" -l "%s" -w "%s"\n' "$1" "$2" "$1 ($2)" "$3" \
|
|
| security -i > /dev/null 2>&1 \
|
|
&& [ "$(keychain_load "$1" "$2")" = "$3" ]
|
|
}
|
|
|
|
# keychain_delete <service> <account>
|
|
keychain_delete() {
|
|
security delete-generic-password -s "$1" -a "$2" > /dev/null 2>&1
|
|
}
|