Documentation
¶
Overview ¶
Package tailnet implements the client side of the platform tailnet used by `vcluster platform connect slurm --stdio`. It starts an ephemeral, in-process userspace tsnet node, waits for the Slurm login proxy peer to become visible on the tailnet, dials its ssh port and pipes the connection between stdin and stdout so it can be used as an SSH ProxyCommand.
The tsnet setup mirrors loft-enterprise's pkg/agent/tailscale StartTSServer; it cannot import loft-enterprise, so the ~30 lines are replicated here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildClientHostname ¶
BuildClientHostname returns a unique per-session tailnet hostname of the form "<sanitized-os-hostname>-<rand8>.<sanitized-user>.client.slurm". A fresh random suffix per invocation is mandatory: the platform keys peer create-vs-update on hostname alone, so two live sessions sharing a hostname would steal each other's peer identity.
Types ¶
type Options ¶
type Options struct {
// Host is the platform host (e.g. https://my.loft.host). "/coordinator/" is
// appended to derive the tsnet control URL.
Host string
// AccessKey is the stored platform access key, reused verbatim as the tsnet
// auth key. The platform appends the slurm-client group to it at creation.
AccessKey string
// Hostname is the unique per-session client hostname on the tailnet.
Hostname string
// LoginHostname is the login proxy peer to dial, e.g.
// "ssh.<instance>.<project>.slurm".
LoginHostname string
// Timeout bounds how long we wait for the login peer to appear. Zero means
// defaultPeerTimeout.
Timeout time.Duration
// Insecure makes the tsnet control-plane connection tolerate the platform's
// self-signed certificate.
Insecure bool
// Debug emits tailnet/tsnet logs to stderr. When false all tsnet output is
// discarded so a plain `ssh <alias>` stays quiet.
Debug bool
}
Options configures a stdio proxy session.