diff --git a/README.md b/README.md index efc27d2..fed5a72 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Automated setup scripts for configuring an Apple Silicon Mac Mini as a home serv 3. Copy `config/config.conf.template` to `config/config.conf` and set your `SERVER_NAME` 4. Create these 1Password items: "operator", "TimeMachine", "Plex NAS", "Apple", "OpenSubtitles" -**Setup** (15 minutes): +**Setup** (15-30 minutes): 1. **On dev Mac**: `./prep-airdrop.sh` (creates deployment package) 2. **AirDrop** the generated folder to your Mac Mini diff --git a/app-setup/rclone-setup.sh b/app-setup/rclone-setup.sh index 1845c8b..88fded3 100755 --- a/app-setup/rclone-setup.sh +++ b/app-setup/rclone-setup.sh @@ -3,7 +3,7 @@ # rclone-setup.sh - Dropbox synchronization setup script for Mac Mini server # # This script sets up rclone-based Dropbox synchronization natively on macOS with: -# - rclone configuration transfer from airdrop-prep.sh setup +# - rclone configuration transfer from prep-airdrop.sh setup # - Periodic Dropbox sync to local filesystem # - Auto-start configuration via LaunchAgent # @@ -12,7 +12,7 @@ # --skip-sync: Skip initial sync test # --sync-interval: Override sync interval (default from config) # -# Expected configuration files from airdrop-prep.sh: +# Expected configuration files from prep-airdrop.sh: # rclone.conf # rclone configuration with OAuth tokens (copied to app-setup dir by first-boot.sh) # dropbox_sync.conf # Dropbox sync configuration (copied to app-setup dir by first-boot.sh) # @@ -244,7 +244,7 @@ load_dropbox_config() { source "${dropbox_config}" else log "❌ Dropbox configuration file not found: ${dropbox_config}" - log "This file should have been created by airdrop-prep.sh and copied by first-boot.sh" + log "This file should have been created by prep-airdrop.sh and copied by first-boot.sh" exit 1 fi @@ -279,7 +279,7 @@ install_rclone_config() { if [[ ! -f "${source_config}" ]]; then log "❌ rclone configuration not found: ${source_config}" - log "This file should have been created by airdrop-prep.sh and copied by first-boot.sh" + log "This file should have been created by prep-airdrop.sh and copied by first-boot.sh" exit 1 fi diff --git a/docs/configuration.md b/docs/configuration.md index c9ececd..79fbe2e 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -85,7 +85,7 @@ The system uses 1Password for initial credential retrieval during setup preparat **MONITORING_EMAIL**: Email address for system notifications -- **Default**: "" (should be customized) +- **Default**: "" (should be customized) - **Usage**: Future monitoring system integration - **Example**: `MONITORING_EMAIL="admin@yourdomain.com"` @@ -171,7 +171,7 @@ MONITORING_EMAIL="homelab@yourdomain.local" ### Configuration Validation -Before running `airdrop-prep.sh`, verify your 1Password items exist: +Before running `prep-airdrop.sh`, verify your 1Password items exist: ```bash # Test 1Password connectivity @@ -268,7 +268,7 @@ chmod 600 ~/macmini-setup/config/wifi_network.conf ### Custom Package Lists -Modify the package installation by editing these files before running `airdrop-prep.sh`: +Modify the package installation by editing these files before running `prep-airdrop.sh`: **config/formulae.txt**: Command-line tools installed via Homebrew **config/casks.txt**: GUI applications installed via Homebrew @@ -303,7 +303,7 @@ ONEPASSWORD_VAULT="Staging Infrastructure" MONITORING_EMAIL="staging-alerts@company.com" ``` -Use with airdrop-prep.sh by copying the appropriate config: +Use with prep-airdrop.sh by copying the appropriate config: ```bash cp config-production.conf config/config.conf @@ -330,7 +330,7 @@ The configuration system supports future extension points: To migrate configuration to a new Mac Mini: 1. **Update SERVER_NAME** in config.conf if needed -2. **Run airdrop-prep.sh** with updated configuration +2. **Run prep-airdrop.sh** with updated configuration 3. **Transfer setup package** to new Mac Mini 4. **Run first-boot.sh** as normal diff --git a/docs/operator.md b/docs/operator.md index 42990b2..36a99a6 100644 --- a/docs/operator.md +++ b/docs/operator.md @@ -44,7 +44,7 @@ Test SSH connectivity from your development Mac: # Test operator SSH access ssh operator@macmini.local -# Test admin SSH access +# Test admin SSH access ssh admin@macmini.local ``` @@ -70,13 +70,9 @@ The automatic setup adds iTerm to the dock. **Switch from Terminal to iTerm** fo ### Administrative Tasks -The operator account can perform most server management tasks: +The operator account can perform some server management tasks: ```bash -# Package management -brew install -brew update && brew upgrade - # Native application management (after app setup) launchctl list | grep plex launchctl stop com.plexapp.plexmediaserver @@ -87,6 +83,14 @@ brew services list ps aux | grep "Plex Media Server" ``` +The administrator account must be used for package installation: + +```bash +# Package management +brew install +brew update && brew upgrade +``` + ### Switching to Admin Account For system-level changes that require the original admin account: @@ -241,7 +245,7 @@ launchctl start com.plexapp.plexmediaserver - **Notifications**: Click "Configure in System Preferences" for system notifications -**Network Tab**: +**Network Tab**: - **System sleep**: "Prevent computer from sleeping with active transfers" (if desired) @@ -276,7 +280,7 @@ ssh admin@macmini.local 'echo SSH working' - **Setup logs**: `~/.local/state/macmini-setup.log` - **Application setup logs**: `~/.local/state/macmini-apps.log` -- **Plex logs**: `/tmp/plex-out.log` and `/tmp/plex-error.log` +- **Plex logs**: `/Users/Shared/PlexMediaServer/Plex Media Server/Logs` - **System logs**: Use Console.app or `log show --predicate 'processImagePath contains "Plex Media Server"'` ### Time Machine Verification @@ -302,7 +306,7 @@ cat ~/.ssh/id_ed25519_operator.pub >> ~/.ssh/authorized_keys ### Sudo Access -**TouchID is not available** for sudo commands, because TouchID cannot coexist with automatic login. For remote SSH sessions, you'll need to enter the operator password. +**TouchID is not available** for sudo commands, because TouchID cannot coexist with automatic login. **Password location**: `op://personal/operator/password` in 1Password @@ -320,7 +324,7 @@ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --listapps ### Immediate Tasks 1. **✅ Automatic dock customization** (happens on first login) -2. **✅ Verify SSH access** +2. **✅ Verify SSH access** 3. **Run application setup scripts** as needed (as admin user) 4. **Configure additional services** as needed 5. **Test native applications** after setup (check LaunchAgent status) diff --git a/docs/setup/first-boot.md b/docs/setup/first-boot.md index 583b0e2..7de63d9 100644 --- a/docs/setup/first-boot.md +++ b/docs/setup/first-boot.md @@ -21,7 +21,7 @@ The `first-boot.sh` script performs complete automated setup of your Mac Mini se 1. **AirDrop the complete macmini-setup folder** from your development Mac > You can use [airdrop-cli](https://github.com/vldmrkl/airdrop-cli) (requires Xcode) to AirDrop files from the command line! - > Install: (`brew install --HEAD vldmrkl/formulae/airdrop-cli`) + > Install: `brew install --HEAD vldmrkl/formulae/airdrop-cli` 2. The folder appears in `~/Downloads/macmini-setup` on the Mac Mini (default name) diff --git a/docs/setup/prep-airdrop.md b/docs/setup/prep-airdrop.md index cffafef..05dc2fa 100644 --- a/docs/setup/prep-airdrop.md +++ b/docs/setup/prep-airdrop.md @@ -82,28 +82,64 @@ The prep script creates a complete setup package: ```plaintext macmini-setup/ -├── ssh_keys/ -│ ├── authorized_keys # Admin SSH access -│ └── operator_authorized_keys # Operator SSH access -├── scripts/ -│ ├── first-boot.sh # Main setup script -│ ├── operator-first-login.sh # Operator customization (runs automatically) -│ └── app-setup/ # Application installers +├── app-setup/ +│ ├── catch-setup.sh +│ ├── config/ +│ │ ├── dropbox_sync.conf +│ │ ├── FileBot_License_XXXXXXXX.psm +│ │ ├── plex_nas.conf # Plex NAS hostname configuration +│ │ └── rclone.conf +│ ├── filebot-setup.sh +│ ├── plex-setup.sh +│ ├── rclone-setup.sh +│ ├── run-app-setup.sh +│ ├── templates/ +│ │ ├── mount-nas-media.sh +│ │ ├── start-plex.sh +│ │ ├── start-rclone.sh +│ │ └── transmission-done.sh +│ └── transmission-setup.sh +├── bash/ # Bash config (if configured) ├── config/ -│ ├── config.conf # Server settings -│ ├── formulae.txt # Homebrew packages +│ ├── apple_id_password.url # One-time Apple ID link │ ├── casks.txt # Homebrew applications +│ ├── config.conf # Server settings │ ├── dev_fingerprint.conf # Safety check data +│ ├── formulae.txt # Homebrew packages +│ ├── iterm2.plist # iTerm2 profile/settings (optional) │ ├── keychain_manifest.conf # Keychain service identifiers -│ ├── mac-server-setup-db # External keychain file -│ ├── timemachine.conf # Backup configuration -│ ├── apple_id_password.url # One-time Apple ID link -│ └── wifi_network.conf # WiFi credentials (only if script-based config) -└── app-setup/ - ├── config/ - │ └── plex_nas.conf # Plex NAS hostname configuration - └── plex-setup.sh # Plex setup script -└── README.md # Setup instructions +│ ├── logrotate.conf +│ ├── mac-server-setup-db # External keychain file +│ ├── Orangebrew.terminal # Terminal.app profile (optional) +│ └── timemachine.conf # Backup configuration +├── DEPLOY_MANIFEST.txt +├── first-boot.sh # Main setup script +├── README.md # Setup instructions +├── scripts/ +│ ├── operator-first-login.sh # Operator customization (runs automatically) +│ ├── setup-apple-id.sh +│ ├── setup-application-preparation.sh +│ ├── setup-bash-configuration.sh +│ ├── setup-command-line-tools.sh +│ ├── setup-dock-configuration.sh +│ ├── setup-firewall.sh +│ ├── setup-hostname-volume.sh +│ ├── setup-log-rotation.sh +│ ├── setup-package-installation.sh +│ ├── setup-power-management.sh +│ ├── setup-remote-desktop.sh +│ ├── setup-shell-configuration.sh +│ ├── setup-ssh-access.sh +│ ├── setup-system-preferences.sh +│ ├── setup-terminal-profiles.sh +│ ├── setup-timemachine.sh +│ ├── setup-touchid-sudo.sh +│ └── setup-wifi-network.sh +└── ssh_keys/ + ├── authorized_keys # Admin SSH access + ├── id_ed25519 + ├── id_ed25519.pub + └── operator_authorized_keys # Operator SSH access ``` ## Security Features @@ -124,7 +160,7 @@ macmini-setup/ 2. **Enable AirDrop:** Press Cmd-Shift-R to open AirDrop, and select "Allow me to be discovered by: Everyone" 3. **AirDrop the entire macmini-setup folder** from your development Mac > You can use [airdrop-cli](https://github.com/vldmrkl/airdrop-cli) (requires Xcode) to AirDrop files from the command line! - > Install: (`brew install --HEAD vldmrkl/formulae/airdrop-cli`) + > Install: `brew install --HEAD vldmrkl/formulae/airdrop-cli` 4. The folder will appear in `~/Downloads/macmini-setup` on the Mac Mini 5. Proceed with [First Boot Instructions](first-boot.md) diff --git a/docs/transmission-missing-gui-settings.md b/docs/transmission-missing-gui-settings.md deleted file mode 100644 index 2dfd061..0000000 --- a/docs/transmission-missing-gui-settings.md +++ /dev/null @@ -1,103 +0,0 @@ -# Transmission GUI Settings Research Report - -**Date**: 2025-09-08 -**Context**: Settings visible in Transmission GUI that could not be automated via `defaults` commands - -## Summary - -While examining the Transmission preferences GUI against the actual plist file (`org.m0k.transmission`), several GUI settings could not be mapped to plist keys. This document catalogs these missing settings for future research. - -## Confirmed Missing Settings - -### 1. Dock Badge Configuration - -**GUI Location**: General → Badge Dock icon with -**Visible Options**: "Total download rate" ✓, "Total upload rate" ✓ -**Attempted Keys**: `BadgeDockTotalDownload`, `BadgeDockTotalUpload` -**Status**: Keys not found in actual plist -**Research Needed**: Find correct keys or determine if this is controlled elsewhere - -### 2. Sleep Prevention - -**GUI Location**: Network → System sleep → "Prevent computer from sleeping with active transfers" ✓ -**Attempted Key**: `NoSleepWhenActiveTransfers` -**Status**: Key not found in actual plist -**Research Needed**: Find correct key or determine if this requires IOKit/Energy Saver integration - -### 3. [resolved] - -### 4. Queue Enable/Disable State - -**GUI Location**: Transfers/Management → Queues section checkboxes -**Attempted Keys**: `QueueDownloadEnabled`, `QueueSeedEnabled` -**Plist Reality**: `Queue = 0`, `QueueSeed = 0` (suggesting boolean state) -**Research Needed**: Understand relationship between Queue/QueueSeed and the number settings - -### 5. Notification System Integration - -**GUI Location**: General → Notifications → "Configure in System Preferences" button -**Status**: No corresponding plist keys found -**Research Needed**: May require macOS User Notifications framework integration - -### 6. [resolved] - -### 7. Auto-Update Configuration - -**GUI Location**: General → Check for updates → "Automatically check daily" ✓ -**Status**: Update-related keys exist (`SUHasLaunchedBefore`, `SULastCheckTime`) but no daily check boolean found -**Research Needed**: May be controlled by Sparkle update framework defaults - -## Successfully Mapped Settings - -For reference, these GUI settings were successfully automated: - -### Network Settings ✅ - -- Fixed peer port: `BindPort = 40944` -- µTP enabled: `UTPGlobal = 1` -- Port mapping: `NatTraversal = 1` - -### Peer Protocol Settings ✅ - -- Connection limits: `PeersTotal = 2048`, `PeersTorrent = 256` -- PEX/DHT/Local discovery: `PEXGlobal`, `DHTGlobal`, `LocalPeerDiscoveryGlobal = 1` -- Encryption: `EncryptionPrefer = 1`, `EncryptionRequire = 1` - -### Blocklist Settings ✅ - -- Enabled: `BlocklistNew = 1` -- URL: `BlocklistURL = "https://github.com/Naunter/BT_BlockLists/raw/master/bt_blocklists.gz"` -- Auto-update: `BlocklistAutoUpdate = 1` - -### Seeding/Queue Management ✅ - -- Ratio limits: `RatioCheck = 1`, `RatioLimit = 2` -- Idle limits: `IdleLimitCheck = 1`, `IdleLimitMinutes = 30` -- Queue numbers: `QueueDownloadNumber = 3`, `QueueSeedNumber = 3` -- Stalled detection: `CheckStalled = 1`, `StalledMinutes = 30` -- Auto-removal: `RemoveWhenFinishSeeding = 1` - -### UI Settings ✅ - -- Auto-resize: `AutoSize = 1` -- Watch folder: `AutoImport = 1`, `AutoImportDirectory = "/path/to/folder"` - -## Research Action Items - -1. **Transmission Source Code Review**: Examine Transmission's macOS-specific code for preference key definitions -2. **Reverse Engineering**: Use system monitoring tools to observe what changes when GUI settings are modified -3. **Alternative Configuration**: Investigate if some settings require JSON config files or other mechanisms -4. **System Integration**: Research which features require native macOS framework integration vs plist storage -5. **Version Differences**: Verify if preference keys have changed between Transmission versions - -## Impact Assessment - -**Low Impact**: Most core functionality is successfully automated -**Medium Impact**: Missing dock badges and sleep prevention are nice-to-have features -**High Impact**: None - all essential BitTorrent functionality is configured correctly - -The current automation covers approximately 90% of the visible GUI settings, providing a fully functional Transmission setup for the media pipeline workflow. - ---- - -Generated during transmission-setup.sh development - 2025-09-08 diff --git a/scripts/airdrop/rclone-airdrop-prep.sh b/scripts/airdrop/rclone-airdrop-prep.sh index 1673da2..268ff26 100755 --- a/scripts/airdrop/rclone-airdrop-prep.sh +++ b/scripts/airdrop/rclone-airdrop-prep.sh @@ -6,7 +6,7 @@ # This script handles rclone installation, OAuth authentication, and configuration # transfer for Dropbox synchronization on the server. # -# Called by: airdrop-prep.sh +# Called by: prep-airdrop.sh # Requires: DROPBOX_SYNC_FOLDER, DROPBOX_LOCAL_PATH, OUTPUT_PATH, SERVER_NAME_LOWER # @@ -15,12 +15,12 @@ set -euo pipefail # Check required variables are set if [[ -z "${OUTPUT_PATH:-}" ]]; then - echo "Error: OUTPUT_PATH not set - this script must be called from airdrop-prep.sh" + echo "Error: OUTPUT_PATH not set - this script must be called from prep-airdrop.sh" exit 1 fi if [[ -z "${SERVER_NAME_LOWER:-}" ]]; then - echo "Error: SERVER_NAME_LOWER not set - this script must be called from airdrop-prep.sh" + echo "Error: SERVER_NAME_LOWER not set - this script must be called from prep-airdrop.sh" exit 1 fi diff --git a/scripts/server/first-boot.sh b/scripts/server/first-boot.sh index e3c5215..1a1fe3e 100755 --- a/scripts/server/first-boot.sh +++ b/scripts/server/first-boot.sh @@ -564,7 +564,7 @@ if [[ -f "${DEV_FINGERPRINT_FILE}" ]]; then log "Loaded development machine fingerprint for safety check" else echo "❌ SAFETY ABORT: No development fingerprint file found" - echo "This indicates the setup directory was not properly prepared with airdrop-prep.sh" + echo "This indicates the setup directory was not properly prepared with prep-airdrop.sh" exit 1 fi