feat: add VNC support with noVNC integration
- Introduced a new VNC viewer panel in the frontend, allowing users to connect to VNC sessions. - Implemented VNC connection handling with optional SSH tunneling in the backend. - Added a new SSH key manager for managing SSH keys within the terminal. - Created a trigger rules engine to monitor terminal output and trigger actions based on defined patterns. - Added CSS styles for the VNC viewer and its components. - Updated database schema to support VNC protocol in profiles. - Implemented WebSocket proxy for VNC connections to facilitate communication between the frontend and backend.
This commit is contained in:
@@ -12,6 +12,7 @@ const (
|
||||
DefaultTelnetPort = 23
|
||||
DefaultRAWPort = 23
|
||||
DefaultGitHubPort = 443
|
||||
DefaultVNCPort = 5900
|
||||
)
|
||||
|
||||
// Default timeout values (in seconds).
|
||||
@@ -108,6 +109,18 @@ func NewProfile(protocol Protocol) Profile {
|
||||
SecretMode: SecretModeSaved,
|
||||
RefreshIntervalSecs: 300,
|
||||
}
|
||||
case ProtocolVNC:
|
||||
p.Port = DefaultVNCPort
|
||||
p.VNC = &VNCConfig{
|
||||
VNCPort: DefaultVNCPort,
|
||||
SecretMode: SecretModeSaved,
|
||||
ScaleToFit: true,
|
||||
SharedSession: true,
|
||||
Quality: 6,
|
||||
SSHPort: DefaultSSHPort,
|
||||
SSHAuthMethod: "publickey",
|
||||
SSHSecretMode: SecretModeSaved,
|
||||
}
|
||||
}
|
||||
|
||||
return p
|
||||
|
||||
@@ -12,6 +12,7 @@ const (
|
||||
ProtocolTelnet Protocol = "telnet"
|
||||
ProtocolRAW Protocol = "raw"
|
||||
ProtocolGitHub Protocol = "github"
|
||||
ProtocolVNC Protocol = "vnc"
|
||||
)
|
||||
|
||||
// HostKeyPolicy determines how unknown or changed SSH host keys are handled.
|
||||
@@ -80,6 +81,9 @@ type Profile struct {
|
||||
|
||||
// GitHub-specific configuration
|
||||
GitHub *GitHubConfig `json:"github,omitempty"`
|
||||
|
||||
// VNC-specific configuration
|
||||
VNC *VNCConfig `json:"vnc,omitempty"`
|
||||
}
|
||||
|
||||
// SSHConfig holds SSH-specific settings for a connection profile.
|
||||
@@ -192,6 +196,40 @@ type GitHubConfig struct {
|
||||
RefreshIntervalSecs int `json:"refreshIntervalSecs"`
|
||||
}
|
||||
|
||||
// VNCConfig holds VNC-specific settings for a connection profile.
|
||||
type VNCConfig struct {
|
||||
// VNCHost is the VNC server address (defaults to profile.Host if empty).
|
||||
VNCHost string `json:"vncHost"`
|
||||
|
||||
// VNCPort is the VNC server port (5900 + display number, default 5900).
|
||||
VNCPort int `json:"vncPort"`
|
||||
|
||||
// SecretMode controls how the VNC password is stored.
|
||||
SecretMode SecretMode `json:"secretMode"`
|
||||
|
||||
// ViewOnly disables sending keyboard and mouse events to the server.
|
||||
ViewOnly bool `json:"viewOnly"`
|
||||
|
||||
// ScaleToFit scales the remote framebuffer to fit the panel.
|
||||
ScaleToFit bool `json:"scaleToFit"`
|
||||
|
||||
// Quality controls JPEG compression quality (1-9, 0 = default).
|
||||
Quality int `json:"quality"`
|
||||
|
||||
// SharedSession allows other VNC viewers to remain connected.
|
||||
SharedSession bool `json:"sharedSession"`
|
||||
|
||||
// SSH tunnel settings — if enabled, VNC traffic is tunnelled through an SSH connection.
|
||||
SSHTunnel bool `json:"sshTunnel"`
|
||||
SSHHost string `json:"sshHost"`
|
||||
SSHPort int `json:"sshPort"`
|
||||
SSHUsername string `json:"sshUsername"`
|
||||
SSHAuthMethod string `json:"sshAuthMethod"` // password, publickey
|
||||
SSHSecretMode SecretMode `json:"sshSecretMode"`
|
||||
SSHPrivateKey string `json:"sshPrivateKeyPath"`
|
||||
SSHAgentAuth bool `json:"sshAgentAuth"`
|
||||
}
|
||||
|
||||
// GitHubRepo is a single repository returned to the frontend for display.
|
||||
type GitHubRepo struct {
|
||||
FullName string `json:"fullName"`
|
||||
|
||||
Reference in New Issue
Block a user