Skip to content
Open
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
11 changes: 9 additions & 2 deletions cmd/sunlight/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,21 @@ <h2>{{ .Name }}</h2>
download="{{ .ShortName }}.der">key</a>
<a href="{{ .SubmissionPrefix }}ct/v1/get-roots">get-roots</a>
<a href="{{ .SubmissionPrefix }}log.v3.json">json</a><br>
{{ if .FinalTree.Size }}
Final tree size: {{ .FinalTree.Size }} at {{ timestamp .FinalTree.Timestamp }}<br>
Final tree hash: {{ printf "%x" .FinalTree.RootHash }}
{{ else }}
Ratelimit: {{ .PoolSize }} req/s

{{ end }}

<pre><code>{{ .PublicKeyPEM }}</code></pre>


{{ if not .FinalTree.Size }}
<h3>Submit a certificate chain (PEM or JSON)</h3>

<input type="file" class="chain" data-prefix="{{ .SubmissionPrefix }}">
<pre><code class="response"></code></pre>
{{ end }}

{{ end }}

Expand Down
4 changes: 3 additions & 1 deletion cmd/sunlight/sunlight.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading