Skip to content

feat(examples): web-terminal example (bash in the browser via ttyd) - #30

Draft
jbouder wants to merge 1 commit into
mainfrom
feat/web-terminal-example
Draft

jbouder wants to merge 1 commit into
mainfrom
feat/web-terminal-example

Conversation

@jbouder

@jbouder jbouder commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

examples/web-terminal/ — an interactive bash shell in the browser via ttyd, launched by the pack's pixi runtime. No Python code and no image build: pixi.toml pulls ttyd plus a working toolset from conda-forge — vim, nano, git, gh, curl, wget, ssh, jq, yq, ripgrep, fd, bat, htop, tree, less, tmux, fzf, make, zip/unzip, Python 3.12. SSO-gated (access.public: false) because it's a shell.

Files: pixi.toml, pixi.lock, terminal.sh (per-session launcher), bashrc, nebari-app.yaml; plus a README row.

Notes for reviewers

  • App pods run as UID 65532 with no /etc/passwd entry, so bash shows I have no name! and whoami/ssh fail. terminal.sh fixes this with nss_wrapper where conda-forge builds it (linux-64) and falls back to a $USER prompt elsewhere (linux-aarch64, e.g. kind on Apple Silicon). The proper fix is in the pack — a passwd entry for 65532 in the pythonImage, or an operator-mounted /etc/passwd — and would remove the per-app hack. Happy to follow up.
  • ttyd -W is required: ttyd ≥ 1.7 defaults to read-only.

Test plan

  • Local: pixi install --locked; all tools resolve in the env; pixi run start serves ttyd on 8080 (200, 101 websocket upgrade); terminal.sh session starts cleanly.
  • Cluster (nebari-local, kind/aarch64): App Running; all 21 tools + python resolve in /app/.pixi/envs/default/bin; anonymous request gets a 302 to Keycloak; session opens with a clean nebari@<pod>:~$ prompt.
  • Verify the nss_wrapper path on a linux-64 cluster (not available to me).

🤖 Generated with Claude Code

https://claude.ai/code/session_011pSHMjZBVyZL2ufWiiveTZ

@jbouder
jbouder marked this pull request as draft October 9, 2026 23:52
A pixi-launched example that runs an interactive shell in the browser:
ttyd shares a bash session over a websocket, rendered with xterm.js. No
Python code and no image build — pixi.toml pulls ttyd plus a working
toolset from conda-forge (vim, nano, git, gh, curl, wget, ssh, jq, yq,
ripgrep, fd, bat, htop, tree, less, tmux, fzf, make, zip/unzip, Python).
SSO-gated (access.public: false) because it is a shell.

App pods run as UID 65532 with no /etc/passwd entry, so bash shows
"I have no name!" and whoami/ssh fail. terminal.sh runs per session and
fixes this with nss_wrapper where conda-forge builds it (linux-64), falling
back to a $USER-based prompt elsewhere (e.g. linux-aarch64 kind nodes);
bashrc adds a prompt, default git identity and a few aliases.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011pSHMjZBVyZL2ufWiiveTZ
@jbouder
jbouder force-pushed the feat/web-terminal-example branch from 17b5d3d to d569028 Compare October 10, 2026 13:06
@jbouder jbouder changed the title feat(examples): web-terminal and kv-service (REST API + CLI) examples feat(examples): web-terminal example (bash in the browser via ttyd) Oct 10, 2026
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