Maximum-easy adoption: - install.sh (macOS+Linux): curl|sh friendly. Detects OS/arch, resolves the binary (env → local dist/ → download → go-build fallback), lets you pick the install dir (smart default + prompt on a TTY), and optionally sets up a KEEP-ALIVE auto-restart service — launchd KeepAlive (mac) / systemd Restart=always user unit (linux). Flags + env for non-interactive use. - install.ps1 (Windows): copy exe + user PATH + optional restart-on-failure Scheduled Task at logon. - Hub Docker: Dockerfile (multi-stage, static CGO-free, alpine, healthcheck- ready) + docker-compose.yml (restart: unless-stopped = self-heal, named volume, dashboard-ready, optional autoheal profile for unhealthy-restart) + .dockerignore — drop-in for TrueNAS/Synology/unRAID. - macOS Full Disk Access: 'devbox doctor' now tests the ACTUAL protected mount paths (~/Desktop, ~/Documents, ~/Downloads, iCloud) and flags any it can't read, with the exact System Settings fix + a deep link; install.sh points to it on mac. Windows install.ps1 notes Controlled Folder Access (off by default). (TCC.db probe was unreliable across macOS versions — testing the real mounts is honest + version-proof.) shellcheck-clean; 18 pkgs -race green; win+mac build.
32 lines
810 B
Go
32 lines
810 B
Go
//go:build darwin
|
|
|
|
package main
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"git.shoemoney.ai/shoemoney/devbox/internal/config"
|
|
)
|
|
|
|
func TestProtectedMounts(t *testing.T) {
|
|
home, err := os.UserHomeDir()
|
|
if err != nil {
|
|
t.Skip("no home dir")
|
|
}
|
|
mounts := []config.Mount{
|
|
{Local: filepath.Join(home, "Documents", "work")},
|
|
{Local: filepath.Join(home, "Desktop")},
|
|
{Local: "/tmp/devbox-not-protected"},
|
|
{Local: filepath.Join(home, "Library", "Mobile Documents", "iCloud~x")},
|
|
}
|
|
got := protectedMounts(mounts)
|
|
if len(got) != 3 {
|
|
t.Fatalf("protectedMounts = %v, want 3 (Documents, Desktop, iCloud — not /tmp)", got)
|
|
}
|
|
// A readable dir is never reported as TCC-blocked.
|
|
if b := blockedByTCC([]string{t.TempDir()}); len(b) != 0 {
|
|
t.Fatalf("a readable dir was reported blocked: %v", b)
|
|
}
|
|
}
|