Documentation
¶
Overview ¶
Package agent implements the in-container SSH server that devc injects and runs over `podman exec -i ... /.devc/agent __serve`. The transport is stdin/ stdout - there is no TCP listener and no published port - but the SSH crypto still runs so a real client (VSCodium Remote-SSH, OpenSSH) connects normally.
The server accepts a single connection (the one exec pipe it was started for) and serves every channel the client opens on it: interactive/exec sessions with optional PTY, and direct-tcpip forwards (how the editor reaches its own server port and how `ssh -L` works).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SFTPCommand = []string{"__sftp"}
SFTPCommand is the argv the agent re-execs to serve SFTP as the session user. The main devc binary implements it (running an in-process SFTP server over stdin/stdout); the agent only spawns it with dropped privileges. It is a var so tests can point it at a stub.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// HostKey is the server's host key (from /.devc/host_key).
HostKey ssh.Signer
// Authorized is the set of public keys allowed to connect (the workspace's
// single client key).
Authorized []ssh.PublicKey
// User is the OS user sessions run as (remoteUser); empty = the agent's own uid.
User string
// Cwd is the working directory for sessions (containerWorkspaceFolder).
Cwd string
// Environment is injected into every session (remoteEnv + probed env).
Environment map[string]string
// AgentForwarding allows ssh-agent forwarding: when the client requests it
// (auth-agent-req@openssh.com), the server exposes a proxy SSH_AUTH_SOCK that
// tunnels signing requests back to the client's agent. Off by default.
AgentForwarding bool
}
Config configures a Server. All fields are required except Environment.