Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ JSON inputs, SVG outputs, and the site copy still use your contributor checkout.

**The social preview card is generated.** `just social-card` renders
`docs/media/social-card.typ` into `site/public/social-card.png`. Set
`PITOT_FONT_PATH` to a directory containing Inter; the recipe requires Typst
`PITOT_FONT_PATH` to a directory containing Geist; the recipe requires Typst
0.15.1 and fails if the font is missing. Commit the source and PNG together.
The site build checks the committed image’s dimensions; CI does not rerender it.

Expand Down
27 changes: 11 additions & 16 deletions docs/media/social-card.typ
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// its og:image at /social-card.png.
//
// Render it with `just social-card`, which pins the typst version, requires
// Inter on a font path, and fails when the face is missing. Running typst by
// Geist on a font path, and fails when the face is missing. Running typst by
// hand does not: it warns about an unknown font family, exits 0, and writes a
// card set in whatever it found instead. The recipe also passes `--root .`,
// without which typst refuses to read the mark below — it sits outside this
Expand All @@ -12,31 +12,26 @@
// size GitHub expects for a social preview, and large enough that a link unfurl
// does not resample it.
//
// The mark is read from ui/host/public/favicon.svg — the canonical asset that
// internal/brand tracks — rather than copied here, so a revised mark reaches
// the card the next time it is rendered.
#set page(width: 960pt, height: 480pt, margin: (x: 60pt, top: 44pt, bottom: 34pt), fill: rgb("#0b0f14"))
#set text(font: "Inter", fill: rgb("#f2f5f8"))

#place(top + left, dx: -60pt, dy: -44pt, rect(width: 960pt, height: 5pt,
fill: gradient.linear(rgb("#5FE8CE"), rgb("#41B6F8"), rgb("#9A50F4"))))
// The fixed dark mark avoids media queries, which Typst cannot resolve.
#set page(width: 960pt, height: 480pt, margin: (x: 60pt, top: 44pt, bottom: 34pt), fill: rgb("#0B0B0C"))
#set text(font: "Geist", fill: rgb("#EDEDEF"))

#grid(
columns: (86pt, 1fr),
column-gutter: 16pt,
align: horizon,
image("../../ui/host/public/favicon.svg", width: 84pt),
text(size: 56pt, weight: 700, "Pitot"),
image("../../ui/host/public/mark-dark.svg", width: 84pt),
text(size: 56pt, weight: 600, tracking: -0.045em, "pitot"),
)

#v(30pt)
#text(size: 34pt, weight: 700, fill: rgb("#5FE8CE"))[
#text(size: 34pt, weight: 700, fill: rgb("#EDEDEF"))[
Single-binary, agent-native \
OpenTelemetry investigation.
]

#v(18pt)
#text(size: 20pt, fill: rgb("#8a94a6"))[
#text(size: 20pt, fill: rgb("#A1A1A9"))[
Ingest OTLP, store as Parquet, query with DuckDB, \
and ask an agent about it. One Go process.
]
Expand All @@ -47,9 +42,9 @@
// body copy and typst still exited 0. In flow, the same overflow spills onto a
// second page, and a two-page render fails the PNG export outright.
#v(1fr)
#line(length: 100%, stroke: 0.75pt + rgb("#1b2430"))
#line(length: 100%, stroke: 0.75pt + rgb("#232327"))
#v(12pt)
#grid(columns: (1fr, auto),
text(size: 19pt, fill: rgb("#8a94a6"))[No collector fleet. No object store. One data directory.],
text(size: 19pt, fill: rgb("#8a94a6"))[github.com/labstack/pitot],
text(size: 19pt, fill: rgb("#A1A1A9"))[No collector fleet. No object store. One data directory.],
text(size: 19pt, fill: rgb("#A1A1A9"))[github.com/labstack/pitot],
)
6 changes: 3 additions & 3 deletions internal/api/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -755,17 +755,17 @@ func oauthJSONError(c *echo.Context, status int, code, description string) error
var oauthConsentTemplate = template.Must(template.New("oauth-consent").Parse(`<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Authorize access · Pitot</title><style>
:root{color-scheme:light dark;font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#fff;color:#1f2923}
:root{color-scheme:light dark;font-family:Geist,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#fff;color:#1f2923}
*{box-sizing:border-box}html,body{width:100%}body{margin:0;min-height:100vh;display:grid;place-items:center;padding:24px;overflow-x:hidden;background:radial-gradient(circle at 50% -12%,rgba(70,192,142,.12),transparent 38%),linear-gradient(180deg,#f8faf9,#fff 62%)}
.card{width:100%;max-width:520px;min-width:0;padding:40px;border:1px solid rgba(31,41,55,.08);border-radius:28px;background:rgba(255,255,255,.92);box-shadow:0 28px 70px rgba(31,41,55,.10),0 3px 10px rgba(31,41,55,.04);backdrop-filter:blur(18px)}
.brand{display:flex;align-items:center;gap:14px}.brand-mark{display:block;width:46px;height:46px}.brand-name{font-size:18px;font-weight:800;line-height:1;letter-spacing:.17em;text-transform:uppercase}
.brand{display:flex;align-items:center;gap:14px}.brand-mark{display:block;width:46px;height:46px}.brand-name{font-size:18px;font-weight:600;line-height:1;letter-spacing:-.045em}
.eyebrow{margin:28px 0 8px;color:#087f5b;font-size:12px;font-weight:700;letter-spacing:.12em;text-transform:uppercase}h1{margin:0;font-size:34px;font-weight:650;line-height:1.08;letter-spacing:-.035em}
.lede{margin:16px 0 0;color:#66736c;line-height:1.6}.detail{display:grid;gap:5px;margin:24px 0;padding:18px;border:1px solid #e1e7e3;border-radius:14px;background:#f7f9f8}.detail b{display:block}.detail span{color:#748078;font-size:13px;overflow-wrap:anywhere}.detail .warn{color:#b8621b;font-weight:600}
.access{display:flex;gap:12px;margin:20px 0}.access>div{min-width:0}.check{display:grid;place-items:center;flex:0 0 26px;height:26px;border-radius:50%;background:#e6fcf5;color:#087f5b;font-weight:800}.access p{margin:2px 0;color:#66736c;line-height:1.5;overflow-wrap:anywhere}.signed{font-size:13px;color:#748078}
.actions{display:grid;grid-template-columns:1fr 1.5fr;gap:12px;margin-top:28px}button{border:1px solid #d7ddd9;border-radius:12px;padding:13px 16px;background:#fff;color:#26322b;font:inherit;font-weight:700;cursor:pointer}button.primary{border-color:#0ca678;background:#0ca678;color:#fff}button:hover{filter:brightness(.97)}button:focus-visible{outline:3px solid rgba(12,166,120,.25);outline-offset:2px}
@media(prefers-color-scheme:dark){:root{background:#101512;color:#eef4f0}body{background:radial-gradient(circle at 50% -12%,rgba(70,192,142,.14),transparent 38%),#101512}.card{border-color:#303a35;background:rgba(27,33,30,.94);box-shadow:0 28px 70px #0007}.eyebrow{color:#63e6be}.lede,.access p{color:#aab5af}.detail{border-color:#38443e;background:#151b18}.detail span,.signed{color:#8c9892}.detail .warn{color:#f0a868}.check{background:#153b2e;color:#63e6be}button{border-color:#3b4741;background:#232b27;color:#eef4f0}button.primary{border-color:#20c997;background:#20c997;color:#07140f}}
@media(max-width:520px){body{display:flex;align-items:center;justify-content:center;padding:16px}.card{width:calc(100vw - 32px);max-width:calc(100vw - 32px);padding:28px 24px}.actions{grid-template-columns:1fr}h1{font-size:30px}}
</style></head><body><main class="card"><div class="brand"><span class="brand-mark">` + brand.MarkSVG + `</span><span class="brand-name">Pitot</span></div><p class="eyebrow">Secure connection</p><h1>Allow {{.ClientName}} to access Pitot?</h1>
</style></head><body><main class="card"><div class="brand"><span class="brand-mark">` + brand.MarkSVG + `</span><span class="brand-name">pitot</span></div><p class="eyebrow">Secure connection</p><h1>Allow {{.ClientName}} to access Pitot?</h1>
<p class="lede">{{if .ReadOnly}}This application is requesting read-only access to your observability data through MCP. It cannot change settings, alerts, or dashboards.{{else}}This application is requesting the access listed below through MCP.{{end}}</p>
<div class="detail"><b>{{.ClientName}}</b><span class="warn">Unverified client — this name was chosen by whoever registered it</span><span>Returns to <b>{{.Redirect}}</b></span><span>Scopes: {{.Scope}}</span></div>
{{range .Grants}}<div class="access"><span class="check">✓</span><div><b>{{.Title}}</b><p>{{.Detail}}</p></div></div>
Expand Down
2 changes: 1 addition & 1 deletion internal/api/oauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func TestMCPOAuthDiscoveryAndAuthorizationCodeFlow(t *testing.T) {
}
for _, brandElement := range []string{
`class="brand-mark"`,
`class="brand-name">Pitot`,
`class="brand-name">pitot`,
} {
if !strings.Contains(consent.Body.String(), brandElement) {
t.Fatalf("consent page is missing branded element %q: %s", brandElement, consent.Body.String())
Expand Down
4 changes: 2 additions & 2 deletions internal/auth/smtp.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ func renderMail(t *template.Template, data mailData) (string, error) {
}

const mailShellStart = `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Pitot</title></head>
<body style="margin:0;padding:0;background:#f4f8f6;color:#1f2923;font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif">
<body style="margin:0;padding:0;background:#f4f8f6;color:#1f2923;font-family:Geist,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif">
<div style="display:none;max-height:0;overflow:hidden;color:transparent">{{.Preheader}}</div>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="border-collapse:collapse;background:#f4f8f6"><tr><td align="center" style="padding:48px 16px">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="width:100%;max-width:560px;border-collapse:separate;background:#ffffff;border:1px solid #e1e7e3;border-radius:24px;box-shadow:0 18px 45px rgba(31,41,55,.08)">
<tr><td style="padding:36px 40px 16px">
<table role="presentation" cellpadding="0" cellspacing="0"><tr><td style="width:46px;vertical-align:middle">` + brand.EmailMarkHTML + `</td><td style="padding-left:14px;vertical-align:middle;font-size:18px;font-weight:800;line-height:1;letter-spacing:.17em;text-transform:uppercase;color:#1f2923">Pitot</td></tr></table>
<table role="presentation" cellpadding="0" cellspacing="0"><tr><td style="width:48px;vertical-align:middle">` + brand.EmailMarkHTML + `</td><td style="padding-left:14px;vertical-align:middle;font-size:18px;font-weight:600;line-height:1;letter-spacing:-.045em;color:#111113">pitot</td></tr></table>
</td></tr><tr><td style="padding:12px 40px 40px">`

const mailShellEnd = `<p style="margin:28px 0 0;color:#748078;font-size:13px;line-height:1.6">If you did not expect this message, you can safely ignore it.</p>
Expand Down
34 changes: 12 additions & 22 deletions internal/brand/brand.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,18 @@
// surfaces that cannot render the React brand components.
package brand

// MarkSVG is the server-rendered Pitot mark. Keep its ribbon paths and
// gradients in sync with ui/host/public/favicon.svg, the canonical asset.
// testdata/favicon.svg vendors a copy so the test in this package can assert
// they have not drifted apart.
const MarkSVG = `<svg viewBox="35 44 200 200" width="100%" height="100%" aria-hidden="true">
<defs>
<linearGradient id="pitot-top" x1="54" y1="52" x2="210" y2="104" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#5FE8CE"/><stop offset=".55" stop-color="#81E4B9"/><stop offset="1" stop-color="#D9F276"/></linearGradient>
<linearGradient id="pitot-mid" x1="58" y1="112" x2="176" y2="154" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#536FFF"/><stop offset=".52" stop-color="#41B6F8"/><stop offset="1" stop-color="#66D0EE"/></linearGradient>
<linearGradient id="pitot-bot" x1="58" y1="166" x2="145" y2="220" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#725BFF"/><stop offset=".52" stop-color="#9A50F4"/><stop offset="1" stop-color="#CB55E8"/></linearGradient>
</defs>
<path d="M58 116V88C58 67 75 52 96 52H191C204 52 212 61 212 72C212 84 203 94 191 94H101C82 94 67 102 58 116Z" fill="url(#pitot-top)"/>
<path d="M58 170V139C58 120 72 107 91 107H162C174 107 182 115 182 126C182 137 174 145 162 145H99C79 145 66 154 58 170Z" fill="url(#pitot-mid)"/>
<path d="M58 219V188C58 170 71 157 89 157H126C138 157 146 165 146 176C146 187 138 195 126 195H100C89 195 84 200 84 211C84 225 74 235 61 235H58Z" fill="url(#pitot-bot)"/>
// MarkSVG is the full Waterfall mark, matching ui/host/public/mark.svg.
// The favicon has a separate pixel-snapped cut for small sizes.
const MarkSVG = `<svg viewBox="0 0 24 24" width="100%" height="100%" aria-hidden="true">
<style>.i{stroke:#111113}.d{stroke:#B4B4BB}.a{stroke:#5A50D8}@media (prefers-color-scheme:dark){.i{stroke:#EDEDEF}.d{stroke:#4A4A52}.a{stroke:#8F8CFF}}</style>
<g fill="none" stroke-width="2.6" stroke-linecap="round"><path class="a" d="M3.3 4.5H20.7"/><path class="i" d="M7 9.5H16.5"/><path class="i" d="M7 14.5H11.5"/><path class="d" d="M10.5 19.5H17"/></g>
</svg>`

// EmailMarkHTML approximates the flowing-F ribbons with email-safe table
// markup. Inline SVG is intentionally avoided because major mail clients strip
// or fail to render it.
const EmailMarkHTML = `<table role="presentation" aria-hidden="true" cellpadding="0" cellspacing="0" style="border-collapse:separate;width:38px">
<tr><td style="height:8px;width:38px;border-radius:8px;background:#81E4B9;font-size:0;line-height:0">&nbsp;</td></tr>
<tr><td style="height:5px;font-size:0;line-height:0">&nbsp;</td></tr>
<tr><td style="height:8px;width:29px;border-radius:8px;background:#41B6F8;font-size:0;line-height:0">&nbsp;</td></tr>
<tr><td style="height:5px;font-size:0;line-height:0">&nbsp;</td></tr>
<tr><td style="height:8px;width:20px;border-radius:8px;background:#9A50F4;font-size:0;line-height:0">&nbsp;</td></tr>
// EmailMarkHTML renders Waterfall with email-safe tables in fixed light colors.
// Dimensions are twice the 24-unit mark, including its round cap extents.
const EmailMarkHTML = `<table role="presentation" aria-hidden="true" cellpadding="0" cellspacing="0" width="48" style="border-collapse:separate;width:48px">
<tr><td style="padding:6.4px 0 0 4px"><table role="presentation" cellpadding="0" cellspacing="0" width="40" style="border-collapse:separate;width:40px"><tr><td style="height:5.2px;border-radius:2.6px;background:#5A50D8;font-size:0;line-height:0">&nbsp;</td></tr></table></td></tr>
<tr><td style="padding:4.8px 0 0 11.4px"><table role="presentation" cellpadding="0" cellspacing="0" width="24.2" style="border-collapse:separate;width:24.2px"><tr><td style="height:5.2px;border-radius:2.6px;background:#111113;font-size:0;line-height:0">&nbsp;</td></tr></table></td></tr>
<tr><td style="padding:4.8px 0 0 11.4px"><table role="presentation" cellpadding="0" cellspacing="0" width="14.2" style="border-collapse:separate;width:14.2px"><tr><td style="height:5.2px;border-radius:2.6px;background:#111113;font-size:0;line-height:0">&nbsp;</td></tr></table></td></tr>
<tr><td style="padding:4.8px 0 0 18.4px"><table role="presentation" cellpadding="0" cellspacing="0" width="18.2" style="border-collapse:separate;width:18.2px"><tr><td style="height:5.2px;border-radius:2.6px;background:#B4B4BB;font-size:0;line-height:0">&nbsp;</td></tr></table></td></tr>
</table>`
16 changes: 8 additions & 8 deletions internal/brand/brand_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ import (
"testing"
)

func TestMarkSVGUsesCanonicalFaviconPaths(t *testing.T) {
favicon, err := os.ReadFile(filepath.Join("testdata", "favicon.svg"))
func TestMarkSVGUsesCanonicalWaterfallPaths(t *testing.T) {
mark, err := os.ReadFile(filepath.Join("testdata", "mark.svg"))
if err != nil {
t.Fatalf("read vendored canonical favicon: %v", err)
t.Fatalf("read vendored canonical mark: %v", err)
}

pathPattern := regexp.MustCompile(`(?s)<path\s+d="([^"]+)"`)
paths := pathPattern.FindAllStringSubmatch(string(favicon), -1)
pathPattern := regexp.MustCompile(`(?s)<path\s+[^>]*d="([^"]+)"`)
paths := pathPattern.FindAllStringSubmatch(string(mark), -1)
if len(paths) == 0 {
t.Fatal("canonical favicon does not contain any paths")
t.Fatal("canonical mark does not contain any paths")
}
renderedPaths := pathPattern.FindAllStringSubmatch(MarkSVG, -1)
if len(renderedPaths) != len(paths) {
t.Fatalf("MarkSVG has %d paths, canonical favicon has %d", len(renderedPaths), len(paths))
t.Fatalf("MarkSVG has %d paths, canonical mark has %d", len(renderedPaths), len(paths))
}
canonical := make(map[string]struct{}, len(paths))
for _, match := range paths {
Expand All @@ -33,7 +33,7 @@ func TestMarkSVGUsesCanonicalFaviconPaths(t *testing.T) {
}
for path := range canonical {
if _, ok := rendered[path]; !ok {
t.Errorf("MarkSVG is missing canonical favicon path %q", path)
t.Errorf("MarkSVG is missing canonical mark path %q", path)
}
}
for path := range rendered {
Expand Down
72 changes: 3 additions & 69 deletions internal/brand/testdata/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions internal/brand/testdata/mark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading