Skip to content

Give the sbx CLI its cache and state paths in the drukbox containers - #750

Merged
czpython merged 1 commit into
mainfrom
sbx-cache-state-paths
Sep 28, 2026
Merged

czpython merged 1 commit into
mainfrom
sbx-cache-state-paths

Conversation

@czpython

Copy link
Copy Markdown
Owner

The drukbox gateway tunnel runs sbx ssh proxy in the gateway container. The container has no home directory for the deploy uid. Then sbx finds no feature flags, sees the daemon's SSH endpoint as off, and the tunnel fails with "the sandboxd SSH endpoint is disabled".

Changes in the x-sbx-rig and x-sbx-env anchors of deploy/compose.docker-sbx.yaml, so every drukbox service gets them:

  • The overlay mounts the directory of the daemon socket, not the socket file. A daemon restart makes a new socket, and a file mount keeps the old one until the containers are recreated.
  • The overlay mounts the sbx cache, .cache/sandboxes, where sbx keeps its feature flags.
  • XDG_CACHE_HOME and XDG_STATE_HOME point the CLI to the mounts. sbx ssh proxy finds the socket through XDG_STATE_HOME only. DOCKER_SANDBOXES_API now names the socket inside the mounted directory, for the other commands.
  • install.sh creates .cache/sandboxes with the deploy user's owner, as it does for .config/sandboxes. Docker would create a missing bind source as root.

The mounts match the container recipe in czpython/drukbox#62. Refs czpython/drukbox#61.

The gateway tunnel runs `sbx ssh proxy`. It reads the feature flags from
the sbx cache and dials the daemon socket through XDG_STATE_HOME, so
without them the tunnel sees the SSH endpoint as off. The overlay now
mounts the sbx cache and the directory of the daemon socket, and sets
XDG_CACHE_HOME and XDG_STATE_HOME. A directory mount keeps the new
socket after a daemon restart. install.sh creates the cache directory
with the deploy user's owner.
@czpython
czpython merged commit f569a01 into main Sep 28, 2026
3 checks passed
@czpython
czpython deleted the sbx-cache-state-paths branch September 28, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant