core/backend/modules/terminal/README.md
enzo 5dbcb1df07 feat: initialisation complète du CORE ProxmoxPanel
Backend Go 1.23+ :
- API REST + WebSocket (chi, gorilla/websocket)
- Authentification PAM via SSH + JWT RS256
- Chiffrement AES-256-GCM pour secrets SQLite
- Pool SSH, client Proxmox REST, hub WebSocket pub/sub
- Système de modules compilés à initialisation conditionnelle
- Audit log, migrations SQLite versionnées

Frontend Vue 3 + Vite + TypeScript :
- Thème Neumorphism sombre/clair (CSS custom properties)
- Wizard d'installation, Dashboard drag-drop, Terminal xterm.js
- Toutes les vues CORE + stubs modules optionnels
- i18n EN/FR (vue-i18n v11)

Infrastructure :
- Docker multi-stage (Go → alpine, Node → nginx)
- docker-compose.yml, .gitattributes, LICENSE MIT, README

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 21:08:53 +01:00

1.6 KiB
Raw Blame History

Module — Terminal

Type: Optional (disabled by default)

Interactive SSH terminal in the browser. Connects to the Proxmox host (or any SSH-accessible target) and opens a full PTY session via WebSocket.

Features

  • Full PTY support (xterm-256color, interactive shell)
  • Responsive resizing — the terminal adjusts when the browser window is resized
  • Terminal theme matches the panel's Neumorphism dark/light design
  • Audit log entry on open and close

WebSocket Endpoint

GET /ws/terminal?token=<jwt>&host=<optional-override>

If host is not specified, the SSH host configured during installation is used.

Message Format

Client → Server (keyboard input): raw binary bytes

Client → Server (resize event): JSON text frame

{ "type": "resize", "cols": 120, "rows": 40 }

Server → Client (terminal output): raw binary bytes

Frontend

Uses xterm.js with the following addons:

  • @xterm/addon-fit — auto-resize to container dimensions
  • @xterm/addon-attach — attach xterm directly to a WebSocket

How It Works

  1. WebSocket connection is established and JWT is validated
  2. Backend opens an SSH connection using stored credentials
  3. A PTY session is requested (xterm-256color, initial size 80×24)
  4. An interactive shell is launched
  5. All data flows bidirectionally: WebSocket ↔ SSH ↔ PTY

Requirements

  • SSH access to the target host (password authentication)
  • The ssh_host, ssh_username, ssh_password settings must be configured

License

MIT — see LICENSE