Monorepo for Tangled tangled.org
2

Configure Feed

Select the types of activity you want to include in your feed.

appview/pipelines/ssh,knotserver: use repoDID + SHA in ssh interface

as opposed to the fake ATURI

Signed-off-by: oppiliappan <me@oppi.li>

author
oppiliappan
date (May 26, 2026, 3:16 PM +0100) commit c8599677 parent bd4ceb77 change-id ovumsyxw
+16 -26
+8 -22
appview/pipelines/ssh/session.go
··· 3 3 import ( 4 4 "fmt" 5 5 6 - "github.com/bluesky-social/indigo/atproto/syntax" 7 6 tea "github.com/charmbracelet/bubbletea" 8 7 "github.com/charmbracelet/ssh" 9 8 wishtea "github.com/charmbracelet/wish/bubbletea" ··· 20 19 21 20 renderer := wishtea.MakeRenderer(sess) 22 21 23 - if len(args) != 1 { 22 + if len(args) != 2 { 24 23 l.Warn("bad invocation", "args", args) 25 - return newErrorModel(renderer, "usage: ssh -t <host> -p 2222 <at-uri>\nexample: ssh -t host -p 2222 at://did:web:knot.example/sh.tangled.pipeline/abc123"), wishtea.MakeOptions(sess) 26 - } 27 - 28 - rawURI := args[0] 29 - aturi, err := syntax.ParseATURI(rawURI) 30 - if err != nil { 31 - l.Warn("invalid AT URI", "uri", rawURI, "err", err) 32 - return newErrorModel(renderer, fmt.Sprintf("invalid AT URI %q: %v", rawURI, err)), wishtea.MakeOptions(sess) 24 + return newErrorModel(renderer, "usage: ssh -t -p <port> <host> <repoDID> <sha>"), wishtea.MakeOptions(sess) 33 25 } 34 26 35 - did := aturi.Authority().String() 36 - const didWebPrefix = "did:web:" 37 - if len(did) <= len(didWebPrefix) { 38 - l.Warn("unsupported DID format", "did", did) 39 - return newErrorModel(renderer, fmt.Sprintf("unsupported DID format %q (expected did:web:...)", did)), wishtea.MakeOptions(sess) 40 - } 41 - knot := did[len(didWebPrefix):] 42 - rkey := aturi.RecordKey().String() 27 + repoDID := args[0] 28 + sha := args[1] 43 29 44 - l = l.With("knot", knot, "rkey", rkey) 30 + l = l.With("repoDID", repoDID, "sha", sha) 45 31 46 32 pipelines, err := db.GetPipelineStatuses(s.db, 1, 47 - orm.FilterEq("p.knot", knot), 48 - orm.FilterEq("p.rkey", rkey), 33 + orm.FilterEq("p.repo_did", repoDID), 34 + orm.FilterEq("p.sha", sha), 49 35 ) 50 36 if err != nil || len(pipelines) == 0 { 51 37 l.Warn("pipeline not found", "err", err) 52 - return newErrorModel(renderer, fmt.Sprintf("pipeline not found: %s", rawURI)), wishtea.MakeOptions(sess) 38 + return newErrorModel(renderer, fmt.Sprintf("pipeline not found for repo %s @ %s", repoDID, sha)), wishtea.MakeOptions(sess) 53 39 } 54 40 55 41 pipeline := pipelines[0]
+1 -1
knotserver/config/config.go
··· 44 44 Server Server `env:",prefix=KNOT_SERVER_"` 45 45 Git Git `env:",prefix=KNOT_GIT_"` 46 46 AppViewEndpoint string `env:"APPVIEW_ENDPOINT, default=https://tangled.org"` 47 - LogsHostname string `env:"LOGS_HOSTNAME, default=logs.tangled.org"` 47 + LogsAddr string `env:"LOGS_ADDR, default=tangled.org:3333"` 48 48 KnotMirrors []string `env:"KNOT_MIRRORS, default=https://mirror.tangled.network"` 49 49 } 50 50
+7 -3
knotserver/internal.go
··· 5 5 "encoding/json" 6 6 "fmt" 7 7 "log/slog" 8 + "net" 8 9 "net/http" 9 10 "net/url" 10 11 "os" ··· 422 423 EventJson: string(eventJson), 423 424 } 424 425 425 - if h.c.LogsHostname != "" { 426 - *clientMsgs = append(*clientMsgs, "→ Browse CI logs in your terminal:") 427 - *clientMsgs = append(*clientMsgs, fmt.Sprintf(" ssh -t %s at://did:web:%s/sh.tangled.pipeline/%s", h.c.LogsHostname, h.c.Server.Hostname, event.Rkey)) 426 + if h.c.LogsAddr != "" { 427 + host, port, err := net.SplitHostPort(h.c.LogsAddr) 428 + if err == nil { 429 + *clientMsgs = append(*clientMsgs, "→ Browse CI logs in your terminal:") 430 + *clientMsgs = append(*clientMsgs, fmt.Sprintf(" ssh -t -p %s %s %s %s", port, host, repoDid, line.NewSha)) 431 + } 428 432 } 429 433 430 434 return h.db.InsertEvent(event, h.n)