fix: refresh image-managed dotfiles over the home volume on start (#89) - #91
Merged
Conversation
The pull/compose deployment path mounts only squarebox-home:/home/dev, so the named volume shadows the image-baked dotfiles (.bashrc, starship.toml). Docker seeds a volume from the image only at first creation, so upgraded containers silently keep whatever dotfile shipped when their volume was born — dotfile updates never reach them. This already bit rc1→rc2: PR #88's fzf keybindings stayed dead on upgraded shells. Fix: ship the managed dotfiles to a non-volume path (/usr/local/lib/squarebox/dotfiles/) and have squarebox-entrypoint run refresh-dotfiles.sh on every start to re-seed them over the volume copy. The refresh skips any path the operator bind-mounted (the desktop install path), so host-managed files are never clobbered, and is best-effort (never aborts boot). Done as root before the privilege drop so files get the resolved PUID:PGID. Verified in a real container: staled volume bashrc is restored from the image, and a read-only bind-mounted host bashrc is preserved untouched. - scripts/squarebox-refresh-dotfiles.sh: new, single source of truth - squarebox-entrypoint: call it at both exec points - Dockerfile: ship managed dotfiles to the non-volume source path - e2e: new `dotfiles` suite (5 tests), wired into the sqrbx-update CI job - uat-checklist: manual cross-version upgrade scenario - docs: CLAUDE.md + bashrc header explain the dual mechanism Closes #89 Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Closes #89. v1.0 blocker — the bug lives in v1.0's headline feature (pull/compose upgrades).
Problem
docker-compose.yml/ the GHCR install mounts onlysquarebox-home:/home/dev, so the named volume shadows the image-baked dotfiles (.bashrc,starship.toml). Docker seeds a volume from the image only at first creation, so upgraded containers silently keep whatever dotfile shipped when their volume was born — image updates never reach them.This already bit
rc1→rc2: PR #88's fzf keybindings stayed dead on upgraded shells. It also made #90 (sqrbx-help) embarrassing — the MOTD advertised a help screen documentingCtrl+R/Ctrl+Tshortcuts that were dead on those same upgraded containers.Fix
/usr/local/lib/squarebox/dotfiles/) the volume can't shadow.squarebox-entrypointruns newrefresh-dotfiles.shon every start, re-seeding.bashrc/starship.tomlover the (possibly stale) volume copy.set -uo pipefail, alwaysexit 0,|| true) → a dotfile refresh can never abort container boot.PUID:PGID.Verification (real containers,
docker build+ run)dotfilessuite, 5/5: source present, refresh installed, live~/.bashrcmatches image source (proves start-time refresh ran), staled bashrc restored, refresh exits 0.bashrcpreserved untouched (mountpoint guard).Changes
scripts/squarebox-refresh-dotfiles.sh(new) — single source of truthscripts/squarebox-entrypoint.sh— call it at both exec pointsDockerfile— ship managed dotfiles to the non-volume source + chmodscripts/e2e-test.sh— newdotfilessuite, wired into thesqrbx-updateCI job (which gatespublish)uat-checklist.md— manual cross-version upgrade scenario (e2e only simulates within one image)CLAUDE.md+dotfiles/bashrcheader — document the dual mechanismAfter this lands I'd cut
v1.0.0-rc3, run the manual upgrade UAT, then tagv1.0.0.🤖 Generated with Claude Code