Terminal relay: answer Hammerhead's terminal sessions through the agent
CI / test (push) Successful in 3m51s
Release / release (push) Successful in 4m43s

When someone opens a terminal for this site, Hammerhead lists the session in the
site's config. The agent connects out to Hammerhead and joins that connection to
its own SSH server, so no port has to be open on an edge. The agent now reports
where its SSH server listens and that it can relay.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
VeillaxandClaude Sonnet 5.5 committed 2026-10-31 01:38:46 -06:00
1 parent 1fba65fd3e
commit a2403ecf9d
7 files changed
+225 -6

No files matched your search

+3 -1
View File
@@ -79,6 +79,7 @@ func main() {
if dc.Ports, err = discover.ParsePorts(*discoverPorts); err != nil {
log.Fatalf("-discover-ports: %v", err)
}
sshAddr := "" // reported to Hammerhead, so its terminal can reach the server through this agent
if *sshOn {
if !sshd.Supported {
log.Fatal("-ssh: the SSH server is not available on this platform")
@@ -91,6 +92,7 @@ func main() {
if err != nil {
log.Fatalf("-ssh: %v", err)
}
sshAddr = *sshListen
log.Printf("ssh: listening on %s, host key %s", *sshListen, srv.Fingerprint())
go func() {
if err := srv.Run(ctx); err != nil {
@@ -98,7 +100,7 @@ func main() {
}
}()
}
b, err := bamboo.New(bamboo.Config{Hammerhead: strings.TrimRight(*hh, "/"), Token: *token, DataDir: *data, Docker: *dockerOn, Discover: dc,
b, err := bamboo.New(bamboo.Config{Hammerhead: strings.TrimRight(*hh, "/"), Token: *token, DataDir: *data, Docker: *dockerOn, Discover: dc, SSH: sshAddr,
Version: version, AutoUpdate: *autoUpdate,
UpdateNow: func(ctx context.Context, progress func(string, int, string)) (string, error) {
c := upd