From 4bde85ea3302ae7a3c4d93e8a0c8221a9c98bfaa Mon Sep 17 00:00:00 2001 From: Veillax <126523099+Veillax@users.noreply.github.com> Date: Sat, 31 Oct 2026 01:38:16 -0600 Subject: [PATCH] model: terminal sessions in the site config, and the agent's SSH server in its report SiteConfig.Terminals lists terminal sessions waiting for the agent, which calls back to Hammerhead and joins the connection to its SSH server. SiteReport and Site carry the SSH server's address and whether the agent can relay. Co-Authored-By: Claude Sonnet 5.5 --- model/model.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/model/model.go b/model/model.go index 14a3e02..c1351f2 100644 --- a/model/model.go +++ b/model/model.go @@ -82,6 +82,10 @@ type Site struct { Tags []string `json:"tags,omitempty"` // labels for grouping and filtering in the dashboard + // What the agent last said about its SSH server (see SiteReport.SSH and SSHRelay). + SSH string `json:"ssh,omitempty"` + SSHRelay bool `json:"sshRelay,omitempty"` + TunnelIP string `json:"tunnelIp,omitempty"` // the site's address inside the tunnel network PublicKey string `json:"publicKey,omitempty"` // WireGuard public key, reported by the agent @@ -462,6 +466,11 @@ type SiteConfig struct { Edges []EdgeRef `json:"edges"` UpdateID string `json:"updateId,omitempty"` // an administrator asked this agent to update itself now; echoed back in its report + // Terminals lists terminal sessions waiting for this agent. For each, the agent opens a connection + // to hammerhead at /site/terminal/ and joins it to its own SSH server, so a shell can be opened + // from the dashboard without any port being open on an edge. + Terminals []string `json:"terminals,omitempty"` + MailEgress []MailSpec `json:"mailEgress"` } @@ -476,6 +485,10 @@ type SiteReport struct { AutoUpdate bool `json:"autoUpdate,omitempty"` UpdateMsg string `json:"updateMsg,omitempty"` UpdateID string `json:"updateId,omitempty"` + // SSH is where this machine's SSH server listens ("" when it is not running). SSHRelay says this + // agent can answer SiteConfig.Terminals, which is how an agent that is too old to relay shows itself. + SSH string `json:"ssh,omitempty"` + SSHRelay bool `json:"sshRelay,omitempty"` // progress of that update, for the dashboard's progress bar and log UpdateStage string `json:"updateStage,omitempty"` UpdatePct int `json:"updatePct,omitempty"`