-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
Summary
Add a --terminal flag that exposes a WebSocket endpoint at /.terminal for interactive shell access. Combined with an xterm.js pane, this gives pod owners a full terminal in the browser.
Implementation
~30 lines in the WebSocket handler:
import { spawn } from 'child_process'
// On WebSocket connect to /.terminal
const shell = spawn('/bin/sh', { env: process.env })
ws.on('message', data => shell.stdin.write(data))
shell.stdout.on('data', data => ws.send(data))
shell.stderr.on('data', data => ws.send(data))
shell.on('exit', () => ws.close())Security
- Owner-only: requires authentication (DPoP/Solid OIDC)
- Disabled by default, opt-in via
--terminal - Only accessible to the pod owner (ACL check)
Use case
Developers using losos as a phone OS / pod browser need shell access. Rather than installing ttyd as a separate process, JSS provides it natively. The terminal pane in nosdav/browser connects xterm.js to this endpoint.
No extra dependencies
- xterm.js loads from CDN in the browser pane
- Shell spawning uses Node.js built-in
child_process - WebSocket infrastructure already exists (
--notifications)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels