How sunset-go/sshportforward works
This is a desktop SSH port-forwarding manager: users configure hosts and authentication, define forwarding rules, connect to create tunnels, and inspect connection status, traffic, and logs. Vue components manage these workflows through shared composables and Tauri commands; Rust handlers persist configuration and control SSH sessions. The top-level README describes a starter template rather than the product, so the architecture is inferred from the source index and excerpts. Some frontend-to-command mappings are not shown directly and are marked unverified.
Main entry points: AppShell.vue App shell · useSshTunnel.ts Tunnel state · commands Tauri commands · tunnel.rs Tunnel commands
Components 24
Desktop interface
- App shell
src/components/layout/AppShell.vue - Host management
src/components/dialog/AddHostDialog.vue - Connection panel
src/components/panels/ConnectPanel.vue - Forwarding rules
src/components/PortForwardPanel.vue - Rule table
src/components/RuleTable.vue - Authentication fields
src/components/common/AuthFields.vue - Log console
src/components/LogConsole.vue - Sidebar and hosts
src/components/layout/SideBar.vue - Settings panel
src/components/panels/SettingsPanel.vue
Frontend state
- Tunnel state
src/composables/useSshTunnel.ts - Settings state
src/composables/useSettings.ts - Text preferences
src/composables/usePrefs.ts - Shared data types
src/types/index.ts
Rust services
- Tauri commands
src-tauri/src/commands - Tunnel commands
src-tauri/src/commands/tunnel.rs - Host commands
src-tauri/src/commands/hosts.rs - Settings commands
src-tauri/src/commands/settings.rs - Log commands
src-tauri/src/commands/logs.rs
Persistence and security
- Credential encryption
src-tauri/src/crypto.rs - SQLite access
src-tauri/src/db.rs - Data models
src-tauri/src/models.rs
Tunnel runtime
- SSH engine
src-tauri/src/ssh.rs
Other components
- User
- SSH server
Connections 33
- User → App shell: uses
- App shell → Host management: renders
src/components/layout/AppShell.vue - App shell → Connection panel: renders
src/components/layout/AppShell.vue - App shell → Forwarding rules: renders
src/components/layout/AppShell.vue - App shell → Log console: renders
src/components/layout/AppShell.vue - App shell → Settings panel: renders
src/components/layout/AppShell.vue - App shell → Sidebar and hosts: renders
src/components/layout/AppShell.vue - Forwarding rules → Rule table: renders
src/components/PortForwardPanel.vue - Host management → Authentication fields: renders
- Host management → Tunnel state: uses
src/components/dialog/AddHostDialog.vue - Authentication fields → Tunnel state: inspects keys
src/components/common/AuthFields.vue - Connection panel → Tunnel state: uses
src/components/panels/ConnectPanel.vue - Rule table → Tunnel state: edits rules
src/components/RuleTable.vue - Log console → Tunnel state: reads logs
src/components/LogConsole.vue - Sidebar and hosts → Tunnel state: uses
src/components/layout/SideBar.vue - Settings panel → Settings state: updates
src/components/panels/SettingsPanel.vue - Settings state → Settings commands: invokes settings
- Tunnel state → Tauri commands: invokes commands
- Tauri commands → Host commands: registers
src-tauri/src/commands/mod.rs - Tauri commands → Tunnel commands: registers
src-tauri/src/commands/mod.rs - Tauri commands → Settings commands: registers
src-tauri/src/commands/mod.rs - Tauri commands → Log commands: registers
src-tauri/src/commands/mod.rs - Host commands → SQLite access: reads and writes
src-tauri/src/commands/hosts.rs - Host commands → Credential encryption: encrypts credentials
src-tauri/src/commands/hosts.rs - Host commands → Data models: converts records
src-tauri/src/commands/hosts.rs - Settings commands → SQLite access: persists settings
src-tauri/src/settings.rs - Log commands → SQLite access: reads and writes
src-tauri/src/commands/logs.rs - Tunnel commands → SQLite access: loads configuration
src-tauri/src/commands/tunnel.rs - Tunnel commands → Host commands: loads host data
src-tauri/src/commands/tunnel.rs - Tunnel commands → Credential encryption: decrypts credentials
src-tauri/src/commands/tunnel.rs - Tunnel commands → SSH engine: starts session
src-tauri/src/commands/tunnel.rs - SSH engine → SSH server: connects
- SQLite access → Data models: maps records