Commit Graph

2 Commits

Author SHA1 Message Date
Oliver Surke 8489180d51 Fix ssr restore: skip iCloud prompt when available, bail early on missing sudo
lib/brew.sh:
  - Before running the Homebrew installer, check `sudo -n true`. If sudo
    is not available, print a clear actionable error message with the
    manual install command and exit instead of running NONINTERACTIVE=1
    and crashing with "Need sudo access ... Administrator!" mid-way.

bin/ssr-restore:
  - Drop the unconditional "Configure iCloud / cloud drive?" prompt.
    Instead check whether the cloud directory is already mounted; if it
    is, proceed silently (the common case on an already-configured Mac).
    The prompt only appears when the directory is missing, i.e. iCloud
    is not yet signed in or the drive is not mounted — with an
    appropriate message explaining what to do.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 20:51:18 +02:00
Oliver Surke 539a8fc28f Initial ssr repository
Convert the legacy system_sync.sh and system_restore.sh into a modular
shareable repository:

- bin/ssr CLI dispatcher with install/sync/restore/schedule/config/status
- lib/ split: common, cloud, brew, mackup, macos
- Cloud provider abstraction (icloud, dropbox, googledrive, onedrive, custom)
- launchd template for scheduled daily sync (renderable via sed)
- ssr.conf.example with whitelisted KEY=VALUE config loader
- macos-defaults.sh extracted from inline block, overridable
- install.sh bootstrap symlinks CLI into ~/.local/bin
- README with usage, config table, migration map, security notes
- Original scripts archived under legacy/ for reference

Fixes vs originals: set -euo pipefail, quoted vars, find -print0,
spctl --global-disable (was --master-disable), MACOS=".macos" bug,
zero-width char before ln, Apple Silicon brew shellenv, config injection
hardening.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 15:05:17 +02:00