Documentation
¶
Index ¶
- Constants
- func CheckDerpConnection(ctx context.Context, baseUrl *url.URL, insecure bool) error
- func GetClientHostname(userName string) (string, error)
- func GetEnvOrDefault(envVar, defaultVal string) string
- func GetURL(host string, port int) string
- func GetWorkspaceHostname(name, namespace string) string
- func ParseWorkspaceHostname(hostname string) (name string, project string, err error)
- func PersistNetmapStatus(rootDir string, status *ipnstate.Status)
- func RemoveProtocol(hostPath string) string
- func ToUint16Port(port int) (uint16, error)
- func WaitForSSHClient(ctx context.Context, cfg SSHDialConfig) (*ssh.Client, error)
- func WatchNetmap(ctx context.Context, lc *local.Client, ...) error
- type Addr
- type Dialer
- type SSHDialConfig
- type WorkspaceServer
- type WorkspaceServerConfig
Constants ¶
const ( // TSPortForwardPort is the fixed port on which the workspace WebSocket reverse proxy listens. TSPortForwardPort string = "12051" // DevsyTSNetDomain is the MagicDNS suffix for the Devsy tailnet. DevsyTSNetDomain = "ts.devsy" RunnerProxySocket string = "runner-proxy.sock" )
Variables ¶
This section is empty.
Functions ¶
func CheckDerpConnection ¶
CheckDerpConnection validates the DERP connection. insecure skips TLS certificate verification, for coordinators known to use self-signed certs.
func GetClientHostname ¶
func GetEnvOrDefault ¶
func GetWorkspaceHostname ¶
func ParseWorkspaceHostname ¶
func PersistNetmapStatus ¶ added in v1.17.0
PersistNetmapStatus marshals status and writes it to netmap.json under rootDir for debugging, logging rather than returning any failure since callers invoke this from a WatchNetmap callback with no error path.
func RemoveProtocol ¶
func ToUint16Port ¶ added in v1.17.0
ToUint16Port validates that port fits the uint16 range TCP ports use.
func WaitForSSHClient ¶
Types ¶
type Addr ¶
type Addr struct {
// contains filtered or unexported fields
}
func (Addr) PortUint16 ¶ added in v1.17.0
PortUint16 returns Port bounds-checked for use with APIs that take a uint16 port, such as *local.Client.DialTCP.
type SSHDialConfig ¶ added in v1.17.0
type SSHDialConfig struct {
Dialer Dialer
Network string
Address string
User string
Timeout time.Duration
}
SSHDialConfig bundles the parameters needed to establish and retry an SSH connection over a tailnet dialer.
type WorkspaceServer ¶
type WorkspaceServer struct {
// contains filtered or unexported fields
}
WorkspaceServer holds the TSNet server and its listeners.
func NewWorkspaceServer ¶
func NewWorkspaceServer(config *WorkspaceServerConfig) *WorkspaceServer
func (*WorkspaceServer) Start ¶
func (s *WorkspaceServer) Start(ctx context.Context) error
Start initializes the TSNet server, sets up listeners for SSH and HTTP reverse proxy traffic, and waits until the given context is canceled.
func (*WorkspaceServer) Stop ¶
func (s *WorkspaceServer) Stop()
Stop shuts down all listeners and the TSNet server.
type WorkspaceServerConfig ¶
type WorkspaceServerConfig struct {
AccessKey string
PlatformHost string
WorkspaceHost string
LogF func(format string, args ...any)
RootDir string
// Insecure skips TLS certificate verification for the DERP probe and
// the TSNet control-plane connection. Only set for coordinators known
// to use self-signed certificates.
Insecure bool
}
WorkspaceServerConfig defines configuration for the TSNet instance.