Ir al contenido

Ultimate Terminal

TypeScript Node.js Socket.io React + Vite Docker .deb Playwright e2e

GitHub: stevenvo780/ultimate-terminal


Ultimate Terminal is a distributed terminal system that lets you open a shell on any Linux machine in your fleet from a single browser tab — no SSH juggling, no per-host clients. It follows a three-tier architecture:

ComponentRolePort
NexusRelay server. Authenticates workers and browser clients, routes I/O, manages sessions.3002 (default)
WorkerLightweight agent running on each target machine. Connects to Nexus via Socket.io.N/A (outbound)
ClientReact + Vite web UI. Lists all connected workers; opens terminal sessions; renders output.5173 (dev) / 13003 (Docker)

Sessions persist in-memory inside Nexus while workers are online. Multiple browser tabs can join the same session simultaneously.


  • One-command worker install — curl script pulls a prebuilt .deb (Ubuntu 20.04 / 22.04 / 24.04, Debian, Kali, Mint, Pop!) or compiles from source on other distros / GLIBC mismatches.
  • JWT-authenticated API — setup token for first boot; per-worker API keys afterwards.
  • Docker dev stackdocker-compose.dev.yml spins up 8 workers simultaneously to simulate load and validate the UI at scale.
  • Docker prod stackdocker-compose.prod.yml with Nexus + Worker + Client, health-checked service dependencies, and a named volume for Nexus persistence.
  • Playwright e2e tests — full terminal interaction tested end-to-end: login, list workers, open session, persist on reload.
  • GitHub Actions CI — every worker-v* tag builds .deb packages for all three Ubuntu LTS versions in parallel and publishes them to GitHub Releases.

Browser (Client UI)
│ WebSocket (Socket.io)
┌─────────────────────────┐
│ Nexus :3002 │ JWT auth · REST API · session relay
│ SQLite persistence │
└──────────┬──────────────┘
│ WebSocket (Socket.io)
┌────────┴────────┐
│ │
Worker-01 Worker-N
(your PC) (VPS / homelab)

Each worker connects outbound to Nexus — no inbound firewall rules needed on target machines.


Ventana de terminal
curl -fsSL https://raw.githubusercontent.com/stevenvo780/ultimate-terminal/main/packaging/universal_install.sh \
| sudo NEXUS_URL=<your-nexus-url> WORKER_NAME=<hostname> bash -s -- <API_KEY>

The installer detects your distro from /etc/os-release, downloads the matching .deb, and falls back to building from source on unsupported distros.


EndpointDescription
POST /api/auth/setupFirst-boot admin creation (requires NEXUS_SETUP_TOKEN if set)
POST /api/auth/loginReturns JWT for { username?, password }
POST /api/auth/registerRegister additional users (validated against setup token)
POST /api/auth/passwordChange password (authenticated)
GET /api/workersList all registered workers
POST /api/workersRegister a new worker; returns API key
DELETE /api/workers/:idRemove a worker (rejected if currently online)
GET /api/auth/statusHealth-check used by Docker compose
DirectionEventPurpose
Client → NexussubscribeSubscribe to a worker’s output stream
Client → NexusexecuteSend a command to a worker
Client → NexusresizeResize the terminal PTY
Client → Nexusjoin-sessionJoin an existing session
Client → Nexusleave-sessionLeave a session
Nexus → Clientworkers / worker-listLive worker roster updates
Nexus → Clientsession-listActive session list for a worker
Nexus → ClientoutputTerminal output from a worker
Nexus → Clientsession-closedSession terminated notification
Worker → NexusheartbeatKeepalive
Worker → NexusoutputPTY output chunks
Worker → Nexussession-shell-exitedShell process exited

Releases are fully automated via GitHub Actions. To cut a new worker release:

Ventana de terminal
git tag -a worker-v1.0.1 -m "Worker v1.0.1"
git push origin worker-v1.0.1

In about 5 minutes, Actions builds and publishes:

  • ultimate-terminal-worker_<version>_ubuntu20.04_amd64_x86_64.deb
  • ultimate-terminal-worker_<version>_ubuntu22.04_amd64_x86_64.deb
  • ultimate-terminal-worker_<version>_ubuntu24.04_amd64_x86_64.deb
  • worker-source-prebuilt.tar.gz

Three jobs run in parallel (one per Ubuntu LTS), each building inside the matching Ubuntu container so the embedded Node binary links against the correct GLIBC.


Ventana de terminal
# Type-check all workspaces
npx tsc --noEmit --project nexus/tsconfig.json
npx tsc --noEmit --project worker/tsconfig.json
# Lint client
npm run lint --workspace=client
# Playwright e2e (requires full stack running)
# Nexus on :13002, Client on :13003, Worker connected
npx playwright test tests/terminal-e2e.spec.ts
npx playwright test tests/multi-client.test.ts
# Integration tests (vitest)
npm run test:e2e

The e2e suite covers: login, wait for worker online status, create session, execute command, verify output, persist session on reload.


LayerTechnology
NexusNode.js + TypeScript + Express + Socket.io
WorkerNode.js + TypeScript + node-pty
ClientReact 18 + Vite + TypeScript
AuthJWT (jsonwebtoken) + per-worker API keys
Persistencebetter-sqlite3 (Nexus session metadata)
Packaging@yao-pkg/pkg.deb + systemd unit
ContainerDocker Compose (dev: 8 workers; prod: 3 services)
CIGitHub Actions (matrix: Ubuntu 20.04 / 22.04 / 24.04)
TestsPlaywright e2e + Vitest integration