Documentation
¶
Overview ¶
Package ssh provides pinned-host connections to the runner's private management plane.
Index ¶
- Variables
- func BootstrapDirectory(operationID string) string
- func UpgradeDirectory(operationID string) string
- func ValidBootstrapDirectory(name string) bool
- type Artifact
- type Authentication
- type Client
- func (client *Client) CleanupBootstrap(ctx context.Context, directory string) error
- func (client *Client) Close() error
- func (client *Client) ConnectBoundNode(ctx context.Context, identity runnerinstall.Identity, token *credentials.Lease) (*Node, jobcontract.RunnerInfo, error)
- func (client *Client) ConnectNode(ctx context.Context) (*Node, jobcontract.RunnerInfo, error)
- func (*Client) GoString() string
- func (client *Client) InstallationOperation(ctx context.Context, id string) (runnerinstall.Operation, error)
- func (client *Client) Probe(ctx context.Context) (SystemInfo, error)
- func (client *Client) Provision(ctx context.Context, request runnerinstall.Request, artifact Artifact, ...) (result runnerinstall.Result, runErr error)
- func (client *Client) ReadPrivate(ctx context.Context, name string, owner uint32) ([]byte, error)
- func (client *Client) RecoverUpgrade(ctx context.Context, request runnerinstall.UpgradeRequest, artifact Artifact, ...) (runnerinstall.UpgradeOperation, error)
- func (client *Client) RetryUpgrade(ctx context.Context, request runnerinstall.UpgradeRequest, artifact Artifact, ...) (runnerinstall.UpgradeOperation, error)
- func (client *Client) RunnerHTTP(port uint16) (*http.Client, error)
- func (*Client) String() string
- func (client *Client) Upgrade(ctx context.Context, request runnerinstall.UpgradeRequest, artifact Artifact, ...) (runnerinstall.UpgradeOperation, error)
- func (client *Client) UpgradeOperation(ctx context.Context, id string) (runnerinstall.UpgradeOperation, error)
- func (client *Client) UploadNew(ctx context.Context, upload Upload) error
- type Endpoint
- type HostKeyError
- type Node
- func (node *Node) Close() error
- func (node *Node) Do(ctx context.Context, input Request) (*http.Response, error)
- func (*Node) GoString() string
- func (node *Node) Identity() runnerinstall.Identity
- func (node *Node) Info(ctx context.Context) (jobcontract.RunnerInfo, error)
- func (*Node) MarshalJSON() ([]byte, error)
- func (node *Node) PairingLease() (*credentials.Lease, error)
- func (*Node) String() string
- type ProvisionError
- type Request
- type SystemInfo
- type UpgradeError
- type Upload
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalid = errors.New("invalid_remote_connection") ErrConnection = errors.New("remote_connection_failed") ErrAuthentication = errors.New("remote_authentication_failed") ErrHostUnverified = errors.New("remote_host_key_confirmation_required") ErrHostChanged = errors.New("remote_host_key_changed") ErrTransfer = errors.New("remote_file_transfer_failed") ErrIntegrity = errors.New("remote_file_integrity_failed") ErrExists = errors.New("remote_file_already_exists") ErrUnsupported = errors.New("remote_operation_unsupported") )
var ( ErrUpgradePending = errors.New("remote_runner_upgrade_pending") )
Functions ¶
func BootstrapDirectory ¶
BootstrapDirectory identifies the only staging path owned by an installation operation. Persist it before any remote mutation, including directory creation.
func UpgradeDirectory ¶
UpgradeDirectory is persisted by the caller before the first remote mutation.
func ValidBootstrapDirectory ¶
Types ¶
type Authentication ¶
type Authentication struct {
// contains filtered or unexported fields
}
func PasswordAuthentication ¶
func PasswordAuthentication(password *credentials.Lease) Authentication
func PrivateKeyAuthentication ¶
func PrivateKeyAuthentication(key, passphrase *credentials.Lease) Authentication
func (Authentication) GoString ¶
func (Authentication) GoString() string
func (Authentication) MarshalJSON ¶
func (Authentication) MarshalJSON() ([]byte, error)
func (Authentication) String ¶
func (Authentication) String() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func Dial ¶
Dial does not own the supplied leases. Empty pins return the observed key for explicit confirmation before authentication; changed pins always fail closed. The connection is independent of ctx once its handshake has completed.
func (*Client) CleanupBootstrap ¶
CleanupBootstrap removes only a reported installer staging directory. An SSH loss may leave a partial upload; validate its entire bounded namespace before removing anything. The canonical installation and operation journal are kept.
func (*Client) ConnectBoundNode ¶
func (client *Client) ConnectBoundNode( ctx context.Context, identity runnerinstall.Identity, token *credentials.Lease, ) (*Node, jobcontract.RunnerInfo, error)
ConnectBoundNode uses the desktop's saved node-level authorization and exact installation identity. It never reads or silently replaces server pairing.
func (*Client) ConnectNode ¶
func (client *Client) ConnectNode(ctx context.Context) (*Node, jobcontract.RunnerInfo, error)
ConnectNode reuses the server's shared pairing without changing configuration, restarting its service, uploading an artifact, or comparing client builds.
func (*Client) InstallationOperation ¶
func (client *Client) InstallationOperation(ctx context.Context, id string) (runnerinstall.Operation, error)
InstallationOperation resolves an uncertain SSH acknowledgment through the server's atomic journal. It does not restart or resubmit the operation.
func (*Client) Probe ¶
func (client *Client) Probe(ctx context.Context) (SystemInfo, error)
Probe executes a fixed read-only script; no endpoint or user-supplied text is interpolated into the remote command. Unsupported systems retain their facts.
func (*Client) Provision ¶
func (client *Client) Provision( ctx context.Context, request runnerinstall.Request, artifact Artifact, progress func(runnerinstall.Progress), ) (result runnerinstall.Result, runErr error)
Provision uploads a verified Linux program and invokes its fixed installer. Retries must retain request.OperationID and the original artifact. The durable receipt describes that operation; ConnectNode separately obtains live health.
func (*Client) ReadPrivate ¶
ReadPrivate is used for the root-owned pairing secret, never for a general remote file browser. The caller must clear its returned bytes after use.
func (*Client) RecoverUpgrade ¶
func (client *Client) RecoverUpgrade( ctx context.Context, request runnerinstall.UpgradeRequest, artifact Artifact, progress func(runnerinstall.UpgradeProgress), ) (runnerinstall.UpgradeOperation, error)
RecoverUpgrade uses the durable operation's safety boundary. For explicit retry or recovery only, a nil artifact Source permits verified staged reuse; OS, Arch and SHA256 still identify the original release.
func (*Client) RetryUpgrade ¶
func (client *Client) RetryUpgrade( ctx context.Context, request runnerinstall.UpgradeRequest, artifact Artifact, progress func(runnerinstall.UpgradeProgress), ) (runnerinstall.UpgradeOperation, error)
func (*Client) RunnerHTTP ¶
RunnerHTTP opens one endpoint owner, using SSH direct-tcpip to one loopback port. It creates no local listener and never uses a proxy or redirects.
func (*Client) Upgrade ¶
func (client *Client) Upgrade( ctx context.Context, request runnerinstall.UpgradeRequest, artifact Artifact, progress func(runnerinstall.UpgradeProgress), ) (runnerinstall.UpgradeOperation, error)
Upgrade starts one explicit operation. An existing journal is returned without rerunning it; continuation and recovery require their separate explicit calls.
func (*Client) UpgradeOperation ¶
func (client *Client) UpgradeOperation(ctx context.Context, id string) (runnerinstall.UpgradeOperation, error)
UpgradeOperation reads only the fixed, root-owned atomic operation journal. In particular, a missing journal is not permission to launch another operation.
type HostKeyError ¶
func (*HostKeyError) Error ¶
func (err *HostKeyError) Error() string
func (*HostKeyError) Unwrap ¶
func (err *HostKeyError) Unwrap() error
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node owns a temporary node-token lease and an HTTP pool, not its parent SSH connection or accepted jobs. Close releases only these client-side resources.
func (*Node) Do ¶
Do sends only relative management routes through this node's pinned tunnel. Callers own request-body secret cleanup and response-body limits and Close.
func (*Node) Identity ¶
func (node *Node) Identity() runnerinstall.Identity
func (*Node) Info ¶
func (node *Node) Info(ctx context.Context) (jobcontract.RunnerInfo, error)
func (*Node) MarshalJSON ¶
func (*Node) PairingLease ¶
func (node *Node) PairingLease() (*credentials.Lease, error)
PairingLease copies the shared credential for the local OS Store. The caller owns this short-lived lease; closing either lease does not close the other.
type ProvisionError ¶
type ProvisionError struct {
OperationID string
TemporaryDirectory string
CleanupPending bool
Cause error
}
func (*ProvisionError) Error ¶
func (err *ProvisionError) Error() string
func (*ProvisionError) Unwrap ¶
func (err *ProvisionError) Unwrap() error
type Request ¶
type Request struct {
Method string
Route string
Body io.Reader
Content *jobcontract.ContentIdentity
RangeStart *int64
JSONGzip bool
}
type SystemInfo ¶
type UpgradeError ¶
UpgradeError retains the operation's identity when the remote outcome cannot be observed. Its staging directory is retained; disconnecting never rolls back the installation or stops its detached service.
func (*UpgradeError) Error ¶
func (*UpgradeError) Error() string
func (*UpgradeError) GoString ¶
func (*UpgradeError) GoString() string
func (*UpgradeError) MarshalJSON ¶
func (*UpgradeError) MarshalJSON() ([]byte, error)
func (*UpgradeError) Unwrap ¶
func (err *UpgradeError) Unwrap() error