feat(shell): in-browser interactive container shell - #123
Merged
Conversation
…ws write-deadline/opcode/idempotent-close, dedup capped download
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.
An interactive shell into a running container, opened from its details panel —
the top roadmap item. Built with no new mandatory dependencies.
Transport — no dependency
internal/server/ws.go, RFC 6455scoped to text/binary + ping/pong/close). The protocol is frozen, so this
carries no upkeep or license to track. The binary grows by a handful of KB, not
a library.
GET /api/containers/{id}/shellupgrades, runs an exec with a PTY(
internal/docker/exec.go), and pumps bytes both ways: container→browser asbinary frames; browser→container, a binary frame is stdin and a text frame is a
{resize}control message.Terminal — fetched on demand, never bundled
served same-origin (
/api/term/{file}), so it loads under the app's CSP andadds nothing to the binary or the main JS bundle. The component lazy-imports it,
so anyone who never opens a shell pays zero cost.
Scope & safety
/apiauth as everything else; never exposed overMCP (an interactive PTY doesn't fit the request/response tool model and is too
large an agent surface).
the Shell tab for a running container when the backend advertises it.
Testing
server frames) and an end-to-end check against a real container (exec output
round-trips) both pass.
go build,go test ./...,npm run build, and thei18n catalog check pass.
Notes: the shell command probes for bash and falls back to sh. Input over a
remote connection has normal WebSocket latency; xterm needs network the first
time a shell is opened on a given browser (cached after).