Getǣl — Read-only macOS home directory disk usage cartography & APFS telemetry service

Add Linux support #11

Closed zip.mu.social
Closed opened by zip.mu.social

Add native Linux support for getael while preserving the strictly read-only invariant and single-binary architecture.

Scope #

  1. Platform directory paths: Use XDG Base Directory paths ($XDG_CACHE_HOME/getael, $XDG_CONFIG_HOME/getael, $XDG_STATE_HOME/getael/logs) instead of macOS ~/Library/....
  2. Scanner metadata: Reuse std::os::unix::fs::MetadataExt (blocks() * 512, dev(), ino(), nlink()) and verify libc::statvfs field types across glibc and musl targets.
  3. Filesystem watcher (inotify scaling): Gate notify's macos_fsevent feature to cfg(target_os = "macos"). Because Linux inotify is not natively recursive and uses one watch descriptor per directory, large home directories can hit fs.inotify.max_user_watches (ENOSPC).
    • Handle ENOSPC gracefully instead of failing startup: log a clear warning with instructions to raise fs.inotify.max_user_watches, and fall back to periodic rescanning (PollWatcher or manual/timed refresh).
    • Map IN_Q_OVERFLOW / Flag::Rescan to the existing overflow/rescan path.
  4. Volume & snapshot telemetry: Replace APFS (diskutil, tmutil) with statvfs + /proc/mounts (mountpoint, filesystem type, total/free/available capacity). Mark snapshot telemetry as unavailable/optional so the API and UI degrade cleanly without APFS/Time Machine copy.
  5. Single-file build: Verify static x86_64-unknown-linux-musl and aarch64-unknown-linux-musl binaries build and run cleanly.

Acceptance Criteria #

  • cargo check / cargo test pass on Linux (both glibc and musl).
  • Server starts unprivileged, scans $HOME, handles inotify ENOSPC gracefully, serves the embedded web UI on 127.0.0.1:6174, and stays strictly read-only toward user files.
Sign up or Sign in to add to the discussion.