Repository navigation
feat(config): expose FUSEY_ALLOW_OTHER env var, default true - #24
Merged
Merged
Conversation
fusey previously hardcoded `AllowOther: false` on the FUSE mount, which meant the mount was only accessible to the UID that called `mount(2)`. This broke sandbox deployments where the fusey daemon runs as root (because the container is privileged and the mounter needs CAP_SYS_ADMIN) while the consumer process — typically an agent-server running as a non-root user — has to read and write files on the mount. With `allow_other` disabled, the kernel rejects the consumer's VFS operations on the mount before fusey's permission code even runs. Introduce a `FUSEY_ALLOW_OTHER` env var (parsed via the existing `parseBoolEnv` helper, so accepts Go's `strconv.ParseBool` spellings: `true`/`false`/`1`/`0`/`t`/`f`/`T`/`F`/etc.) plumbed into a new `Config.AllowOther` field. Default it to `true` since fusey's typical deployment cannot function without it; `FUSEY_ALLOW_OTHER=false` opts back into the FUSE default for environments where access must be restricted to the mounter's UID. - internal/config: `DefaultAllowOther = true`, `Config.AllowOther`, `Load()` reads `FUSEY_ALLOW_OTHER`. - cmd/fusey: `AllowOther: false` → `AllowOther: cfg.AllowOther` on the `gofs.Mount` call. - internal/config: extend `TestLoadDefaults`, `TestLoadEnvOverrides`, and `TestLoadBadValues`; add `TestLoadAllowOther` covering the common true/false spellings. - README.md: document `FUSEY_ALLOW_OTHER` in the env-var table. Tested: `go test ./...` (CGO_ENABLED=0) passes all packages. Co-authored-by: openhands <openhands@all-hands.dev>
The previous commit introduced the FUSEY_ALLOW_OTHER env var and plumbed it through Config.AllowOther to the FUSE mount. This commit makes the formal mount specification aware of the new configuration knob so the spec stays the source of truth (per AGENTS.md §"Key design decisions" #1, "Specs before code"). mount.qnt changes: - Preamble: add a new "Configuration (resolved from environment variables at startup)" section between "Mount log" and "CLI dispatch surface". It documents FUSEY_ALLOW_OTHER alongside the existing CLI-surface section, including: * what the option does (allow_other mount, default true, kernel default is false) * why fusey defaults to true (consumer UID != daemon UID in the typical runtime-api sandbox) * an explicit scope note: this spec does NOT model the lifecycle differently based on ALLOW_OTHER; the option is consumed at the DaemonStarting → DaemonReady transition and either succeeds (fsAccessible = true with that option in effect) or fails (daemonMountFails, which covers the /etc/fuse.conf case where the kernel refuses allow_other). - Module body: add `const ALLOW_OTHER: bool` to the new Constants section. Modeled as a constant rather than a state variable because the value is read once from the environment at startup and never changes during the daemon's lifetime. A spec is a single-configuration slice; quint verifies invariants under each value of ALLOW_OTHER. - No new actions or invariants: the lifecycle state machine does not branch on ALLOW_OTHER, and adding a no-op invariant like `allowOtherIsConfigurationOnly = true` would be a tautology. Existing invariants (fsAccessibleIffDaemonReady, pidFileExistsWhileReachable, indexFlushedOnStop, ...) hold under both ALLOW_OTHER = true and ALLOW_OTHER = false. Note on spec validation: the spec file has a pre-existing parse error against the current Quint release (the multi-assignment init action syntax is not accepted by quint >= 0.32). This is unrelated to the present change — the same parse error exists on origin/main at specs/mount.qnt:122. Tracking that as a separate concern; the spec is not currently exercised by CI (.github/workflows/ci.yml runs only go vet + go test). Co-authored-by: openhands <openhands@all-hands.dev>
tofarr
marked this pull request as ready for review
July 27, 2026 14:32
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
fusey currently hardcodes
AllowOther: falseon the FUSE mount, which means the mount is only accessible to the UID that calledmount(2). This breaks sandbox deployments where the fusey daemon runs as root (because the container is privileged and the mounter needsCAP_SYS_ADMIN) while the consumer process — typically an agent-server running as a non-root user — has to read and write files on the mount. Withallow_otherdisabled, the kernel rejects the consumer's VFS operations on the mount before fusey's permission code even runs.This PR introduces a
FUSEY_ALLOW_OTHERenv var plumbed into a newConfig.AllowOtherfield, defaulting totruesince fusey's typical deployment cannot function without it. Operators who need to restrict access to the mounter's UID can setFUSEY_ALLOW_OTHER=false.Changes
internal/config/config.go— newDefaultAllowOther = trueconstant, newAllowOtherfield onConfig,Load()parsesFUSEY_ALLOW_OTHERvia the existingparseBoolEnvhelper (accepts Gostrconv.ParseBoolspellings:true/false/1/0/t/f/T/F/...).cmd/fusey/main.go—AllowOther: false→AllowOther: cfg.AllowOtheron thegofs.Mountcall inrunDaemon.internal/config/config_test.go— extendTestLoadDefaults,TestLoadEnvOverrides, andTestLoadBadValues; newTestLoadAllowOthercovering the common true/false spellings.README.md— documentFUSEY_ALLOW_OTHERin the env-var table.Test plan
go test ./...(withCGO_ENABLED=0) passes all packages (cmd/fusey,internal/chunks,internal/compaction,internal/config,internal/fuse,internal/index).trueand thatFUSEY_ALLOW_OTHER=falseoverrides it.mustLoadConfigwithout error whenFUSEY_ALLOW_OTHERis unset (i.e. default applies).Why default
true(notfalse)?The FUSE default is
false, but fusey's only real consumer (the runtime-api sandbox) cannot operate with that default — the consumer is a non-root agent-server and the daemon must run as root to acquireCAP_SYS_ADMIN. Defaulting tofalsewould silently break the sandbox for every deployment that doesn't set the env var. The default-true/opt-outflip matches the principle that the safe-but-useful choice should be the default; the env var is the explicit kill-switch for environments that need it.Compatibility
Behavior change for existing users who relied on the implicit
falsedefault: any user on the host will now be able to access the fusey mount. In practice this is the desired behavior; if anyone has a deployment where fusey mounts are exposed to untrusted users, they should setFUSEY_ALLOW_OTHER=falseexplicitly. The runtime-api pod topology doesn't expose the mount to other pods, so this is a non-issue for the primary deployment.Related
Companion change to runtime-api PR #679 (single-privileged-container with
suwrapper for the agent-server). Once this lands and is released asv0.0.13, runtime-api can drop therunuser -u openhandsstep in_mount_fusey_workspaceand rely onFUSEY_ALLOW_OTHER=truefor kernel-level access.