Terminal

Browser terminal with recording, session list and an admin root terminal that needs step-up.

Available terminal version 1.0.1 Part of Files, terminal and editor

Actions

16 actions, callable from the panel, the command palette and the API as POST /api/v1/a/<id>. Internal actions used between modules are not listed.

ActionWhat it doesRiskPreview
terminal.session.open Open a terminal medium No dry run
terminal.root.open Open a root terminal critical
terminal.session.list List terminal sessions (read) low No dry run
terminal.session.kill Kill a terminal session medium No dry run
terminal.recording.list List recordings (read) low No dry run
terminal.recording.get Read part of a recording (read) low No dry run
terminal.recording.delete Delete a recording high
terminal.session.resume Re-attach to a running terminal medium No dry run
terminal.container.open Open a shell inside a container medium No dry run
terminal.snippet.list List your saved commands (read) low No dry run
terminal.snippet.set Save a command low
terminal.snippet.delete Delete a saved command low
terminal.prefs.get Your terminal display settings (read) low No dry run
terminal.prefs.set Change your terminal display settings low
terminal.loginscreen.get Is the RespireCloud login screen on? (read) low No dry run
terminal.loginscreen.set Turn the RespireCloud login screen on or off medium

Permissions and limits

Permissions

  • terminal.use Open a terminal in an account
  • terminal.view See terminal sessions and recordings
  • terminal.manage Kill sessions
  • terminal.root Open a root terminal on a server
  • terminal.recording.manage Delete recordings
  • terminal.snippet.manage Keep your own saved commands and display settings
  • terminal.loginscreen.manage Turn the RespireCloud login screen on or off
  • terminal.container Be handed a shell inside a container by the containers module

Plan limits

  • terminal.sessions Concurrent terminal sessions

Engineering notes

Generated from modules/terminal/docs.md at build 38156245. These are the notes the engineers keep next to the code: precise, technical, and honest about what is not done yet.

PTY on the account's server as the account Unix user (credential drop, in the account's cgroup slice — the agent creates a conservative rc-acct-<u>.slice with TasksMax 1024 if the limits module has not made one), env TERM=xterm-256color, UTF-8. No action runs a command (AC-terminal-21); the only entry is an interactive PTY.

Flow: terminal.session.open (limit terminal.sessions, sweep of dead sessions) -> agent terminal.pty.open -> single-use ticket (random 32 bytes, only sha256 stored, 30 s) -> gateway redeems with internal terminal.ticket.redeem (atomic UPDATE ... WHERE used_at IS NULL, caller must be the opener) -> stream on NATS rc.pty.<node>.<session>.{in,out,ctl} (node-scoped: the bus lets each agent touch only its own sessions) with credit-based flow control (initial 256 KiB, 16 KiB frames), reattach replays the last 256 KiB, idle warning at -60 s then close, max duration, asciinema v3 recording (output only unless RecordInput) to /var/lib/respirecloud/recordings/<session>.cast (0600). Closing kills the shell and every process left in its session (job-control children, fork bombs) but not setsid daemons (tmux). Root terminal: admin kind, no impersonation, fresh step-up, always recorded, audited with the reason.

Login screen (ADR 0032): terminal.loginscreen.set {enabled} (admin, dry run) puts RespireCloud's own screen where the distribution's advertisements were: at SSH login (Ubuntu update-motd.d, Debian and the RHEL family /etc/motd.d) and at the start of an administrator's root web terminal (the agent sets RC_WEB_MOTD=1 for root sessions; /etc/profile.d/respirecloud.sh prints the cached text once). A timer (respirecloud-motd.timer) runs rcctl motd refresh every minute into /run/respirecloud/motd (world-readable, no secrets) and writes /run/respirecloud/notices (<count> <worst level>) for the prompt. The stock messages are moved aside with dpkg-divert --local --rename (Ubuntu: help-text, motd-news, landscape-sysinfo, fwupd, ESM and release-upgrade adverts, hwe-eol, overlayroot, plus the update, reboot and fsck lines that the new screen carries; Debian: /etc/motd, 10-uname) or, on the RHEL family, by masking cockpit-motd.service and emptying a non-empty /etc/motd after saving it. What was done is recorded in /var/lib/respirecloud/loginscreen.json, and terminal.loginscreen.set {enabled:false} (or rcctl motd off) undoes exactly that. The prompt (user@host:path (branch), root in red, a badge when notices are open) is a PROMPT_COMMAND hook, so it works with every user's own .bashrc; opt out with ~/.config/respirecloud/prompt-off or RC_PROMPT=off. get says whether it is on. New installs turn it on (LOGIN_SCREEN=no skips). CLI: rcctl motd [refresh|install|off|status], rcctl notices [ack <id>]. UI: no toggle screen yet (see docs/tasks/w12/login-screen.handover.md).

Settings (module settings JSON): record_users (default false), idle_minutes 30, session_max_minutes 480. Next: shadow/live view, snippets, bubblewrap cage, recording encryption + storage upload, retention sweeper, package/account/sub-user disable hooks, kill on suspension.