Repository navigation
fix: enforce lowered disk limit, keep attached output, show UI on reopen and quit - #21
Merged
Merged
Conversation
…pen and quit - Disk limit: the VM disk only ever grew, so lowering the limit (64 → 16 GB) was ignored. Apply & Restart now stops Docker, shrinks the disk offline in the builder VM (e2fsck, resize2fs with headroom, GPT rewritten for the new size), truncates the image and starts Docker again. An APFS clone is kept until it succeeds and put back on failure or an interrupted run; data that does not fit is refused with a limit that would fit, and the setting goes back to the real disk size. `DockZ shrink-disk` does the same headless. Monitor shows used space against the limit (80% / 95% colours) plus the Mac's free space. - Attached output: the guest's socat relays used the default -t 0.5, so a docker CLI half-close cut hijacked streams after half a second (`docker run` without -d lost everything printed later). All relays now keep the other direction open. Guest rootfs files baked into disk.img never got such fixes, so every boot now syncs the app's copy into the VM (boot-path files excluded) and restarts changed services. - Reopening DockZ while its menu bar icon is hidden shows the dashboard; a user launch opens it, Launch at Login stays quiet. - Quitting shows a "Shutting down DockZ…" window listing what is stopped. Tests: 321 checks pass (61 new). Verified on a throwaway data root: new disks are created at the limit; shrink 24 → 8 GB refused with the disk unchanged, 24 → 16 GB done in 18 s with file checksums intact after boot; an old-image VM got the new agent on its first boot and `echo start; sleep 6; echo end`, exec, piped stdin and logs -f all stream fully. The output fix was also confirmed on a real install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Deploying dockz with
|
| Latest commit: |
a183fe3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e0a1caa1.dockz.pages.dev |
| Branch Preview URL: | https://fix-reopen-shows-dashboard.dockz.pages.dev |
…data folder - The post-shrink e2fsck ran with its output discarded, so a failure seen once on a real disk (and not reproduced in 6 later runs on a copy of it) left only "did not check clean". Its output and exit code now go to builder/shrink.log. - Tests ran against the default data root, so code under test wrote into the user's ~/.dockz/host.log (and settings loads could save a default config there). The test runner now points every DockzPaths() in its process at a temporary folder, with a check that it did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Four user-reported problems, each fixed at the layer every instance goes through:
e2fsck,resize2fswith headroom, GPT rewritten for the new size) → truncates → starts Docker. An APFS clone is kept until success and restored on failure or interruption; data that doesn't fit is refused with a limit that would fit.DockZ shrink-diskdoes the same headless. Monitor shows used vs. limit (orange ≥80%, red ≥95%) plus the Mac's free space.docker runlost output after 0.5 s. The guest's socat relays used the default-t 0.5; the docker CLI half-closes hijacked streams right after attaching, so later output was cut (echo start; sleep 3; echo endprinted onlystart). All relays now keep the other direction open. Because guestrootfs/files are baked intodisk.img, every boot now syncs the app's copy into the VM (boot-path files excluded) and restarts changed services — existing installs get this and future guest fixes.Checklist
swift run -c release DockzApp testpasses locally (321 checks, 61 new)test-runner.swiftHow I verified it
On a throwaway data root (
-dockz.storageRoot /tmp/dzs):disk.img).vda16.0 GiB, no GPT warnings, fs grown to fill.shrink-diskrefuses while DockZ holds the data folder.dockz-agenton first boot;runwith 6 s gap,exec, piped stdin (-i, EOF still delivered) andlogs -fstream fully; second boot rewrites nothing.start/end).Not clicked through: the Settings Apply → confirm → shrink overlay path in the GUI (it calls the same
DiskShrinkertested above), and reopen-while-running end-to-end.🤖 Generated with Claude Code