Documentation
¶
Overview ¶
Package gui finds the remote-desktop port a running cell publishes and builds the URLs and client arguments `cell rdp` and `cell vnc` open it with.
Discovery is the same for both protocols and is parameterized by Protocol. Viewer-specific helpers live in rdp.go (FreeRDP, Royal TSX, xrdp cert) and vnc.go (VNC password file, Screen Sharing and Royal TSX URLs).
Index ¶
- Constants
- func CertFingerprint(configDir string) string
- func CertFlag(configDir string) string
- func HasRoyalTSX() bool
- func InstallHint() string
- func RDPUrl(host, port string) string
- func RoyalTSXUrl(host, port, user, password string) string
- func RoyalTSXVNCUrl(host, port, user, password string) string
- func VNCPasswdFile() string
- func VNCUrl(host, port, user, password string) string
- type CellEndpoint
- type ClientBinary
- type Protocol
Constants ¶
const TartVNCPassword = "admin"
TartVNCPassword is the macOS user password set for ARD Screen Sharing auth in Tart VMs. Matches the password set by GenerateCreateSessionUserScript (provision.go) and hosts/macos/default.nix.
Variables ¶
This section is empty.
Functions ¶
func CertFingerprint ¶
CertFingerprint reads the xrdp server cert from configDir/xrdp/cert.pem and returns its SHA256 fingerprint as a hex string (colon-separated). Returns empty string if the cert doesn't exist or can't be parsed.
func CertFlag ¶
CertFlag returns the FreeRDP /cert: flag. Uses fingerprint verification if the cert exists, otherwise falls back to /cert:ignore.
func InstallHint ¶
func InstallHint() string
InstallHint returns platform-specific install instructions for FreeRDP.
func RDPUrl ¶
RDPUrl returns an RDP URL for the given host and port. Uses percent-encoded format required by macOS Sonoma+ Windows App:
rdp://full%20address=s%3A<host>%3A<port>
func RoyalTSXUrl ¶
RoyalTSXUrl returns a Royal TSX URI for the given host, port and credentials. Note: macOS Royal TSX does not support property_* query params in adhoc URIs. Retina must be enabled via Application → Default Settings → Remote Desktop → Display.
func RoyalTSXVNCUrl ¶
RoyalTSXVNCUrl returns a Royal TSX URI for a VNC connection.
func VNCPasswdFile ¶
func VNCPasswdFile() string
VNCPasswdFile returns the path to a VNC password file containing the encrypted password "vnc". Creates the file on first call.
Types ¶
type CellEndpoint ¶
type CellEndpoint struct {
Host string // "127.0.0.1" for Docker/WinKit, VM IP for Tart
Port string
Engine string // "docker", "winkit", "tart"
User string // ARD auth user for tart (host $USER); empty for other engines
}
CellEndpoint is the address of a running cell's remote-desktop server.
type ClientBinary ¶
type ClientBinary struct {
Path string // absolute path from LookPath
Name string // binary name (e.g. "sdl-freerdp3")
}
ClientBinary holds the resolved FreeRDP binary path and name.
func FindClient ¶
func FindClient() (ClientBinary, bool)
FindClient finds the best available FreeRDP client binary for the current platform.
func FindClientWith ¶
FindClientWith is like FindClient but accepts explicit OS and lookPath for testing.
type Protocol ¶
type Protocol string
Protocol is a remote-desktop protocol a cell serves its desktop over.
func (Protocol) ContainerPort ¶
ContainerPort returns the port the protocol's server listens on inside a cell: "3389" for RDP, "5900" for VNC.
func (Protocol) ParseDockerPS ¶
ParseDockerPS parses the output of:
docker ps --filter "name=cell-" --format "{{.Names}}\t{{.Ports}}"
and returns a map of cell name to the host port published for p. Containers that do not publish p's port are skipped.
func (Protocol) ParseInspectPort ¶
ParseInspectPort extracts the host port published for p's container port from docker inspect JSON output.
func (Protocol) PortEnv ¶
PortEnv returns the env var devcell sets inside a cell to the published host port: EXT_RDP_PORT or EXT_VNC_PORT.
func (Protocol) URL ¶
func (p Protocol) URL(ep CellEndpoint) string
URL returns the connection URL for a cell endpoint. Tart macOS VMs use ARD auth (ep.User:admin); other engines use legacy VNC.