Commit graph

116 commits

Author SHA1 Message Date
55e1e77fc6 docs: sync README for round-6 fsck dangling-refs + status liveness 🔬⚠️
Some checks are pending
CI / vet-build-test (push) Waiting to run
- fsck now also flags dangling snapshots (manifest → missing blob)
- status says when the daemon isn't running (no silent stale state)
(transport HTTP_PROXY regression fix restores standard env behavior — no doc knob)
2026-06-30 16:26:25 -05:00
0ab6a88627 feat(hub): fsck also detects dangling snapshots (manifest refs a missing blob)
Some checks are pending
CI / vet-build-test (push) Waiting to run
2026-06-30 16:25:06 -05:00
6cf8846544 round6-client: restore HTTP_PROXY support (transport regression) + status flags daemon-not-running
- internal/transport/client.go: replace bare &http.Transport{} with
  DefaultTransport.Clone() so HTTP_PROXY/HTTPS_PROXY/NO_PROXY, ForceAttemptHTTP2,
  IdleConnTimeout, and ExpectContinueTimeout are preserved; only intentionally-tuned
  fields (DialContext, TLSHandshakeTimeout, ResponseHeaderTimeout, DisableCompression,
  MaxIdleConnsPerHost) are overridden.
- cmd/devbox/main.go: statusCmd disk path now calls control.DialState once upfront;
  prints "⚠️  daemon not running — showing last-known disk state (run: devbox start)"
  when daemon is absent so users aren't silently misled.
- Tests: TestTransportHonorsProxyEnv asserts Proxy!=nil + ForceAttemptHTTP2=true;
  TestStatusDaemonNotRunning asserts warning appears on joined-but-no-daemon device.
2026-06-30 16:25:06 -05:00
f8fb8564b2 docs: sync README for round-5 fsck + share ls 🔬📑
Some checks are pending
CI / vet-build-test (push) Waiting to run
- devbox-hub fsck (at-rest blob integrity scan, non-zero exit on corruption)
- devbox-hub share ls [--json]
(push-integrity fix is internal — no user-facing surface to document)
2026-06-30 15:29:12 -05:00
f0fe810ab6 fix(hub): derive push chunk set from the manifest, not client-supplied req.Chunks
Some checks are pending
CI / vet-build-test (push) Waiting to run
Trust boundary: handlePush previously verified that every hash in req.Chunks
existed in the blob store, but it trusted req.Chunks as the authoritative list
of chunks the pushed manifest references.  A buggy or malicious client could:

  (a) Push a manifest referencing chunk C while omitting C from req.Chunks →
      hub commits a snapshot whose manifest references a blob that may not
      exist → every subsequent pull 404s on C (dangling snapshot).

  (b) Include in req.Chunks a chunk not referenced by the manifest →
      refcount is bumped for a blob GC can never safely collect (phantom ref).

Fix: after confirming the manifest blob is present, we now fetch + unmarshal
it and derive the DISTINCT chunk hash set directly from Manifest.Entries[*].Chunks.
Each hash in that set is verified to exist in the store; any missing hash rejects
the push with 409 (same status as before).  Only manifest-referenced hashes are
passed to db.AddSnapshot() for refcounting.

Size hint: meta.ChunkRef.Size is used only for metrics/dashboard totals and is
stored once (first INSERT; ON CONFLICT only bumps refcount, not size).  GC
decisions are made on refcount, not size.  We keep req.Chunks as a size-hint
lookup (reqSizes map): if the client is honest the size is correct; if a hash is
absent from req.Chunks the size defaults to 0, which is harmless.

Happy-path unchanged: an honest client (syncer.go) always derives req.Chunks
from the same manifest, so all hashes are present with correct sizes.

Tests: TestHubHappyPath updated to push a real manifest JSON (required now that
the hub parses it); TestPushManifestChunkIntegrity asserts the malicious pattern
is rejected and the head does not advance, then confirms an honest push succeeds.
2026-06-30 15:28:02 -05:00
132978e63d round5-hub: fsck (at-rest blob integrity) + share ls 2026-06-30 15:28:02 -05:00
a88056649a docs: sync README for round-4 status errors + hub serve hardening 🩺🛑
Some checks are pending
CI / vet-build-test (push) Waiting to run
- status now surfaces per-mount last sync error (+ last_err in --json)
- serve: version/dashboard in startup log, non-loopback --listen warning, graceful SIGTERM shutdown
2026-06-30 14:24:48 -05:00
3c15ae1260 round4-hub: non-loopback listen warning, version in startup log, graceful shutdown 🛰️🛑
Some checks are pending
CI / vet-build-test (push) Waiting to run
- warn when --listen is non-loopback (plain HTTP, cleartext bearer tokens)
- startup log now includes build version + dashboard on/off state
- serve blocks on SIGTERM/Interrupt; 10s drain window before exit
- hoist dashboard http.Server so shutdown also drains it
- table-test isLoopback (IPv4, IPv6, empty host, non-loopback variants)
2026-06-30 14:23:42 -05:00
3ea8df85aa round4-client: surface last sync error per mount in status
Track lastErr per mount (mirroring lastSync pattern), cleared on
success so a recovered mount shows clean. Errors from LoadIgnoreWith,
Pull, and Sync all land in the map and surface through StateSnapshot
into 'devbox status' (human ⚠️ warning) and --json (last_err field).
2026-06-30 14:23:42 -05:00
b8b9bd1f22 docs: sync README for round-3 hub admin + DR + doctor clock-skew 📚💾
Some checks are pending
CI / vet-build-test (push) Waiting to run
- hub: backup <dir> (DR), serve --metrics-token / --access-log, device ls [--json]
  (corrected the old aspirational `device list` row → real `device ls`), gc --keep-days
- client: doctor now also warns on clock skew vs the hub (>30s)
2026-06-30 13:55:24 -05:00
dd27af3cc2 round3-hub: backup, metrics auth, device ls, gc --keep-days, access log
Some checks are pending
CI / vet-build-test (push) Waiting to run
2026-06-30 13:53:16 -05:00
8f78f65d57 round3-client: doctor clock-skew check vs hub 2026-06-30 13:53:16 -05:00
70101e7308 docs: sync README for round-2 WAN hardening + new flags 📚
Some checks are pending
CI / vet-build-test (push) Waiting to run
- conflicts --rm, doctor --json, status sync-age rows
- /healthz version, /metrics counters
- config.toml: compress now both-ways, sync.ignore_defaults; WAN timeout/retry/parallel note
2026-06-30 13:27:32 -05:00
84a4ff53e8 feat(cli): doctor --json, conflicts --rm, status sync-age, opt-in default ignores 🧰🙈
- 🩺 `doctor --json`: structured check report for cron/monitoring; still exits
  non-zero on ❌ (collects checks into a slice, JSON path suppresses the human lines).
- 🗑️ `conflicts --rm`: delete every `.conflict-` copy after review (lazy cleanup,
  not a resolver). Only touches conflict copies — real files untouched.
- ⏱️ `status` shows per-mount last-sync age ("synced 12s ago" / "not synced yet")
  from a daemon-tracked timestamp (control.MountState.LastSyncUnix); also in --json.
- 🙈 the reversed no-go: `settings.sync.ignore_defaults` (opt-in, default off) layers
  a built-in junk set (node_modules, .git, target, dist, build, .venv, __pycache__,
  .next, .DS_Store) onto the matcher — don't ship gigabytes of regenerable junk over
  the now-live WAN. Reuses round-1 --exclude plumbing; honored by daemon + publish.

Tests: doctor --json valid+exit-code, conflicts --rm deletes only conflicts,
ignore.Defaults match. go test ./... -race + vet clean.
2026-06-30 13:26:24 -05:00
4333bba55b feat(hub): /metrics transfer counters + build version in /healthz 📊🩺
- 📊 /metrics gains real WAN observability counters beyond the 4 gauges:
  blob bytes in/out (the bandwidth signal now the hub is internet-reachable)
  plus pushes/conflicts totals for sync churn. Atomic, incremented at the
  blob + push handlers.
- 🩺 /healthz now reports the build version ("ok <version>") so a deploy can
  curl-verify the new binary is actually live (SetVersion wired in serve).

Test: TestMetricsCountersAndHealthVersion (version in healthz; bytes_in/out
move on a real PUT/GET).
2026-06-30 13:18:13 -05:00
963ece58b0 feat(transfer): harden the WAN sync path — timeouts, retry, parallel I/O, download gzip 🌐⚡
Now the hub is WAN-reachable, the transfer path needed real hardening:

- ⏱️  request timeout fix: replaced the 30s TOTAL http.Client.Timeout (which
  killed a 256MiB blob mid-transfer over a slow link) with granular dial / TLS /
  response-header timeouts + TCP keepalive. Body transfer is no longer wall-clocked.
- 🔁 retry + exponential backoff on transient blob transfers (network / 5xx),
  3 attempts; 4xx fails fast. Blob GET/PUT are content-addressed (idempotent),
  so retry is safe; control calls are left alone.
- 🚀 parallel blob uploads (push) and parallel chunk downloads (pull reassembly),
  bounded pools (8), sharing the existing rate limiter. WAN is RTT-bound — this
  keeps the pipe full instead of one-blob-at-a-time.
- 🗜️ download (response) gzip: round 1 compressed only uploads, but a clone is
  download-heavy. Client negotiates gzip explicitly (so the rate limiter counts
  wire bytes), hub streams the response through gzip, client decompresses
  bomb-safely. Gated by the same settings.transfer.compress flag.

Tests: retry transient-then-success + 4xx-no-retry, gzip download round-trip.
All existing push/pull round-trips green under -race (refactors behavior-preserving).
2026-06-30 13:15:17 -05:00
4168b2109f docs: sync README CLI reference with new flags + config.toml knobs 📚
Some checks are pending
CI / vet-build-test (push) Waiting to run
- device: status/log/conflicts --json, pause --for, mount --exclude, doctor exit
- hub: gc --dry-run, serve --dashboard-token, /healthz + /readyz
- new config.toml reference (transfer.compress, sync.rescan_seconds)
2026-06-30 12:36:25 -05:00
11fe999ca2 feat(transfer): opt-in gzip blob compression for WAN sync 🌐🗜️
The "changed my mind" feature: deferred as YAGNI on a LAN, but the hub is now
WAN-reachable (port-forwarded), so over-the-internet sync is a real path and
compression earns its keep.

- client (settings.transfer.compress, default off): gzip a blob upload only
  when it actually shrinks — incompressible chunks (media, encrypted) go raw so
  we never inflate the wire. Sets Content-Encoding: gzip. Wired into the daemon
  sync loop and the initial `publish` upload.
- hub: decompresses gzip uploads before hashing, so dedup + content-address
  integrity are unchanged. Bomb-safe — caps BOTH the compressed stream
  (MaxBytesReader) and the decompressed size (LimitReader), rejecting a gzip
  header over a non-gzip body.

Tests: client gzip-when-smaller / raw-when-not, hub decompress round-trip +
bad-gzip rejection. go test ./... -race clean, go vet clean.
2026-06-30 12:34:27 -05:00
8c5d576a72 feat(device): --json output, streaming chunker, pause --for, per-mount exclude, rescan knob ✨
Five device-side wins from the feature review:

- 🤖 `--json` on status/log/conflicts: machine-readable output for fleet
  scripting/monitoring. status prefers live daemon state (paused +
  base-snapshot), falls back to disk; not-joined → {"joined":false}.
- 🌊 streaming chunker: chunk.SplitReader feeds FastCDC from an io.Reader so
  the manifest build no longer slurps whole files into RAM — a multi-GB file
  can't OOM the daemon. Identical boundaries/hashes (proven vs fragmented reads).
- ⏱️  `devbox pause --for 2h`: control socket carries a duration; the daemon
  schedules an auto-resume timer. Re-pause replaces it; plain pause/resume
  cancel it (no surprise resume).
- 🙈 per-mount `devbox mount --exclude <pat>`: device-local ignore layered on
  the shared .devignore (LoadIgnoreWith) — skip a local build dir without
  touching the shared file. Honored by daemon sync, restore, and deploy.
- 🎛️  rescan cadence is now settings.sync.rescan_seconds (was a hardcoded 60s
  const) — tune the watcher fallback per machine without a rebuild.

#6 (doctor non-zero exit) was already shipped — doctor returns an error on ❌.
Tests: SplitReader-vs-buffered, PauseFor auto-resume + cancel, wire duration,
LoadIgnoreWith layering, status/conflicts --json. go test ./... -race clean.
2026-06-30 12:29:02 -05:00
5440054a41 feat(hub): gc --dry-run, dashboard token auth, /healthz + /readyz 🛡️🧹
Three hub-side operability/security closures:

- 🧹 `devbox-hub gc --dry-run`: previews the exact snapshots + chunks the
  sweep would remove (computed from reachability — same set the real run
  deletes) without mutating a thing. Cheap insurance before a destructive GC.
- 🔐 dashboard token auth (`--dashboard-token`): a non-loopback bind was
  unauthenticated (warning only) and leaked device names/activity. Token is
  accepted via ?token=, Authorization: Bearer, or an HttpOnly cookie pinned
  on first ?token= — so EventSource/fetch authenticate with index.html
  untouched. Constant-time compare.
- 🩺 `/healthz` (liveness) + `/readyz` (DB-ping → 503 when unreachable): real
  probes for the compose selfheal profile / LBs, which only had /metrics.

Tests: TestGCDryRun (accurate + non-destructive), TestDashboardAuth.
2026-06-30 12:14:54 -05:00
7e13eca8ad docs: production TLS + safe-upgrade guide; extract safe-stateful-redeploy skill 📚🛡️
Some checks failed
CI / vet-build-test (push) Has been cancelled
README: hub deploy section gains a Production collapsible — front the hub with a
reverse proxy for TLS (client_max_body_size 0 + proxy_buffering off for SSE), and
the never-YOLO upgrade pipeline (dry-run on a copy → smoke → backup → rollback).
General pattern, no private hostnames (repo is public).
2026-06-24 17:47:51 -05:00
ad7ed674fe fix(deploy): stage smoke binaries on the dataset (TrueNAS /tmp is noexec) 🐳
Some checks are pending
CI / vet-build-test (push) Waiting to run
The auth smoke ran the new binary from /tmp, but TrueNAS mounts /tmp noexec —
'Permission denied' on exec. Stage binaries under $DEST/.staging (the app dataset,
exec-ok) instead. The fail-safe worked perfectly: it aborted with prod untouched.
Then ran for real — live hub migrated v1→v3, all data preserved, P2 fixes + TLS live.
2026-06-24 17:45:22 -05:00
d672dd2fda fix(verify): migration-verify robust to no-op + already-migrated DBs ♻️
Some checks are pending
CI / vet-build-test (push) Waiting to run
Compare before/after counts directly (captured pre-run) instead of via the
v1→v2-only .pre-v2.bak, so the dry-run passes on an already-migrated DB (steady
state) AND on a fresh v1→v3 jump. Backup check is now conditional on an actual
version bump. Verified on the real live .10 DB: 0→3, 13/12 devices/shares + 16
chunks preserved, 3 legacy heads backfilled (snap 13→16), orphans=0.
2026-06-24 17:41:44 -05:00
735b5b2c4b feat(deploy): hardened safe hub redeploy + reusable auth smoke 🛡️🚀
Some checks are pending
CI / vet-build-test (push) Waiting to run
- scripts/hub-auth-smoke.sh: throwaway-instance smoke proving invite revocation
  works + +s attenuation holds (admin without +s denied conferring it). No python/jq
  dep (curl+sed). Reusable by redeploy + CI. Verified locally.
- deploy/redeploy-hub.sh: rewritten from build→scp→restart into a SAFE pipeline —
  migration dry-run on a COPY of live data (live untouched) → auth smoke the new
  binary on the NAS → back up binary+DB (stopped, WAL quiescent) → swap + sync unit →
  post-verify (hub answers + /v1/invite/revoke=401 proves new code) → AUTO-ROLLBACK
  on failure. The hub DB is canonical history; never YOLO a binary onto it.
- deploy/devbox-hub.service: add --gc-every 24h (self-maintain; blobs don't grow
  unbounded). HTTPS via NPM note.
2026-06-24 17:36:21 -05:00
35820386cb docs: P1+P3 fleet-verified on real arm64 Pi (192.168.1.13) — caveat closed 🥧✅
Some checks are pending
CI / vet-build-test (push) Waiting to run
The Pi came back online. Ran the headline acceptances on real hardware:
- P1: anon curl|sh install on a clean no-Go arm64 Pi -> working devbox 0346995,
  devbox doctor reports linux/arm64.
- P3: dashboard-fleet-verify (remote mode) -> all 5 flow events (join·push·pull·
  conflict·gc) on the live SSE stream + history window, on the real Pi.
Upgraded plan.md wording from qemu/local to real-Pi fleet-verified.
2026-06-24 17:19:58 -05:00
74d8b79cd8 docs: P3 dashboard depth shipped — plan/README/CLI synced 📊✅
Some checks are pending
CI / vet-build-test (push) Waiting to run
plan.md: P3 row -> ✅ SHIPPED (pull·gc·conflict + server-side history; verified on
SSE + headless 0-errors). Roadmap mermaid all-green; status badge P1+P2+P3 shipped.
README: dashboard section now documents the 5 flow events + the reload-surviving
history sparkline + --gc-every; CLI table gains 'invite revoke' (P2) and
'serve --gc-every' (P3).
2026-06-23 20:53:59 -05:00
80380652cc feat(dashboard): P3 depth — pull/gc/conflict flow events + server-side history ✨📊
Some checks are pending
CI / vet-build-test (push) Waiting to run
- Hub emits 3 new flow events: pull (head fetch/propagation, handleHead), conflict
  (stale-parent push, handlePush), gc (in-process sweep). Opt-in periodic GC via
  'serve --gc-every <dur>' (default off) self-maintains the hub AND animates each
  sweep; runGC stays put (no risky refactor of mark-and-sweep).
- Server-side history ring: per-minute activity buckets (push/pull/conflict/gc +
  bytes), last 60 min, in /api/state — the sparkline now survives a page reload
  (was computed from the live stream only). Recorded under the Emit lock; race-clean.
- Frontend (index.html): pull = teal inbound pulse, conflict = red collision burst,
  gc = amber hub sweep + toast; stacked per-minute history sparkline seeded from
  /api/state and growing live. One file, no new deps.
- dashboard-fleet-verify.sh: rewritten — drives join·push·pull·conflict·gc and
  asserts all 5 on the SSE stream + the history window; adds LOCAL=1 mode (native,
  no Pi). Verified locally end-to-end. Tests: TestHistoryRing. go test ./... -race clean.
2026-06-23 20:45:31 -05:00
3c69a28057 docs: P2 (M8a auth audit) shipped — +s attenuation + invite revocation 🛡️📊
Some checks are pending
CI / vet-build-test (push) Waiting to run
2026-06-23 20:29:22 -05:00
f8135b9d07 feat(M8a): adversarial auth audit — close +s escalation + add invite revocation 🛡️
Some checks are pending
CI / vet-build-test (push) Waiting to run
P2 adversarial audit (6 finders + skeptic verification, 13 agents). Two real
findings fixed with regression tests; rest documented as single-owner residuals.

- FIX (+s attenuation): MayGrant never constrained the GRANTED reshare bit, so an
  invite could confer +s the caller didn't hold (req.Reshare copied verbatim).
  MayGrant now takes grantReshare and rejects conferring +s you don't hold (owners
  unconstrained) — attenuation is total over role + target + reshare.
- FIX (invite revocation): invites were unrevocable 24h bearer capabilities — no
  way to kill a leaked/regretted one. Added meta.RevokeInvite (token+binding in one
  tx), POST /v1/invite/revoke (only a caller who could mint it may revoke), and
  'devbox invite revoke <token>'.
- Tests: TestMayGrant (+5 +s cases), TestInviteCannotGrantReshareCallerLacks,
  TestInviteRevoke. go test ./... -race clean (18 pkgs).
- docs/M8a-audit.md: findings, confirmed defenses, accepted residuals.

Confirmed-defended under attack: single-use redeem (atomic CAS), role bounding,
revoke-at-auth (revoked=0 in bearer+role lookups), cross-share binding, PoP.
2026-06-23 20:27:12 -05:00
060e147112 docs: fix plan.md public badge MIT -> AGPLv3 ⚖️
Some checks are pending
CI / vet-build-test (push) Waiting to run
2026-06-23 20:02:12 -05:00
0293ebd1b0 docs: P1 shipped + repo public; LICENSE = AGPLv3 (matches open-core moat) 📦🌍⚖️
Some checks are pending
CI / vet-build-test (push) Waiting to run
- LICENSE: replace the placeholder with canonical GNU AGPLv3 — the README's
  open-core model (hosted tier = commercial) needs copyleft, not MIT. Fixes the
  earlier commit that mislabeled it MIT.
- plan.md: P1 row -> ✅ SHIPPED with the real outcome (arm64 targets, release.sh,
  CI, hub image, public devbox-dist, public GitHub mirror, two-method secret scan).
  Next pointer -> P2 (M8a auth audit). Badges: release live + public.
- README: status -> 'v2 P1 shipped · public', + release badge, install badge notes
  'go install'.
2026-06-23 20:01:32 -05:00
03469958d3 chore: prep for public release — MIT license + github.com module path 🌍⚖️
Some checks are pending
CI / vet-build-test (push) Waiting to run
- LICENSE: MIT (enables the adoption push; public repo was all-rights-reserved).
- go.mod + all imports: git.shoemoney.ai/shoemoney/devbox -> github.com/shoemoney/devbox,
  so outsiders can 'go install github.com/shoemoney/devbox/cmd/devbox@latest'. Forgejo
  stays the self-hosted home; the registry (devbox-hub) + public dist (devbox-dist) are
  unchanged. vet + build + go test -race all green after the rename.
- README: document the go install path.

Security: full git-history scan (manual blob sweep + gitleaks, 84 commits) found
ZERO secrets — Forgejo token never committed, no keys/passwords/private keys.
2026-06-23 19:19:09 -05:00
3a0ec9740e feat(release): publish to public devbox-dist repo (no-token curl|sh) 🌐📦
Some checks are pending
CI / vet-build-test (push) Waiting to run
Private code stays private; the public shoemoney/devbox-dist repo carries only the
install scripts + release binaries as release assets, so a clean Pi/box can:
  curl -fsSL .../devbox-dist/releases/download/latest/install.sh | sh
with no auth. release.sh now targets devbox-dist (tags hang off its branch),
uploads install.sh/install.ps1 alongside the binaries, and rewrites SHA256SUMS to
the de-versioned asset names so shasum -c matches. install.sh/install.ps1/README
point at the new public URLs.
2026-06-23 18:12:09 -05:00
9b1165a49a feat(release): arm64/arm targets + Forgejo release one-shot + CI workflows 📦🤖
Some checks are pending
CI / vet-build-test (push) Waiting to run
- build-release.sh: add linux/arm64 (Raspberry Pi!) + linux/arm targets — the
  curl|sh install on a clean Pi needs a real arm64 asset to download.
- scripts/release.sh: one-shot local release. Cross-compiles, then creates/updates
  the Forgejo release and uploads de-versioned assets (devbox_<os>_<arch>) that
  install.sh fetches directly. No CI runner required.
- .forgejo + .github CI workflows: go vet + build + test -race on push/PR;
  on vX.Y.Z tag, build-release + publish. GitHub's runs on hosted runners today.
- docker-compose: pull the published hub image by default; --build for local source.
2026-06-23 13:31:54 -05:00
7f9eef7b3c docs: plan.md — PRD for what's next (releases+CI, M8a audit, dashboard depth) 🗺️ 2026-06-23 13:22:18 -05:00
dfc952301f docs: sync — M8 ✅ in roadmap table, v2/dashboard/install badges 📊⚡✅ 2026-06-23 13:18:25 -05:00
cb6ea8d3c2 docs: Install & Run section — curl|sh, keep-alive service, Docker NAS, FDA ⚡📦 2026-06-23 13:11:50 -05:00
94f7d3e782 fix(docker): chown /data so the non-root hub can write its DB 🐳🔑
The image runs as uid 10001; the VOLUME /data was root-owned so sqlite/blob
writes failed and the container exited on boot. Create + chown /data to the
devbox user before VOLUME/USER (a named volume inherits the image dir's
ownership). Verified on real arm64 docker (.13): builds, runs non-root, serves
/metrics + dashboard /api/state, 31.9MB. Also made install.sh's service setup
non-fatal (a failing systemctl --user / launchctl over headless SSH warns +
continues instead of aborting the whole install) — fleet-verified: systemd
user service enabled w/ Restart=always, NRestarts proved self-heal.
2026-06-23 13:10:44 -05:00
44e142fdf0 feat: cross-platform install scripts + hub Docker + macOS Full Disk Access 📦🐳🔐
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.
2026-06-23 13:05:16 -05:00
9f662cd476 refactor: drop unused param in dashboard online() (ponytail) 🦥 2026-06-23 12:47:50 -05:00
35d4d5dfd3 docs: README live-dashboard section + ponytail cleanup 📊🦥
- README: marquee Live Dashboard section (hero screenshot, --dashboard
  usage, how-it-works table, flow Mermaid), CLI table + TOC entries.
- ponytail: dropped a hand-rolled totalsInfo.MarshalJSON — struct json
  tags do the lowercase-key mapping for free.
2026-06-23 12:47:14 -05:00
9e93f8b3a0 feat: epic live dashboard frontend — mission-control flow viz 📊✨
Single self-contained index.html (vanilla JS + canvas, zero deps/CDN,
go:embed'd, air-gap safe). Cyberpunk net-ops aesthetic: a breathing glowing
hub core with counter-rotating rings, device nodes orbiting (online bright /
idle dim), magenta share nodes; on a push a trailed particle streams
device→core→share then a fan-out ripple to subscribers, joins burst in.
7 glassmorphism metric tiles with hand-drawn canvas sparklines + eased
counters; an auto-scrolling color-coded activity stream (capped 50); SSE
auto-reconnect with a live/reconnecting indicator; ?demo=1 synthesizes a
stream for the wow-factor and offline preview. Built by a worktree subagent
(frontend-design), screenshot-verified against the REAL hub backend — live
/api/state + /api/events both drive it (see docs/images/dashboard.png).
Added a 📦 data-URI favicon (kills the only console 404).
2026-06-23 12:44:52 -05:00
be4a30ef5d test: scripts/dashboard-fleet-verify.sh — live flow events on real hardware 🧪📊
Proves the dashboard SSE flow stream end-to-end on an isolated arm64 hub:
captures /api/events, then a device join + publish produce live 'join' and
'push' flow events on the stream. Green on .13: join(ubuntu) + push(team,
1 chunk, 15B, new_head) both streamed. Self-cleans; never touches the live .10.
2026-06-23 12:36:57 -05:00
2d407d418a feat: hub live dashboard backend — state + SSE flow stream 📊🛰️
Optional, off by default: devbox-hub serve --dashboard [--dashboard-addr
127.0.0.1:8099]. A separate, loopback-by-default listener (never widens the
API surface; warns if bound non-loopback since it's unauthenticated read-only).

- internal/hub/dashboard: embedded UI (go:embed index.html) + GET /api/state
  (hub/totals/devices/shares snapshot) + GET /api/events (SSE live flow stream).
  A nil *Dashboard is Emit-safe so hub handlers call it unconditionally.
- meta reads for the snapshot: Devices(), ShareStats() (one rolled-up query),
  SumChunkBytes(). 'online' is activity-tracked since hub start (2-min window).
- hub emits 'join' (device enrolled) and 'push' (device→share, bytes/chunks/
  snapshot/new_head) flow events.
Tests: state reflects the DB + a push event reaches a live SSE subscriber +
nil-safe Emit. index.html here is a placeholder — the epic frontend lands next.
2026-06-23 12:35:36 -05:00
41f93db7ac docs: add devbox setup wizard to the CLI reference 🧭 2026-06-23 12:22:27 -05:00
4fa2ef1369 feat: optional first-run setup wizard 🧭
Bare 'devbox' on a fresh, unjoined machine offers a step-by-step wizard:
  [Y] yes please   [n] no, I'm a devbox expert — don't ask again
'n' writes a setup-skipped marker in the config dir and never asks again;
'devbox setup' runs it explicitly anytime. The wizard owns the one fiddly
step (join: hub URL + token, with a hint where to get the token) then
points at mount/publish/start — mount stays a printed next-step, not a
reimplementation (ponytail). Gated on a real TTY so pipes/scripts are
never blocked; extracted a shared joinHub helper so the wizard and
'devbox join' don't diverge. Stdlib ModeCharDevice (no go-isatty).
Test: opt-out gate + don't-ask-again persistence.
2026-06-23 12:21:56 -05:00
05ebdeea77 refactor: ponytail-audit — drop the EffectiveRole delegating wrapper 🧹
It only called EffectiveMember and dropped one return; its sole prod
caller (the push gate) discarded that return anyway. Inline it: the gate
calls EffectiveMember directly and the test now targets the real method.
Kept blobstore.Store (single impl, but the documented M9 S3/R2 seam) and
control.Daemon (single impl, but breaks the daemon->control import cycle).
2026-06-23 11:52:25 -05:00
82307bd366 docs: M8 justified-now scope COMPLETE — restore byte-safety in, sidecar→M10 🏁📊
restore conflict-copy shipped (never-lose-a-byte on revert). Reframed the
conflict sidecar as M10 (only its resolver consumes it — ponytail) and
snapshot_chunks as M9. M8 nodes flipped green in both roadmap mermaids;
tables + §5.1/§5.5 updated. M9–M11 stay demand-driven.
2026-06-23 11:47:29 -05:00
abab3b5ff9 feat(M8): restore preserves uncommitted edits (never lose a byte) 🛟
Closes the audit's deferred #18 — the right way this time. An explicit
'devbox restore' no longer silently clobbers UNCOMMITTED local edits:

- captureUncommitted reads the bytes of any local file that differs from
  BOTH the snapshot being restored AND the current hub head (== an edit
  that was never pushed) BEFORE the restore overwrites/deletes it.
- After applySnapshot runs, those bytes are written back as .conflict-
  <host>-<ts> copies (discoverable via 'devbox conflicts', and they
  propagate like any conflict copy).

The head comparison is the key: a CLEAN restore (no uncommitted edits)
captures nothing and reproduces the snapshot exactly — TestRestoreWholeTree
still passes. Capture-before / write-after ordering means applySnapshot's
delete pass never eats the copy. Refactored the conflict-name probe into a
shared freeConflictName. Deploy stays as-is (read-only/pinned mounts have
no uncommitted edits to lose). New test: an uncommitted v3 survives a
revert to v1 as a conflict copy. 18 pkgs -race green; windows builds.
2026-06-23 11:44:45 -05:00
df4e617a34 docs: M8a teams COMPLETE + cross-machine fleet-verified 👥🌐📊
invites + members + write enforcement all shipped & proven on arm64 Pis
(.13 owner invited an editor, .15 redeemed and pushed). README CLI table
+ M8 rows + V2-SPEC §5.2 updated; 3 migrations verified on a real hub-DB
copy (0→1→2→3). M8-3 (sidecar/restore-copy) still the open M8 piece.
2026-06-23 11:38:27 -05:00