Documentation
¶
Index ¶
- Constants
- func ErrorfL(l *zerolog.Logger, format string, err error, args ...any) error
- func GetBuiltAppVersion() string
- func GetDefaultHostname() string
- func GetDeviceID() string
- func GetDeviceSKU() string
- func GetLocalVersion() (systemVersion *semver.Version, appVersion *semver.Version, err error)
- func GetVersionData(isJson bool) ([]byte, error)
- func LoadConfig()
- func Main()
- func RunWebSecureServer()
- func RunWebServer()
- func RunWebsocketClient()
- func SaveBackupConfig() error
- func SaveConfig() error
- type ATXState
- type AudioConfig
- type BacklightSettings
- type ChangePasswordRequest
- type CloudConnectionState
- type CloudRegisterRequest
- type CloudState
- type Config
- type ConsoleBroker
- func (b *ConsoleBroker) ClearSink(s Sink)
- func (b *ConsoleBroker) Close()
- func (b *ConsoleBroker) Enqueue(ev consoleEvent)
- func (b *ConsoleBroker) SetNormOptions(norm NormalizationOptions)
- func (b *ConsoleBroker) SetSink(s Sink)
- func (b *ConsoleBroker) SetTerminalPaused(v bool)
- func (b *ConsoleBroker) Start()
- type DCMsg
- type DCPowerState
- type DevModeState
- type DeviceStatus
- type DisplayRotationSettings
- type EDIDPreset
- type FailsafeModeNotification
- type JSONRPCEvent
- type JSONRPCRequest
- type JSONRPCResponse
- type JigglerConfig
- type KeyboardMacro
- type KeyboardMacroStep
- type KeyboardMacrosParams
- type LineEndingMode
- type LocalDevice
- type LoginRequest
- type MQTTConfig
- type MQTTManager
- type MQTTStatusResponse
- type MQTTTestResult
- type NBDDevice
- type NormalizationOptions
- type NormalizeMode
- type OSServicesConfig
- type PostRebootAction
- type QuickButton
- type RPCHandler
- type RateLimiter
- type RpcNetworkSettings
- type SSHKeyState
- type SerialMux
- type SerialSettings
- type Session
- type SessionConfig
- type SetPasswordRequest
- type SetWakeOnLanDevicesParams
- type SetupRequest
- type Sink
- type StorageFile
- type StorageFileUpload
- type StorageFiles
- type StorageSpace
- type TLSState
- type TXOrigin
- type TerminalSize
- type Terminator
- type UploadProgress
- type VirtualMediaMode
- type VirtualMediaSource
- type VirtualMediaState
- type VirtualMediaUrlInfo
- type WakeOnLanDevice
- type WebRTCSessionRequest
Constants ¶
const ( // CloudWebSocketConnectTimeout is the timeout for the websocket connection to the cloud CloudWebSocketConnectTimeout = 1 * time.Minute // CloudAPIRequestTimeout is the timeout for cloud API requests CloudAPIRequestTimeout = 10 * time.Second // CloudOidcRequestTimeout is the timeout for OIDC token verification requests // should be lower than the websocket response timeout set in cloud-api CloudOidcRequestTimeout = 10 * time.Second // WebsocketPingInterval is the interval at which the websocket client sends ping messages to the cloud WebsocketPingInterval = 15 * time.Second )
const ( MaxMacrosPerDevice = 25 MaxStepsPerMacro = 10 MaxKeysPerStep = 10 MinStepDelay = 50 MaxStepDelay = 2000 )
Constants for keyboard macro limits
const (
DefaultAPIURL = "https://api.jetkvm.com"
)
const MaxPasswordLength = 72
MaxPasswordLength is the maximum length bcrypt can hash. Go's bcrypt implementation rejects passwords over 72 bytes rather than silently truncating them.
const MinPasswordLength = 8
MinPasswordLength is the minimum required length for new passwords. This is only enforced when setting or changing passwords, not when validating existing passwords (to maintain backward compatibility).
const (
NetIfName = "eth0"
)
const SerialCommandHistoryPath = "/userdata/serialCommandHistory.json"
Variables ¶
This section is empty.
Functions ¶
func GetBuiltAppVersion ¶
func GetBuiltAppVersion() string
GetBuiltAppVersion returns the built-in app version
func GetDefaultHostname ¶
func GetDefaultHostname() string
func GetDeviceID ¶
func GetDeviceID() string
func GetDeviceSKU ¶
func GetDeviceSKU() string
func GetLocalVersion ¶
GetLocalVersion returns the local version of the system and app
func GetVersionData ¶
func LoadConfig ¶
func LoadConfig()
func RunWebSecureServer ¶
func RunWebSecureServer()
func RunWebServer ¶
func RunWebServer()
func RunWebsocketClient ¶
func RunWebsocketClient()
func SaveBackupConfig ¶
func SaveBackupConfig() error
func SaveConfig ¶
func SaveConfig() error
Types ¶
type AudioConfig ¶
type AudioConfig struct {
Enabled bool `json:"enabled"`
}
type BacklightSettings ¶
type ChangePasswordRequest ¶
type CloudConnectionState ¶
type CloudConnectionState uint8
const ( CloudConnectionStateNotConfigured CloudConnectionState = iota CloudConnectionStateDisconnected CloudConnectionStateConnecting CloudConnectionStateConnected )
type CloudRegisterRequest ¶
type CloudState ¶
type Config ¶
type Config struct {
CloudURL string `json:"cloud_url"`
UpdateAPIURL string `json:"update_api_url"`
CloudAppURL string `json:"cloud_app_url"`
CloudToken string `json:"cloud_token"`
TailscaleControlURL string `json:"tailscale_control_url,omitempty"`
GoogleIdentity string `json:"google_identity"`
JigglerEnabled bool `json:"jiggler_enabled"`
JigglerConfig *JigglerConfig `json:"jiggler_config"`
AutoUpdateEnabled bool `json:"auto_update_enabled"`
IncludePreRelease bool `json:"include_pre_release"`
HashedPassword string `json:"hashed_password"`
LocalAuthToken string `json:"local_auth_token"`
LocalAuthMode string `json:"localAuthMode"` //TODO: fix it with migration
LocalAuthIdleMinutes int `json:"local_auth_idle_minutes"`
LocalLoopbackOnly bool `json:"local_loopback_only"`
WakeOnLanDevices []WakeOnLanDevice `json:"wake_on_lan_devices"`
KeyboardMacros []KeyboardMacro `json:"keyboard_macros"`
KeyboardLayout string `json:"keyboard_layout"`
EdidString string `json:"hdmi_edid_string"`
ActiveExtension string `json:"active_extension"`
DisplayRotation string `json:"display_rotation"`
DisplayMaxBrightness int `json:"display_max_brightness"`
DisplayDimAfterSec int `json:"display_dim_after_sec"`
DisplayOffAfterSec int `json:"display_off_after_sec"`
TLSMode string `json:"tls_mode"` // options: "self-signed", "user-defined", ""
UsbConfig *usbgadget.Config `json:"usb_config"`
UsbDevices *usbgadget.Devices `json:"usb_devices"`
NetworkConfig *types.NetworkConfig `json:"network_config"`
DefaultLogLevel string `json:"default_log_level"`
VideoSleepAfterSec int `json:"video_sleep_after_sec"`
VideoQualityFactor float64 `json:"video_quality_factor"`
VideoCodecPreference string `json:"video_codec_preference"`
HideDisplayWhenIdle bool `json:"host_display_disable_when_idle"`
NativeMaxRestart uint `json:"native_max_restart_attempts"`
MqttConfig *MQTTConfig `json:"mqtt_config"`
AudioEnabled bool `json:"audio_enabled"`
OSServices *OSServicesConfig `json:"os_services"`
}
func (*Config) GetDisplayRotation ¶
GetDisplayRotation returns the display rotation
func (*Config) GetUpdateAPIURL ¶
GetUpdateAPIURL returns the update API URL
func (*Config) SetDisplayRotation ¶
SetDisplayRotation sets the display rotation
type ConsoleBroker ¶
type ConsoleBroker struct {
// contains filtered or unexported fields
}
func NewConsoleBroker ¶
func NewConsoleBroker(s Sink, norm NormalizationOptions) *ConsoleBroker
func (*ConsoleBroker) ClearSink ¶
func (b *ConsoleBroker) ClearSink(s Sink)
ClearSink detaches s, and leaves the sink alone when another one has replaced it since.
func (*ConsoleBroker) Close ¶
func (b *ConsoleBroker) Close()
func (*ConsoleBroker) Enqueue ¶
func (b *ConsoleBroker) Enqueue(ev consoleEvent)
func (*ConsoleBroker) SetNormOptions ¶
func (b *ConsoleBroker) SetNormOptions(norm NormalizationOptions)
func (*ConsoleBroker) SetSink ¶
func (b *ConsoleBroker) SetSink(s Sink)
func (*ConsoleBroker) SetTerminalPaused ¶
func (b *ConsoleBroker) SetTerminalPaused(v bool)
func (*ConsoleBroker) Start ¶
func (b *ConsoleBroker) Start()
type DCMsg ¶
type DCMsg struct {
Type string `json:"type"` // "serial" | "system"
Name string `json:"name,omitempty"` // e.g. "term.size"
Data json.RawMessage `json:"data"` // string for "serial", object for "system"
}
type DCPowerState ¶
type DevModeState ¶
type DevModeState struct {
Enabled bool `json:"enabled"`
}
type DeviceStatus ¶
type DisplayRotationSettings ¶
type DisplayRotationSettings struct {
Rotation string `json:"rotation"`
}
type EDIDPreset ¶
EDIDPreset is an EDID the device offers by name. The list lives here so the UI does not carry its own copy and the device decides what it advertises.
type JSONRPCEvent ¶
type JSONRPCRequest ¶
type JSONRPCResponse ¶
type JigglerConfig ¶
type KeyboardMacro ¶
type KeyboardMacro struct {
ID string `json:"id"`
Name string `json:"name"`
Steps []KeyboardMacroStep `json:"steps"`
SortOrder int `json:"sortOrder,omitempty"`
}
func (*KeyboardMacro) Validate ¶
func (m *KeyboardMacro) Validate() error
type KeyboardMacroStep ¶
type KeyboardMacroStep struct {
Keys []string `json:"keys"`
Modifiers []string `json:"modifiers"`
Delay int `json:"delay"`
}
func (*KeyboardMacroStep) Validate ¶
func (s *KeyboardMacroStep) Validate() error
type KeyboardMacrosParams ¶
type KeyboardMacrosParams struct {
Macros []any `json:"macros"`
}
type LineEndingMode ¶
type LineEndingMode int
const ( LineEnding_AsIs LineEndingMode = iota LineEnding_LF LineEnding_CR LineEnding_CRLF LineEnding_LFCR )
type LocalDevice ¶
type LoginRequest ¶
type LoginRequest struct {
Password string `json:"password"`
}
type MQTTConfig ¶
type MQTTConfig struct {
Enabled bool `json:"enabled"`
Broker string `json:"broker"`
Port int `json:"port"`
Username string `json:"username"`
Password string `json:"password"`
BaseTopic string `json:"base_topic"`
UseTLS bool `json:"use_tls"`
TLSInsecure bool `json:"tls_insecure"`
EnableHADiscovery bool `json:"enable_ha_discovery"`
EnableActions bool `json:"enable_actions"`
EnableKeyboardMacros bool `json:"enable_keyboard_macros"`
DebounceMs int `json:"debounce_ms"`
}
type MQTTManager ¶
type MQTTManager struct {
// contains filtered or unexported fields
}
func NewMQTTManager ¶
func NewMQTTManager(cfg *MQTTConfig, deviceID string) (*MQTTManager, error)
func (*MQTTManager) Close ¶
func (m *MQTTManager) Close()
Close disconnects from the MQTT broker gracefully and stops background goroutines.
func (*MQTTManager) IsConnected ¶
func (m *MQTTManager) IsConnected() bool
IsConnected returns the current connection state.
func (*MQTTManager) LastError ¶
func (m *MQTTManager) LastError() string
LastError returns the last connection error, or empty string if none.
type MQTTStatusResponse ¶
type MQTTTestResult ¶
type NBDDevice ¶
type NBDDevice struct {
// contains filtered or unexported fields
}
func NewNBDDevice ¶
func NewNBDDevice() *NBDDevice
type NormalizationOptions ¶
type NormalizationOptions struct {
Mode NormalizeMode
LineEnding LineEndingMode
TabRender string // e.g. " " or "" to keep '\t'
PreserveANSI bool
ShowNLTag bool // print a visible tag for CR/LF like <CR>, <LF>, <CRLF>
}
type NormalizeMode ¶
type NormalizeMode int
const ( ModeCaret NormalizeMode = iota // ^C ^M ^? ModeNames // <CR>, <LF>, <ESC>, … ModeHex // \x1B )
type OSServicesConfig ¶
type OSServicesConfig struct {
// Enabled: the KVM has the OS Services USB interface, so a sender on
// the target computer can connect. While it is false, the USB device is
// the device without OS Services.
Enabled bool `json:"enabled"`
TerminalEnabled bool `json:"terminal_enabled"`
FilesEnabled bool `json:"files_enabled"`
CaptureDisplay string `json:"capture_display"`
VideoEnabled bool `json:"video_enabled"`
Resolution string `json:"resolution"`
DisplayMode string `json:"display_mode"`
Adaptation string `json:"adaptation,omitempty"`
ClipboardEnabled bool `json:"clipboard_enabled"`
// LastSenderVersion and LastSenderAt (RFC 3339) are the sender that had
// the last approved session. The KVM writes them; a settings request
// cannot. They tell a KVM whose sender is away from a KVM that never
// had one.
LastSenderVersion string `json:"last_sender_version,omitempty"`
LastSenderAt string `json:"last_sender_at,omitempty"`
}
OSServicesConfig is the OS Services part of the KVM settings, in the same JSON shape as the JetKVM Mini's, which the browser reads and writes with getOsServicesSettings and setOsServicesSettings.
type PostRebootAction ¶
type QuickButton ¶
type QuickButton struct {
Id string `json:"id"` // Unique identifier
Label string `json:"label"` // Button label
Command string `json:"command"` // Command to send, raw command to send (without auto-terminator)
Terminator Terminator `json:"terminator"` // Terminator to use: None/CR/LF/CRLF/LFCR
Sort int `json:"sort"` // Sort order
}
type RPCHandler ¶
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter provides IP-based rate limiting for password-related endpoints
func NewRateLimiter ¶
func NewRateLimiter() *RateLimiter
NewRateLimiter creates a new rate limiter with automatic cleanup
func (*RateLimiter) IsAllowed ¶
func (rl *RateLimiter) IsAllowed(ip string) (bool, int)
IsAllowed checks if the IP is allowed to make an attempt. Returns (allowed, retryAfterSeconds)
func (*RateLimiter) RecordFailure ¶
func (rl *RateLimiter) RecordFailure(ip string)
RecordFailure records a failed authentication attempt for the IP
func (*RateLimiter) RecordSuccess ¶
func (rl *RateLimiter) RecordSuccess(ip string)
RecordSuccess clears the rate limit entry for an IP after successful auth
type RpcNetworkSettings ¶
type RpcNetworkSettings struct {
types.NetworkConfig
}
func (*RpcNetworkSettings) ToNetworkConfig ¶
func (s *RpcNetworkSettings) ToNetworkConfig() *types.NetworkConfig
type SSHKeyState ¶
type SSHKeyState struct {
SSHKey string `json:"sshKey"`
}
type SerialMux ¶
type SerialMux struct {
// contains filtered or unexported fields
}
func NewSerialMux ¶
func NewSerialMux(p serial.Port, broker *ConsoleBroker) *SerialMux
func (*SerialMux) SetEchoEnabled ¶
type SerialSettings ¶
type SerialSettings struct {
BaudRate int `json:"baudRate"` // The serial port bitrate (aka Baudrate)
DataBits int `json:"dataBits"` // Size of the character (must be 5, 6, 7 or 8)
Parity string `json:"parity"` // Parity (see Parity type for more info)
StopBits string `json:"stopBits"` // Stop bits (see StopBits type for more info)
Terminator Terminator `json:"terminator"` // Terminator to send after each command
HideSerialSettings bool `json:"hideSerialSettings"` // Whether to hide the serial settings in the UI
EnableEcho bool `json:"enableEcho"` // Whether to echo received characters back to the sender
NormalizeMode string `json:"normalizeMode"` // Normalization mode: "carret", "names", "hex"
NormalizeLineEnd string `json:"normalizeLineEnd"` // Line ending normalization: "keep", "lf", "cr", "crlf", "lfcr"
TabRender string `json:"tabRender"` // How to render tabs: "spaces", "arrow", "pipe"
PreserveANSI bool `json:"preserveANSI"` // Whether to preserve ANSI escape codes
ShowNLTag bool `json:"showNLTag"` // Whether to show a special tag for new lines
Buttons []QuickButton `json:"buttons"` // Custom quick buttons
}
Mode describes a serial port configuration.
type Session ¶
type Session struct {
VideoTrack *webrtc.TrackLocalStaticSample
AudioTrack *webrtc.TrackLocalStaticSample
ControlChannel *webrtc.DataChannel
RPCChannel *webrtc.DataChannel
HidChannel *webrtc.DataChannel
// contains filtered or unexported fields
}
func (*Session) GetDiagnosticsInfo ¶
func (s *Session) GetDiagnosticsInfo() diagnostics.SessionInfo
GetDiagnosticsInfo returns WebRTC diagnostic info for the diagnostics package.
type SessionConfig ¶
type SetPasswordRequest ¶
type SetPasswordRequest struct {
Password string `json:"password"`
}
type SetWakeOnLanDevicesParams ¶
type SetWakeOnLanDevicesParams struct {
Devices []WakeOnLanDevice `json:"devices"`
}
type SetupRequest ¶
type StorageFile ¶
type StorageFileUpload ¶
type StorageFiles ¶
type StorageFiles struct {
Files []StorageFile `json:"files"`
}
type StorageSpace ¶
type TerminalSize ¶
type Terminator ¶
type UploadProgress ¶
type VirtualMediaMode ¶
type VirtualMediaMode string
const ( CDROM VirtualMediaMode = "CDROM" Disk VirtualMediaMode = "Disk" )
type VirtualMediaSource ¶
type VirtualMediaSource string
const ( HTTP VirtualMediaSource = "HTTP" Storage VirtualMediaSource = "Storage" // Builtin is a disc the firmware makes: the OS Services installer. Builtin VirtualMediaSource = "Builtin" )
type VirtualMediaState ¶
type VirtualMediaState struct {
Source VirtualMediaSource `json:"source"`
Mode VirtualMediaMode `json:"mode"`
Filename string `json:"filename,omitempty"`
URL string `json:"url,omitempty"`
Size int64 `json:"size"`
}
type VirtualMediaUrlInfo ¶
type WakeOnLanDevice ¶
Source Files
¶
- audio.go
- block_device.go
- block_device_linux.go
- cdc_acm_console.go
- cloud.go
- config.go
- dc_metrics.go
- display.go
- edid_presets.go
- failsafe.go
- hidrpc.go
- hw.go
- jiggler.go
- jsonrpc.go
- local_auth_timeout.go
- log.go
- main.go
- mdns.go
- mqtt.go
- mqtt_commands.go
- mqtt_discovery.go
- mqtt_publish.go
- native.go
- network.go
- os_services.go
- os_services_channels.go
- os_services_installer.go
- os_services_settings.go
- os_services_update.go
- os_services_video.go
- ota.go
- prometheus.go
- ratelimit.go
- serial.go
- serial_console_helpers.go
- serial_extension.go
- session_input.go
- storage_download.go
- tailscale.go
- terminal.go
- timesync.go
- usb.go
- usb_mass_storage.go
- version.go
- video.go
- web.go
- web_tls.go
- webrtc.go
- wol.go
Directories
¶
| Path | Synopsis |
|---|---|
|
e2e
|
|
|
remote-agent
module
|
|
|
internal
|
|
|
diagnostics
Package diagnostics provides comprehensive system diagnostics logging for crash analysis, debugging, and troubleshooting.
|
Package diagnostics provides comprehensive system diagnostics logging for crash analysis, debugging, and troubleshooting. |
|
keyboard
Package keyboard translates stored keyboard macros into the wire-level HID macro steps consumed by the macro executor (rpcExecuteKeyboardMacro).
|
Package keyboard translates stored keyboard macros into the wire-level HID macro steps consumed by the macro executor (rpcExecuteKeyboardMacro). |
|
osservices
Package osservices is the KVM side of the IP-KVM OS Services protocol, version 5.0: the reset exchange, the byte-stream parser, the handshake and every service, as a single-threaded state machine (Session).
|
Package osservices is the KVM side of the IP-KVM OS Services protocol, version 5.0: the reset exchange, the byte-stream parser, the handshake and every service, as a single-threaded state machine (Session). |
|
osservices/edid
Package edid builds the EDID of the OS Services guest display: a VESA E-EDID 1.3 base block followed by one CTA-861 extension block (revision 3).
|
Package edid builds the EDID of the OS Services guest display: a VESA E-EDID 1.3 base block followed by one CTA-861 extension block (revision 3). |
|
osservices/ffs
Package ffs is the OS Services USB function on Linux: a FunctionFS instance with one vendor interface (class 0xff, subclass 0x4a, protocol 0x01), one bulk OUT and one bulk IN endpoint, and Microsoft OS 1.0 descriptors so that Windows binds WinUSB without a driver package (Transport, USB interface).
|
Package ffs is the OS Services USB function on Linux: a FunctionFS instance with one vendor interface (class 0xff, subclass 0x4a, protocol 0x01), one bulk OUT and one bulk IN endpoint, and Microsoft OS 1.0 descriptors so that Windows binds WinUSB without a driver package (Transport, USB interface). |
|
osservices/installer
Package installer builds the OS Services installer disc that the KVM mounts as a CD-ROM: an ISO 9660 image with a Joliet tree, volume label JETKVM, and one file, "Install OS Services.html", a page that redirects to the OS Services download for this firmware version, with a link in case the browser does not follow the redirect.
|
Package installer builds the OS Services installer disc that the KVM mounts as a CD-ROM: an ISO 9660 image with a Joliet tree, volume label JETKVM, and one file, "Install OS Services.html", a page that redirects to the OS Services download for this firmware version, with a link in case the browser does not follow the redirect. |
|
osservices/release
Package release is the OS Services update relay's pure part: the release indexes, the choice of the package for a sender, the browser's guestUpdate object, and the checks that keep an unchecked package from completing on the sender.
|
Package release is the OS Services update relay's pure part: the release indexes, the choice of the package for a sender, the browser's guestUpdate object, and the checks that keep an unchecked package from completing on the sender. |
|
playoutdelay
Package playoutdelay implements the WebRTC playout-delay RTP header extension (http://www.webrtc.org/experiments/rtp-hdrext/playout-delay).
|
Package playoutdelay implements the WebRTC playout-delay RTP header extension (http://www.webrtc.org/experiments/rtp-hdrext/playout-delay). |
|
rawtty
Package rawtty opens ttys in raw mode.
|
Package rawtty opens ttys in raw mode. |
|
timinglog
Package timinglog keeps the times of two events on one clock: a keyboard report was written to USB, and the last byte of an OS Services video frame was there.
|
Package timinglog keeps the times of two events on one clock: a keyboard report was written to USB, and the last byte of an OS Services video frame was there. |
|
tzdata
Code generated by "go run gen.go".
|
Code generated by "go run gen.go". |
|
usbgadget
Package usbgadget provides a high-level interface to manage USB gadgets THIS PACKAGE IS FOR INTERNAL USE ONLY AND ITS API MAY CHANGE WITHOUT NOTICE
|
Package usbgadget provides a high-level interface to manage USB gadgets THIS PACKAGE IS FOR INTERNAL USE ONLY AND ITS API MAY CHANGE WITHOUT NOTICE |
|
pkg
|
|
|
nmlite
Package nmlite provides DHCP client functionality for the network manager.
|
Package nmlite provides DHCP client functionality for the network manager. |
|
nmlite/link
Package link provides a wrapper around netlink.Link and provides a singleton netlink manager.
|
Package link provides a wrapper around netlink.Link and provides a singleton netlink manager. |