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
2 changes: 1 addition & 1 deletion cmd/sunlight/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Sunlight</title>
<title>{{ .Title }}</title>

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
Expand Down
10 changes: 10 additions & 0 deletions cmd/sunlight/sunlight.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ import (
)

type Config struct {
// Name is the display name for this Sunlight instance, used as the
// HTML page title. Optional. If empty, the title defaults to "Sunlight".
Name string

// Listen are the addresses to listen on, e.g. ":443".
Listen []string

Expand Down Expand Up @@ -466,10 +470,16 @@ func main() {
homeWitnessInfo := func() witnessInfo { return witnessInfo{} }
mux.HandleFunc("/{$}", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html")
pageTitle := "Sunlight"
if c.Name != "" {
pageTitle = c.Name
}
if err := homeTmpl.Execute(w, struct {
Title string
Logs []logInfo
Witness witnessInfo
}{
Title: pageTitle,
Logs: homeLogsInfo(),
Witness: homeWitnessInfo(),
}); err != nil {
Expand Down