dashboard, status API and notifications tell apex domains from hostnames (closes #224)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
An apex domain's own records are still saved with the hostnames' records, under the domain's name, so the port and TLS checks find its addresses. Notifications about them now start `Domain:`, decided by the configured domains. The dashboard and /api/v1/status, which read only the saved state, take a hostname entry whose name also has a domain entry as that domain's own records: the dashboard shows them in a second table under Domains, the API in the domain's `recordsByNameserver`, and neither lists or counts them as hostnames. The startup notification counts domains and hostnames from the configuration. README says which of a domain's own records are watched and how their changes are notified. Model: opus-5-5
This commit was merged in pull request #244.
This commit is contained in:
@@ -43,12 +43,16 @@ func newDashboardTemplate() *template.Template {
|
||||
)
|
||||
}
|
||||
|
||||
// dashboardData is the data passed to the dashboard template.
|
||||
// dashboardData is the data passed to the dashboard template. Hostnames
|
||||
// and DomainRecords split the records in Snapshot.Hostnames, which also
|
||||
// holds the apex domains' own (see splitHostnames).
|
||||
type dashboardData struct {
|
||||
Snapshot state.Snapshot
|
||||
Alerts []notify.AlertEntry
|
||||
StateAge string
|
||||
GeneratedAt string
|
||||
Snapshot state.Snapshot
|
||||
Hostnames map[string]*state.HostnameState
|
||||
DomainRecords map[string]*state.HostnameState
|
||||
Alerts []notify.AlertEntry
|
||||
StateAge string
|
||||
GeneratedAt string
|
||||
}
|
||||
|
||||
// HandleDashboard returns the dashboard page handler.
|
||||
@@ -61,12 +65,15 @@ func (h *Handlers) HandleDashboard() http.HandlerFunc {
|
||||
) {
|
||||
snap := h.state.GetSnapshot()
|
||||
alerts := h.notifyHistory.Recent()
|
||||
hostnames, domainRecords := splitHostnames(snap)
|
||||
|
||||
data := dashboardData{
|
||||
Snapshot: snap,
|
||||
Alerts: alerts,
|
||||
StateAge: relTime(snap.LastUpdated),
|
||||
GeneratedAt: time.Now().UTC().Format("2006-01-02 15:04:05"),
|
||||
Snapshot: snap,
|
||||
Hostnames: hostnames,
|
||||
DomainRecords: domainRecords,
|
||||
Alerts: alerts,
|
||||
StateAge: relTime(snap.LastUpdated),
|
||||
GeneratedAt: time.Now().UTC().Format("2006-01-02 15:04:05"),
|
||||
}
|
||||
|
||||
writer.Header().Set(
|
||||
|
||||
Reference in New Issue
Block a user