1.8 KiB
1.8 KiB
Architecture (Community Edition)
中文版请见:ARCHITECTURE.md
1. Overview
WebSSH Gateway follows a frontend-backend architecture:
- Frontend: user interaction, terminal UI, file and monitoring panels
- Backend: authentication, session orchestration, SSH bridge, and APIs
flowchart LR
U[Browser User] --> F[Frontend React + xterm]
F -->|HTTP| B[Backend FastAPI]
F -->|WebSocket| B
B --> DB[(SQLite)]
B --> S[(Remote SSH Hosts)]
B --> K[session-transfer-files/tmux]
2. Backend Modules
app/main.py: app bootstrap and route mountingapp/api/: REST and WebSocket handlersapp/services/: auth, crypto, SSH/session core logicapp/models/: SQLAlchemy modelsapp/core/: config, db, logging, state composition
3. Frontend Modules
src/pages/Login.tsxsrc/pages/Sessions.tsxsrc/pages/Terminal.tsxsrc/components/FileBrowser.tsxsrc/components/SystemMonitor.tsxsrc/lib/api.tssrc/context/AppContext.tsx
4. Critical Flows
- Auth flow:
/auth/login-> JWT -> protected APIs - Session flow: create session -> connect terminal WebSocket -> stream input/output
- Enhanced persistence: disconnected sessions are retried by background workers
5. Security Baseline
- AES-GCM encrypted credential storage
- JWT issuer validation
- Password policy and forced password change
- Lockout policy for repeated failed logins
- Request-id logging for traceability
6. CE vs Paid Edition
The Community Edition provides complete self-hosted core SSH gateway capabilities. There is an intention to explore a paid development direction, while detailed scope, delivery model, and timeline are TBD. Until then, CE continues as the independently deployable open-source edition.