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)