From 23ce9f6ae97d7e746f8a6263f25144b65d41b2a0 Mon Sep 17 00:00:00 2001 From: Matthew McPherrin Date: Fri, 22 May 2026 16:57:11 -0400 Subject: [PATCH] Show Final tree info for sunset logs If a tree has been sunset, show the size, timestamp, and hash. Don't show the ratelimit or submit UI. --- cmd/sunlight/home.html | 11 +++++++++-- cmd/sunlight/sunlight.go | 4 +++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cmd/sunlight/home.html b/cmd/sunlight/home.html index 43e7f38..b688245 100644 --- a/cmd/sunlight/home.html +++ b/cmd/sunlight/home.html @@ -72,14 +72,21 @@

{{ .Name }}

download="{{ .ShortName }}.der">key get-roots json
+ {{ if .FinalTree.Size }} + Final tree size: {{ .FinalTree.Size }} at {{ timestamp .FinalTree.Timestamp }}
+ Final tree hash: {{ printf "%x" .FinalTree.RootHash }} + {{ else }} Ratelimit: {{ .PoolSize }} req/s - + {{ end }} +
{{ .PublicKeyPEM }}
- + + {{ if not .FinalTree.Size }}

Submit a certificate chain (PEM or JSON)

+ {{ end }} {{ end }} diff --git a/cmd/sunlight/sunlight.go b/cmd/sunlight/sunlight.go index 4c903c9..4ab6685 100644 --- a/cmd/sunlight/sunlight.go +++ b/cmd/sunlight/sunlight.go @@ -346,7 +346,9 @@ type logInfo struct { //go:embed home.html var homeHTML string -var homeTmpl = template.Must(template.New("home").Parse(homeHTML)) +var homeTmpl = template.Must(template.New("home").Funcs(template.FuncMap{ + "timestamp": func(ms int64) string { return time.UnixMilli(ms).UTC().Format(time.RFC3339) }, +}).Parse(homeHTML)) func main() { fs := flag.NewFlagSet("sunlight", flag.ExitOnError)