Add an installer and update command

curl -fsSL https://federated.sh/mac | bash

install.sh checks the Mac (macOS 13+, not root, internet; warns if the
account isn't an administrator), then downloads the latest commit as an
archive from Gitea, as macOS has no git without the Command Line Tools.
It installs into ~/.local/share/federated-connector/connector, links
configure and update into ~/.local/bin and puts that on PATH at the top
of ~/.zprofile and ~/.bash_profile, then offers to run configure. Piped
into bash, it runs only once read in full, and asks from /dev/tty.

The folder never moves, so the backup and storage jobs and the Federated
Backup app (with its Full Disk Access) keep pointing at it. update shows
the commits since the installed one and swaps the new files in with two
renames.

If configure ran from another folder before, the installer says what
still runs from there; backup and storage now show as to do until
they're set up again from the installed copy.

smoketest: 05-install pipes install.sh into bash with the working copy,
runs update, then installs the published version from Gitea.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-11 09:21:17 -07:00
co-authored by Claude Opus 5.5
parent 8e2a886215
commit f92dbcb3bd
8 changed files with 398 additions and 13 deletions
+39 -8
View File
@@ -7,15 +7,45 @@ Sets up a Mac for your Federated Core, using the apps macOS comes with: Mail, Ca
- macOS 13 (Ventura) or later, on Apple silicon or Intel.
- Nothing else. It runs with the bash macOS comes with and only uses tools that are part of macOS. It doesn't need Homebrew, jq, python or the Command Line Tools.
## Installing
In Terminal:
```
curl -fsSL https://federated.sh/mac | bash
```
federated.sh/mac sends curl to [install.sh](install.sh) here on Gitea, so you can read what it runs first. In a browser, it opens this page.
It checks the Mac first: macOS 13 or later, not run as root, and an internet connection. It also warns if your account isn't an administrator, as some apps need your Mac password to install. Then it:
- downloads the latest version into `~/.local/share/federated-connector/connector`
- adds the `configure` and `update` commands to `~/.local/bin`
- adds `~/.local/bin` to your PATH, at the top of `~/.zprofile` and `~/.bash_profile`
- offers to run `configure`
It doesn't need git, which macOS doesn't have without the Command Line Tools. Running it again reinstalls the latest version. The log is in `~/Library/Logs/Federated Connector/`.
The install's folder never moves. That matters because the backup and network storage jobs, and the Federated Backup app you give Full Disk Access, point into it.
## Running it
```
./configure # show what's set up and choose what to set up
./configure core # set up one item
./configure --list # show what's set up, and the item names
configure # show what's set up and choose what to set up
configure core # set up one item
configure --list # show what's set up, and the item names
```
To run it as just `configure`, link it into a directory on your PATH, e.g. `ln -s "$PWD/configure" /usr/local/bin/configure`.
## Updating
```
update # get the latest version, showing what changed
update --version # the version installed
```
`update` downloads the latest version and swaps it in at once, so it's safe while backups run. Your settings, the profiles, keychain items and downloaded tools stay as they are, and the Federated Backup app keeps its Full Disk Access.
If you ran `configure` from a downloaded folder before installing, the installer tells you what still runs from there. Run `configure` again: backup, storage and agents show as to do until they've moved. Backups then need Full Disk Access again, as the app is made anew.
## What it sets up
@@ -67,7 +97,7 @@ To allow more, put a file in the same format as `sandbox/config/base.json` in `~
To see the backups and get files back:
```
source system/backup-env.sh
source ~/.local/share/federated-connector/connector/system/backup-env.sh
restic snapshots
restic restore latest --target ~/restored --include ~/Documents
```
@@ -75,7 +105,7 @@ restic restore latest --target ~/restored --include ~/Documents
On a new Mac, run `configure core` and `configure backup` first. Then name the old Mac's folder, and restic asks for the passphrase you saved:
```
source system/backup-env.sh .backup-{old Mac's name}
source ~/.local/share/federated-connector/connector/system/backup-env.sh .backup-{old Mac's name}
restic snapshots
```
@@ -109,7 +139,8 @@ The agents are installed with their makers' own installers: claude.ai/install.sh
- Your answers: `~/Library/Application Support/Federated Connector/` (`cores/<domain>.conf`, `core.conf` for the main Core, `tailscale.conf`, `backup.conf`, `storage`, `ai-servers`, and your own `sandbox/` config)
- App passwords and the backup passphrase: login keychain, services "Federated Connector" and "federated-connector-backup"
- Background jobs: `~/Library/LaunchAgents/computer.federated.connector.{backup,storage}.plist`
- Downloaded tools: `~/.local/share/federated-connector`
- Federated Connector itself: `~/.local/share/federated-connector/connector`, with `configure` and `update` linked in `~/.local/bin`
- Downloaded tools: `~/.local/share/federated-connector` (`bin`, `node`, `srt`)
- The accounts: System Settings > Privacy & Security > Profiles (General > Device Management on some versions)
## Adding an item
@@ -132,7 +163,7 @@ Keep to bash 3.2: no `mapfile`, `read -i`, associative arrays or `${var,,}`.
## Testing
`smoketest/run` runs the scenarios in `smoketest/`, each in a fresh macOS VM, with Tart on an Apple silicon Mac. See [smoketest/README.md](smoketest/README.md).
`smoketest/run` (with `05-install` for the installer) runs the scenarios in `smoketest/`, each in a fresh macOS VM, with Tart on an Apple silicon Mac. See [smoketest/README.md](smoketest/README.md).
## Differences from CoreDesktop