fix(snap): isolate CLI XDG paths from host environment#1995
Closed
krishicks wants to merge 1 commit into
Closed
Conversation
The Ubuntu Snap release canary is failing because GitHub-hosted runners set `XDG_CONFIG_HOME=/home/runner/.config`, and the strict OpenShell snap currently honors that host path. As a result, `openshell gateway add` tries to persist gateway metadata under `/home/runner/.config/openshell/...` instead of the snap-owned user directory, and strict snap confinement blocks the write. The snap should set its user-facing app XDG paths explicitly to snap-owned locations under `$SNAP_USER_COMMON`, so host-defined `XDG_*` variables cannot redirect CLI or TUI state outside the snap sandbox. The docs update also removes stale `--classic` Snap install examples, since the OpenShell snap is strict-confined rather than classic-confined. Signed-off-by: Kris Hicks <khicks@nvidia.com>
|
🌿 Preview your docs: https://nvidia-preview-pr-1995.docs.buildwithfern.com/openshell |
elezar
reviewed
Jun 25, 2026
Comment on lines
+80
to
+82
| assert_occurrences "$snapcraft" 'XDG_CONFIG_HOME: "$SNAP_USER_COMMON/xdg-config"' 2 | ||
| assert_occurrences "$snapcraft" 'XDG_DATA_HOME: "$SNAP_USER_COMMON/xdg-data"' 2 | ||
| assert_occurrences "$snapcraft" 'XDG_STATE_HOME: "$SNAP_USER_COMMON/xdg-state"' 2 |
Member
There was a problem hiding this comment.
As I asked in #1972 what is the purpose of testing something that we define ourselves?
elezar
reviewed
Jun 25, 2026
Comment on lines
+65
to
+68
| environment: | ||
| XDG_CONFIG_HOME: "$SNAP_USER_COMMON/xdg-config" | ||
| XDG_DATA_HOME: "$SNAP_USER_COMMON/xdg-data" | ||
| XDG_STATE_HOME: "$SNAP_USER_COMMON/xdg-state" |
Member
There was a problem hiding this comment.
Any preference on these directories vs those from #1972?
Collaborator
Author
7 tasks
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.
Summary
The Ubuntu Snap release canary is failing because GitHub-hosted runners set
XDG_CONFIG_HOME=/home/runner/.config, and the strict OpenShell snap currently honors that host path. As a result,openshell gateway addtries to persist gateway metadata under/home/runner/.config/openshell/...instead of the snap-owned user directory, and strict snap confinement blocks the write.The snap should set its user-facing app XDG paths explicitly to snap-owned locations under
$SNAP_USER_COMMON, so host-definedXDG_*variables cannot redirect CLI or TUI state outside the snap sandbox.The docs update also removes stale
--classicSnap install examples, since the OpenShell snap is strict-confined rather than classic-confined.Related Issue
Changes
Testing
mise run pre-commitpassesbash tasks/scripts/test-packaging-assets.shChecklist