webgui: run as the bind-mount owner so foresters need no --user flag#25
Merged
Conversation
The webgui image ran as the baked-in non-root `fvs` user. On Docker Desktop (macOS/Linux) a bind-mounted host folder (`-v ~/fvs-projects:/work`) is presented owned by the host user, which `fvs` can't write -- so fvsOL's dir.create()/setwd() for a NEW project fails with "Permission denied" and the observer crashes. Reading a pre-existing project works, which is why a basic click-through missed it; creating/saving a project is the first real write to /work. Fix: an entrypoint (docker/webgui-entrypoint.sh) starts as root and gosu-drops to the uid/gid that owns /work, so the GUI process matches the mount owner and can write -- new project files land owned by the forester on the host. Falls back to `fvs` when /work is unmounted/root-owned (CI smoke test, named volume). The plain documented `docker run -v <host>:/work ...` command now works with no --user flag. Removed `USER fvs` from the webgui target (container starts as root, entrypoint drops privileges); added gosu. Engine/cluster target unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 tasks
RoopsyDaisy
pushed a commit
that referenced
this pull request
Jun 3, 2026
The webgui permission bugs (#25, then its uid==0 fallback) shipped because the smoke test never wrote into /work, so CI couldn't tell that the GUI process can't create a project there. Add a webgui-only guard that does the same write fvsOL does (a dir under /work) through the entrypoint-selected user. In CI /work is root-owned and unmounted, so a non-root runtime user (the #25 fvs-on-uid-0 fallback) fails this guard; running as the mount owner (root, per #26) passes. Cluster image skips it (no fvsOL; it runs as fvs against a separately-bound cwd). Locks the permission class so a future entrypoint change can't silently reintroduce it. https://claude.ai/code/session_011C6wxKosiwHnEYvAPJfmcW
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.
The webgui image ran as the baked-in non-root
fvsuser. On Docker Desktop (macOS/Linux) a bind-mounted host folder (-v ~/fvs-projects:/work) is presented owned by the host user, whichfvscan't write -- so fvsOL's dir.create()/setwd() for a NEW project fails with "Permission denied" and the observer crashes. Reading a pre-existing project works, which is why a basic click-through missed it; creating/saving a project is the first real write to /work.Fix: an entrypoint (docker/webgui-entrypoint.sh) starts as root and gosu-drops to the uid/gid that owns /work, so the GUI process matches the mount owner and can write -- new project files land owned by the forester on the host. Falls back to
fvswhen /work is unmounted/root-owned (CI smoke test, named volume). The plain documenteddocker run -v <host>:/work ...command now works with no --user flag.Removed
USER fvsfrom the webgui target (container starts as root, entrypoint drops privileges); added gosu. Engine/cluster target unchanged.What & why
Checklist
tests/unitortests/integration), or N/A.data/README.md).