From db36d918fe08c581f65907459677fc6aee3f2f9a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Untersch=C3=BCtz?=
Date: Wed, 25 Nov 2026 22:39:01 +0100
Subject: [PATCH 1/3] feat: guard certificate orders for custom domains and
explain the setup
Status page servers order certificates on demand. Verified domains were
already the only ones they would order for, but nothing bounded how many:
an organization switching domains, or many organizations at once, could use
up the CA's rate limits that all servers sharing an ACME account depend on,
and every handshake or request for a made-up name was passed on to the API.
- Before a new order (not a renewal) the server asks the API
(POST /agent/v1/certificates). It allows verified domains of pages that
server serves, within limits per domain and day, per organization and
day, and per ACME account owner and hour (UPTIME_CERTS_*), counted
across all instances.
- An organization can set a new custom domain at most 10 times a day.
- The server remembers names without a page for a minute and passes at
most 20 unknown names a second on to the API; pages the sync cached are
not affected. Only real pages are recorded as visited.
- The page editor explains the three steps: the TXT record, the CNAME
record with the platform's status page host as its target (or the
organization's own servers), apex domains, and when HTTPS follows.
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
---
.env.example | 9 +
cmd/statuspage/main.go | 1 +
internal/agentapi/agentapi.go | 2 +
internal/agentapi/storage.go | 10 +
internal/api/agent.go | 1 +
internal/api/certificates.go | 47 ++++
internal/api/certificates_test.go | 108 +++++++++
internal/api/console.go | 19 ++
internal/api/statuspages.go | 73 ++++--
internal/api/storage_test.go | 6 +
internal/config/config.go | 20 +-
internal/i18n/locales/de.json | 11 +-
internal/i18n/locales/en.json | 11 +-
internal/statuspage/statuspage.go | 58 ++++-
internal/statuspage/tls.go | 34 +++
internal/statuspage/tls_test.go | 115 ++++++++++
internal/web/statuspages.templ | 57 +++--
internal/web/statuspages_templ.go | 366 ++++++++++++++++++++----------
18 files changed, 787 insertions(+), 161 deletions(-)
create mode 100644 internal/api/certificates.go
create mode 100644 internal/api/certificates_test.go
create mode 100644 internal/statuspage/tls_test.go
diff --git a/.env.example b/.env.example
index 1b6ae8a..fdf6210 100644
--- a/.env.example
+++ b/.env.example
@@ -49,6 +49,15 @@ UPTIME_TEST_REDIS_URL=redis://localhost:6379/15
# regions) get an email; 0 switches it off.
# UPTIME_REGION_ALERT_AFTER=5m
+# Status page servers ask before ordering a certificate for a custom domain.
+# New orders (not renewals) are limited per organization and day, per hour
+# for all servers sharing an ACME account (the platform's, or one
+# organization's), and per domain and day. Let's Encrypt allows 300 new
+# orders per account in 3 hours.
+# UPTIME_CERTS_PER_ORG_PER_DAY=20
+# UPTIME_CERTS_PER_HOUR=30
+# UPTIME_CERTS_PER_NAME_PER_DAY=5
+
# Data retention (0 keeps forever). Raw results feed charts up to 24h, the
# hourly aggregate 7d and 30d, the daily aggregate up to a year; resolved
# incidents follow the daily aggregate.
diff --git a/cmd/statuspage/main.go b/cmd/statuspage/main.go
index 7e3140f..c45ce0b 100644
--- a/cmd/statuspage/main.go
+++ b/cmd/statuspage/main.go
@@ -119,6 +119,7 @@ func certificates(ctx context.Context, cfg config.StatusPage, client *agentapi.C
magic = certmagic.New(cache, certmagic.Config{
Storage: statuspage.NewCertStorage(client, certDir),
OnDemand: &certmagic.OnDemandConfig{DecisionFunc: pages.AllowCertificate},
+ OnEvent: pages.OnCertEvent,
Logger: zap.NewNop(),
})
issuer := certmagic.NewACMEIssuer(magic, certmagic.ACMEIssuer{CA: cfg.ACMECA, Email: cfg.ACMEEmail, Agreed: true})
diff --git a/internal/agentapi/agentapi.go b/internal/agentapi/agentapi.go
index 83ed4f1..eba6435 100644
--- a/internal/agentapi/agentapi.go
+++ b/internal/agentapi/agentapi.go
@@ -162,6 +162,8 @@ func (c *Client) doWith(ctx context.Context, method, path string, header http.He
return ErrNotFound
case resp.StatusCode == http.StatusNotModified:
return ErrNotModified
+ case resp.StatusCode == http.StatusTooManyRequests:
+ return ErrRateLimited
case resp.StatusCode >= 300:
msg, _ := io.ReadAll(io.LimitReader(resp.Body, 1024))
return fmt.Errorf("agentapi: %s %s: %d %s", method, path, resp.StatusCode, bytes.TrimSpace(msg))
diff --git a/internal/agentapi/storage.go b/internal/agentapi/storage.go
index a759276..9e3623d 100644
--- a/internal/agentapi/storage.go
+++ b/internal/agentapi/storage.go
@@ -106,3 +106,13 @@ func (c *Client) StorageUnlock(ctx context.Context, name string) error {
_, err := c.raw(ctx, http.MethodDelete, "/storage/lock"+keyQuery("name", name), nil)
return err
}
+
+// ErrRateLimited means the API refused because a limit was reached.
+var ErrRateLimited = errors.New("agentapi: rate limited")
+
+// AllowCertificate asks whether this server may order a new certificate
+// for name. ErrNotFound means it serves no page there, ErrRateLimited that
+// a limit on orders was reached.
+func (c *Client) AllowCertificate(ctx context.Context, name string) error {
+ return c.do(ctx, http.MethodPost, "/certificates", map[string]string{"name": name}, nil)
+}
diff --git a/internal/api/agent.go b/internal/api/agent.go
index 952df2d..66bcb24 100644
--- a/internal/api/agent.go
+++ b/internal/api/agent.go
@@ -49,6 +49,7 @@ func (s *Server) mountAgentAPI(r gin.IRouter) {
sp.GET("/storage/list", s.storageList)
sp.POST("/storage/lock", s.storageLock)
sp.DELETE("/storage/lock", s.storageUnlock)
+ sp.POST("/certificates", s.agentCertificate)
checker := g.Group("", requireAgentKind("checker"))
checker.POST("/jobs", s.agentJobs)
checker.POST("/results", s.agentResults)
diff --git a/internal/api/certificates.go b/internal/api/certificates.go
new file mode 100644
index 0000000..12d8a1b
--- /dev/null
+++ b/internal/api/certificates.go
@@ -0,0 +1,47 @@
+package api
+
+import (
+ "net/http"
+ "strings"
+ "time"
+
+ "github.com/gin-gonic/gin"
+)
+
+// A status page server obtains certificates for custom domains on demand,
+// on the first visit over HTTPS. Before it orders a new one from its CA it
+// asks here: only for a verified domain of a page it serves, and within the
+// limits of UPTIME_CERTS_*. The limits count across all instances and keep
+// one organization, or a flood of handshakes for many names, from using up
+// the CA's rate limits that the other organizations share.
+
+type certificateRequest struct {
+ Name string `json:"name" binding:"required,max=253"`
+}
+
+func (s *Server) agentCertificate(c *gin.Context) {
+ var req certificateRequest
+ if !bind(c, &req) {
+ return
+ }
+ name := strings.TrimSuffix(strings.ToLower(strings.TrimSpace(req.Name)), ".")
+ ctx := c.Request.Context()
+ page, ok, err := s.agentServes(ctx, agentOf(c), &name, nil)
+ if err != nil {
+ internalError(c, err)
+ return
+ }
+ if !ok {
+ fail(c, http.StatusNotFound, "not_found")
+ return
+ }
+ lim := s.cfg.Certificates
+ if !s.limit(c, "acme:name:"+name, lim.PerNamePerDay, 24*time.Hour) ||
+ !s.limit(c, "acme:org:"+page.OrgID.String(), lim.PerOrgPerDay, 24*time.Hour) ||
+ !s.limit(c, "acme:owner:"+storageOwner(c), lim.PerOwnerPerHour, time.Hour) {
+ s.log.WarnContext(ctx, "certificate order refused by limit", "domain", name, "org", page.OrgID, "agent", agentOf(c).ID)
+ return
+ }
+ s.log.InfoContext(ctx, "certificate order allowed", "domain", name, "org", page.OrgID, "agent", agentOf(c).ID)
+ c.Status(http.StatusNoContent)
+}
diff --git a/internal/api/certificates_test.go b/internal/api/certificates_test.go
new file mode 100644
index 0000000..6d03d35
--- /dev/null
+++ b/internal/api/certificates_test.go
@@ -0,0 +1,108 @@
+package api_test
+
+import (
+ "context"
+ "errors"
+ "net/http"
+ "strings"
+ "testing"
+
+ "github.com/google/uuid"
+
+ "git.zb-server.de/ZB-Server/uptimesebi/internal/agentapi"
+ "git.zb-server.de/ZB-Server/uptimesebi/internal/config"
+)
+
+func TestCertificateOrdersAreLimited(t *testing.T) {
+ e := newEnvWith(t, func(c *config.API) {
+ c.StatusPageURL = "https://status.platform.test"
+ c.Certificates = config.Certificates{PerOrgPerDay: 3, PerOwnerPerHour: 100, PerNamePerDay: 2}
+ })
+ ctx := context.Background()
+ owner := e.browser(t)
+ owner.signup("o@"+uniq("cert")+".test", uniq("cert-"))
+ platform := e.statuspageClient(t, nil)
+
+ page := func(domain string) (string, map[string]any) {
+ t.Helper()
+ slug := uniq("cert-")
+ _, p := owner.do("POST", "/api/v1/org/statuspages", map[string]any{"slug": slug, "title": "Status"})
+ id := p["id"].(string)
+ owner.do("PUT", "/api/v1/org/statuspages/"+id, map[string]any{"slug": slug, "title": "Status", "published": true})
+ st, body := owner.do("PUT", "/api/v1/org/statuspages/"+id+"/domain", map[string]any{"domain": domain})
+ if st != http.StatusOK {
+ t.Fatalf("set domain = %d %v", st, body)
+ }
+ return id, body["domain_record"].(map[string]any)
+ }
+
+ // An unverified domain gets no certificate, nor does a made-up name.
+ d1 := uniq("a") + ".example.test"
+ id1, rec1 := page(d1)
+ if err := platform.AllowCertificate(ctx, d1); !errors.Is(err, agentapi.ErrNotFound) {
+ t.Errorf("unverified domain: %v, want not found", err)
+ }
+ if err := platform.AllowCertificate(ctx, uniq("random")+".example.test"); !errors.Is(err, agentapi.ErrNotFound) {
+ t.Errorf("unknown name: %v, want not found", err)
+ }
+
+ // The editor explains the records, with the platform's servers as the
+ // CNAME target.
+ _, _, html := owner.page("/statuspages/" + id1)
+ for _, want := range []string{"Prove the domain is yours", "status.platform.test.", "ALIAS or ANAME", "at most 10 times a day"} {
+ if !strings.Contains(html, want) {
+ t.Errorf("the editor lacks %q", want)
+ }
+ }
+
+ verifyDomain(t, owner, id1, rec1)
+ if err := platform.AllowCertificate(ctx, strings.ToUpper(d1)+"."); err != nil {
+ t.Fatalf("verified domain: %v", err)
+ }
+ // A domain whose orders keep failing stops at its own limit.
+ _ = platform.AllowCertificate(ctx, d1)
+ if err := platform.AllowCertificate(ctx, d1); !errors.Is(err, agentapi.ErrRateLimited) {
+ t.Errorf("third order for one domain: %v, want rate limited", err)
+ }
+
+ // The organization's limit covers all its domains.
+ d2 := uniq("b") + ".example.test"
+ id2, rec2 := page(d2)
+ verifyDomain(t, owner, id2, rec2)
+ if err := platform.AllowCertificate(ctx, d2); err != nil {
+ t.Fatalf("second domain: %v", err)
+ }
+ if err := platform.AllowCertificate(ctx, d2); !errors.Is(err, agentapi.ErrRateLimited) {
+ t.Errorf("order beyond the organization's limit: %v, want rate limited", err)
+ }
+
+ // Another organization's server is not allowed the domain at all.
+ other := e.browser(t)
+ other.signup("x@"+uniq("cert")+".test", uniq("cert-"))
+ otherOrg := uuid.MustParse(other.orgID())
+ if err := e.statuspageClient(t, &otherOrg).AllowCertificate(ctx, d2); !errors.Is(err, agentapi.ErrNotFound) {
+ t.Errorf("another organization's server: %v, want not found", err)
+ }
+}
+
+func TestDomainChangesAreLimited(t *testing.T) {
+ e := newEnv(t)
+ owner := e.browser(t)
+ owner.signup("o@"+uniq("dom")+".test", uniq("dom-"))
+ _, p := owner.do("POST", "/api/v1/org/statuspages", map[string]any{"slug": uniq("dom-"), "title": "Status"})
+ id := p["id"].(string)
+ base := uniq("d")
+ for i := range 10 {
+ st, body := owner.do("PUT", "/api/v1/org/statuspages/"+id+"/domain", map[string]any{"domain": base + string(rune('a'+i)) + ".example.test"})
+ if st != http.StatusOK {
+ t.Fatalf("change %d = %d %v", i+1, st, body)
+ }
+ // Saving the same domain again does not count.
+ owner.do("PUT", "/api/v1/org/statuspages/"+id+"/domain", map[string]any{"domain": base + string(rune('a'+i)) + ".example.test"})
+ }
+ st, body := owner.do("PUT", "/api/v1/org/statuspages/"+id+"/domain", map[string]any{"domain": base + "z.example.test"})
+ expect(t, "eleventh change", st, body, http.StatusTooManyRequests, "domain_changes_exceeded")
+ // Removing the domain is always possible.
+ st, body = owner.do("PUT", "/api/v1/org/statuspages/"+id+"/domain", map[string]any{"domain": ""})
+ expect(t, "remove domain", st, body, http.StatusOK, "")
+}
diff --git a/internal/api/console.go b/internal/api/console.go
index 6e245ba..8a2b70e 100644
--- a/internal/api/console.go
+++ b/internal/api/console.go
@@ -6,6 +6,7 @@ import (
"encoding/json"
"errors"
"fmt"
+ "net"
"net/http"
"net/url"
"slices"
@@ -1044,6 +1045,20 @@ func (s *Server) channelsView(c *gin.Context, p *principal, page web.Page, me we
return web.ChannelsPage(page, me, v), nil
}
+// cnameTarget is the host custom domains point at to reach the platform's
+// status page servers, unless that is not known.
+func (s *Server) cnameTarget() string {
+ u, err := url.Parse(s.cfg.StatusPageURL)
+ if err != nil {
+ return ""
+ }
+ h := u.Hostname()
+ if h == "" || h == "localhost" || net.ParseIP(h) != nil || !strings.Contains(h, ".") {
+ return ""
+ }
+ return h
+}
+
// pageURL is where p is reachable, or empty when only the organization's
// own status page servers serve it, at an address the platform does not
// know.
@@ -1139,6 +1154,10 @@ func (s *Server) statusPageEditor(c *gin.Context, p *principal, page web.Page, m
if v.DomainRecord != nil {
e.RecordName, e.RecordValue = v.DomainRecord.Name, v.DomainRecord.Value
}
+ e.DomainChangesPerDay = domainChangesPerDay
+ if !own {
+ e.CNAMETarget = s.cnameTarget()
+ }
newPageGroupTree(pageGroups).walk(func(g store.StatusPageGroup, depth int) {
var parentID string
if g.ParentID != nil {
diff --git a/internal/api/statuspages.go b/internal/api/statuspages.go
index da2e973..7c3e3ae 100644
--- a/internal/api/statuspages.go
+++ b/internal/api/statuspages.go
@@ -35,6 +35,9 @@ const (
// verifyPrefix is the label under which customers publish the TXT record
// proving control of a custom domain.
verifyPrefix = "_uptimesebi."
+ // domainChangesPerDay bounds how often an organization may set a new
+ // custom domain.
+ domainChangesPerDay = 10
)
var (
@@ -359,29 +362,15 @@ func (s *Server) agentPage(c *gin.Context) {
fail(c, http.StatusBadRequest, "invalid_input")
return
}
- var (
- page store.StatusPage
- own bool
- )
- a := agentOf(c)
- err := s.db.Tx(ctx, tenant.System(), func(q *store.Queries) error {
- var err error
- if page, err = q.FindPublishedPage(ctx, store.FindPublishedPageParams{Host: host, Slug: slug}); err != nil || a.OrgID != nil {
- return err
- }
- own, err = q.OrgServesOwnPages(ctx, &page.OrgID)
- return err
- })
- // The platform's servers leave the pages of organizations that serve
- // them on their own servers to those.
- if errors.Is(err, pgx.ErrNoRows) || (err == nil && (own || a.OrgID != nil && *a.OrgID != page.OrgID)) {
- fail(c, http.StatusNotFound, "not_found")
- return
- }
+ page, ok, err := s.agentServes(ctx, agentOf(c), host, slug)
if err != nil {
internalError(c, err)
return
}
+ if !ok {
+ fail(c, http.StatusNotFound, "not_found")
+ return
+ }
snap, err := s.buildSnapshot(ctx, page)
if err != nil {
internalError(c, err)
@@ -398,6 +387,32 @@ func (s *Server) agentPage(c *gin.Context) {
c.JSON(http.StatusOK, snap)
}
+// agentServes finds the published page a status page agent serves at host
+// or slug. The platform's servers leave the pages of organizations that
+// serve them on their own servers to those, which receive only their own
+// organization's pages.
+func (s *Server) agentServes(ctx context.Context, a store.GetAgentByHashRow, host, slug *string) (store.StatusPage, bool, error) {
+ var (
+ page store.StatusPage
+ own bool
+ )
+ err := s.db.Tx(ctx, tenant.System(), func(q *store.Queries) error {
+ var err error
+ if page, err = q.FindPublishedPage(ctx, store.FindPublishedPageParams{Host: host, Slug: slug}); err != nil || a.OrgID != nil {
+ return err
+ }
+ own, err = q.OrgServesOwnPages(ctx, &page.OrgID)
+ return err
+ })
+ switch {
+ case errors.Is(err, pgx.ErrNoRows):
+ return page, false, nil
+ case err != nil:
+ return page, false, err
+ }
+ return page, !own && (a.OrgID == nil || *a.OrgID == page.OrgID), nil
+}
+
// agentPageIndex lists the pages the status page server serves.
func (s *Server) agentPageIndex(c *gin.Context) {
ctx := c.Request.Context()
@@ -724,12 +739,30 @@ func (s *Server) setPageDomain(c *gin.Context) {
p := current(c)
ctx := c.Request.Context()
var row store.StatusPage
+ limited := false
err := s.db.Tx(ctx, p.scope(), func(q *store.Queries) error {
- var err error
+ cur, err := q.GetStatusPage(ctx, id)
+ if err != nil {
+ return err
+ }
+ // Every new domain may end in a certificate order; switching domains
+ // over and over would use up the CA's limits for everyone.
+ if domain != "" && domain != deref(cur.CustomDomain) {
+ ok, err := s.limiter.Allow(ctx, "domain_change:"+p.Org.ID.String(), domainChangesPerDay, 24*time.Hour)
+ if err != nil {
+ return err
+ }
+ if !ok {
+ limited = true
+ return nil
+ }
+ }
row, err = q.SetStatusPageDomain(ctx, store.SetStatusPageDomainParams{ID: id, CustomDomain: nonEmpty(domain)})
return err
})
switch {
+ case limited:
+ fail(c, http.StatusTooManyRequests, "domain_changes_exceeded", "Count", domainChangesPerDay)
case isUniqueViolation(err, "status_pages_custom_domain_key"):
fail(c, http.StatusConflict, "domain_taken")
case errors.Is(err, pgx.ErrNoRows):
diff --git a/internal/api/storage_test.go b/internal/api/storage_test.go
index 9120983..7ffba0c 100644
--- a/internal/api/storage_test.go
+++ b/internal/api/storage_test.go
@@ -119,6 +119,12 @@ func TestAllowCertificate(t *testing.T) {
t.Error("AllowCertificate(unknown name) = nil, want refusal")
}
verifyDomain(t, owner, pageID, record)
+ // A name just found without a page is not asked about again for a
+ // while; the sync picks the newly verified domain up.
+ if err := srv.AllowCertificate(ctx, domain); err == nil {
+ t.Error("AllowCertificate(domain just found missing) = nil, want the miss remembered")
+ }
+ srv.Sync(ctx)
if err := srv.AllowCertificate(ctx, domain); err != nil {
t.Errorf("AllowCertificate(verified domain) = %v", err)
}
diff --git a/internal/config/config.go b/internal/config/config.go
index b59e440..8cae009 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -104,7 +104,25 @@ type API struct {
// RegionAlertAfter is how long a region with monitors may have no live
// checker before its admins or owners are told; 0 disables it.
RegionAlertAfter time.Duration `env:"UPTIME_REGION_ALERT_AFTER" envDefault:"5m"`
- Retention Retention
+ // Certificates bounds the certificates status page servers may order
+ // for custom domains.
+ Certificates Certificates
+ Retention Retention
+}
+
+// Certificates limits new ACME orders for custom domains, so neither one
+// organization nor a flood of names uses up the CA's rate limits, which
+// apply per ACME account and so to all servers of an owner together.
+// Renewals are not counted.
+type Certificates struct {
+ // PerOrgPerDay is for the domains of one organization.
+ PerOrgPerDay int `env:"UPTIME_CERTS_PER_ORG_PER_DAY" envDefault:"20"`
+ // PerOwnerPerHour is for all servers of the platform, or of one
+ // organization, together.
+ PerOwnerPerHour int `env:"UPTIME_CERTS_PER_HOUR" envDefault:"30"`
+ // PerNamePerDay stops a domain whose orders keep failing from using
+ // up the rest.
+ PerNamePerDay int `env:"UPTIME_CERTS_PER_NAME_PER_DAY" envDefault:"5"`
}
// Retention sets how long data is kept. Zero keeps it forever.
diff --git a/internal/i18n/locales/de.json b/internal/i18n/locales/de.json
index f9143cd..f8ff9f5 100644
--- a/internal/i18n/locales/de.json
+++ b/internal/i18n/locales/de.json
@@ -543,6 +543,7 @@
"error.confirmation_failed": "Die Bestätigung stimmt nicht.",
"error.consent_outdated": "Die Dokumente haben sich inzwischen geändert. Lade die Seite neu und stimme der aktuellen Fassung zu.",
"error.consent_required": "Bitte stimme zuerst Datenschutz und AGB zu.",
+ "error.domain_changes_exceeded": "Die eigene Domain wurde heute schon {{.Count}}-mal geändert. Versuch es morgen wieder.",
"error.domain_not_verified": "Der TXT-Eintrag wurde noch nicht gefunden. DNS-Änderungen brauchen manchmal etwas Zeit.",
"error.domain_taken": "Diese Domain nutzt bereits eine andere Statuspage.",
"error.email_not_configured": "E-Mail ist auf diesem Server nicht verfügbar.",
@@ -1249,9 +1250,15 @@
"pages.delete_confirm": "Diese Statuspage löschen?",
"pages.description": "Beschreibung",
"pages.domain": "Eigene Domain",
- "pages.domain_cname": "Richte die Domain (CNAME oder A-Record) auf deinen Statuspage-Server; er holt sich automatisch ein Zertifikat, wenn TLS aktiviert ist.",
- "pages.domain_instructions": "Lege diesen DNS-Eintrag an und prüfe ihn dann. Nur geprüfte Domains werden ausgeliefert.",
+ "pages.domain_apex": "Eine Domain ohne Subdomain (example.com) kann keinen CNAME-Eintrag haben. Nutze stattdessen den ALIAS- oder ANAME-Eintrag deines DNS-Anbieters oder A/AAAA-Einträge.",
+ "pages.domain_intro": "Liefere diese Seite unter einer eigenen Domain aus, z. B. status.example.com. Drei Schritte: Nachweisen, dass die Domain dir gehört, sie auf die Statusseiten-Server zeigen lassen, und HTTPS kommt von selbst.",
"pages.domain_name": "Domain",
+ "pages.domain_step_cname": "2. Lass die Domain mit diesem CNAME-Eintrag auf die Statusseiten-Server zeigen:",
+ "pages.domain_step_cname_own": "2. Lass die Domain auf die eigenen Statusseiten-Server deiner Organisation zeigen: per CNAME-Eintrag auf deren Hostnamen oder per A/AAAA-Eintrag auf deren Adressen.",
+ "pages.domain_step_cname_unknown": "2. Lass die Domain per CNAME-Eintrag auf die Statusseiten-Server der Plattform zeigen; das Ziel nennt dir der Betreiber dieser Installation.",
+ "pages.domain_step_tls": "3. HTTPS: Das Zertifikat wird beim ersten Aufruf über HTTPS automatisch geholt, das kann bis zu einer Minute dauern. Zum Schutz der Limits der Zertifizierungsstelle, die sich alle Organisationen teilen, sind neue Zertifikate pro Tag begrenzt, und die Domain lässt sich höchstens {{.Count}}-mal am Tag ändern.",
+ "pages.domain_step_verified": "1. Domain geprüft.",
+ "pages.domain_step_verify": "1. Weise mit diesem TXT-Eintrag nach, dass die Domain dir gehört, und prüfe ihn dann. Bis dahin wird die Domain weder ausgeliefert noch bekommt sie ein Zertifikat.",
"pages.domain_verified": "Domain geprüft.",
"pages.draft": "Entwurf",
"pages.export": "Als HTML exportieren",
diff --git a/internal/i18n/locales/en.json b/internal/i18n/locales/en.json
index 7e56e3d..57eb73a 100644
--- a/internal/i18n/locales/en.json
+++ b/internal/i18n/locales/en.json
@@ -543,6 +543,7 @@
"error.confirmation_failed": "The confirmation does not match.",
"error.consent_outdated": "The documents changed in the meantime. Reload the page and accept the current version.",
"error.consent_required": "Please accept the privacy policy and terms first.",
+ "error.domain_changes_exceeded": "The custom domain was changed {{.Count}} times today already. Try again tomorrow.",
"error.domain_not_verified": "The TXT record was not found yet. DNS changes can take a while to appear.",
"error.domain_taken": "This domain is already used by another status page.",
"error.email_not_configured": "Email is not available on this server.",
@@ -1249,9 +1250,15 @@
"pages.delete_confirm": "Delete this status page?",
"pages.description": "Description",
"pages.domain": "Custom domain",
- "pages.domain_cname": "Point the domain (CNAME or A record) at your status page server; it obtains a certificate automatically when TLS is enabled.",
- "pages.domain_instructions": "Create this DNS record, then verify. Only verified domains are served.",
+ "pages.domain_apex": "A domain without a subdomain (example.com) cannot have a CNAME record. Use your DNS provider's ALIAS or ANAME record, or A/AAAA records, instead.",
+ "pages.domain_intro": "Serve this page under a domain of your own, e.g. status.example.com. Three steps: prove the domain is yours, point it at the status page servers, and HTTPS follows by itself.",
"pages.domain_name": "Domain",
+ "pages.domain_step_cname": "2. Point the domain at the status page servers with this CNAME record:",
+ "pages.domain_step_cname_own": "2. Point the domain at your organization's own status page servers: a CNAME record to their host name, or A/AAAA records to their addresses.",
+ "pages.domain_step_cname_unknown": "2. Point the domain at the platform's status page servers with a CNAME record; the operator of this installation tells you its target.",
+ "pages.domain_step_tls": "3. HTTPS: the certificate is obtained automatically on the first visit over HTTPS, which can take up to a minute. To protect the certificate authority's limits that all organizations share, new certificates are limited per day, and the domain can be changed at most {{.Count}} times a day.",
+ "pages.domain_step_verified": "1. Domain verified.",
+ "pages.domain_step_verify": "1. Prove the domain is yours with this TXT record, then verify. Until then the domain is neither served nor given a certificate.",
"pages.domain_verified": "Domain verified.",
"pages.draft": "draft",
"pages.export": "Export as HTML",
diff --git a/internal/statuspage/statuspage.go b/internal/statuspage/statuspage.go
index 48b56db..e53ba12 100644
--- a/internal/statuspage/statuspage.go
+++ b/internal/statuspage/statuspage.go
@@ -45,6 +45,15 @@ const (
// staleNoticeAfter is when visitors are told the state may be outdated;
// a page nobody visited is up to syncInterval old.
staleNoticeAfter = 2 * syncInterval
+ // missFor is how long a host or slug without a page is answered
+ // without asking the API again.
+ missFor = time.Minute
+ maxMissing = 10_000
+ // unknownPerSecond bounds the lookups of hosts and slugs that are
+ // neither cached nor known to be missing, so a flood of made-up names
+ // is not passed on to the API. Every page the API lists is cached by
+ // the sync, so known pages are not affected.
+ unknownPerSecond = 20
)
// Source fetches snapshots; *agentapi.Client implements it.
@@ -70,8 +79,14 @@ type Server struct {
mu sync.Mutex
cache map[string]entry
refreshing map[string]bool
- // visited holds when each page was last visited.
+ // visited holds when each cached page was last visited.
visited map[string]time.Time
+ // missing holds when a key was last found to have no page.
+ missing map[string]time.Time
+ // unknownSecond and unknownCount count lookups passed on to the API in
+ // the current second.
+ unknownSecond int64
+ unknownCount int
// background tracks refreshes started by visits.
background sync.WaitGroup
}
@@ -104,6 +119,7 @@ func New(src Source, catalog *i18n.Catalog, log *slog.Logger, o Options) (*Serve
s := &Server{
src: src, catalog: catalog, log: log, ownHosts: map[string]bool{}, dir: o.CacheDir,
now: time.Now, cache: map[string]entry{}, refreshing: map[string]bool{}, visited: map[string]time.Time{},
+ missing: map[string]time.Time{},
}
for _, h := range o.Hosts {
s.ownHosts[strings.ToLower(h)] = true
@@ -167,6 +183,7 @@ func (s *Server) persist(e entry) {
func (s *Server) forget(key string) {
s.mu.Lock()
delete(s.cache, key)
+ delete(s.visited, key)
s.mu.Unlock()
if s.dir != "" {
_ = os.Remove(s.fileFor(key))
@@ -321,9 +338,15 @@ func (s *Server) localizeRequest(c *gin.Context) {
// lookup answers from the cache whenever possible and refreshes in the
// background; only unknown pages wait for the API.
func (s *Server) lookup(ctx context.Context, key, host, slug string) (entry, bool) {
+ now := s.now()
s.mu.Lock()
e, cached := s.cache[key]
- s.visited[key] = s.now()
+ if cached {
+ s.visited[key] = now
+ } else if !s.mayAsk(key, now) {
+ s.mu.Unlock()
+ return entry{}, false
+ }
s.mu.Unlock()
if cached {
if s.now().Sub(e.Fetched) >= freshFor {
@@ -331,7 +354,29 @@ func (s *Server) lookup(ctx context.Context, key, host, slug string) (entry, boo
}
return e, true
}
- return s.fetch(ctx, key, host, slug)
+ e, ok := s.fetch(ctx, key, host, slug)
+ if ok {
+ s.mu.Lock()
+ s.visited[key] = now
+ s.mu.Unlock()
+ }
+ return e, ok
+}
+
+// mayAsk reports whether an uncached key may be looked up at the API: not
+// when it was just found missing, nor beyond unknownPerSecond. s.mu is held.
+func (s *Server) mayAsk(key string, now time.Time) bool {
+ if t, ok := s.missing[key]; ok && now.Sub(t) < missFor {
+ return false
+ }
+ if sec := now.Unix(); sec != s.unknownSecond {
+ s.unknownSecond, s.unknownCount = sec, 0
+ }
+ if s.unknownCount >= unknownPerSecond {
+ return false
+ }
+ s.unknownCount++
+ return true
}
func (s *Server) fetch(ctx context.Context, key, host, slug string) (entry, bool) {
@@ -351,6 +396,12 @@ func (s *Server) fetch(ctx context.Context, key, host, slug string) (entry, bool
return old, true
case errors.Is(err, agentapi.ErrNotFound):
s.forget(key)
+ s.mu.Lock()
+ if len(s.missing) >= maxMissing {
+ clear(s.missing)
+ }
+ s.missing[key] = s.now()
+ s.mu.Unlock()
return entry{}, false
case err != nil:
s.log.WarnContext(ctx, "fetching status page failed", "page", key, "error", err)
@@ -362,6 +413,7 @@ func (s *Server) fetch(ctx context.Context, key, host, slug string) (entry, bool
e := entry{Key: key, Host: host, Slug: slug, Snap: snap, Fetched: s.now(), Checksum: snap.Checksum()}
s.mu.Lock()
s.cache[key] = e
+ delete(s.missing, key)
s.mu.Unlock()
s.persist(e)
return e, true
diff --git a/internal/statuspage/tls.go b/internal/statuspage/tls.go
index 1d5efd8..c983d73 100644
--- a/internal/statuspage/tls.go
+++ b/internal/statuspage/tls.go
@@ -151,6 +151,40 @@ func (s CertStorage) Unlock(ctx context.Context, name string) error {
return s.c.StorageUnlock(ctx, name)
}
+// CertificateGate is asked before a new certificate is ordered;
+// *agentapi.Client implements it.
+type CertificateGate interface {
+ AllowCertificate(ctx context.Context, name string) error
+}
+
+// OnCertEvent is certmagic's event hook. Before a new certificate for a
+// custom domain is ordered it asks the API, which allows verified domains
+// of pages this server serves within limits shared by all servers; that
+// keeps the CA's rate limits from being used up. Renewals and the default
+// hosts are not asked about.
+func (s *Server) OnCertEvent(ctx context.Context, event string, data map[string]any) error {
+ if event != "cert_obtaining" || data["renewal"] == true {
+ return nil
+ }
+ name, _ := data["identifier"].(string)
+ host := hostOnly(name)
+ gate, ok := s.src.(CertificateGate)
+ if s.ownHosts[host] || !ok {
+ return nil
+ }
+ switch err := gate.AllowCertificate(ctx, host); {
+ case err == nil:
+ return nil
+ case errors.Is(err, agentapi.ErrRateLimited):
+ s.log.WarnContext(ctx, "certificate order refused: limit reached", "domain", host)
+ return fmt.Errorf("limit on new certificates reached for %s", host)
+ case errors.Is(err, agentapi.ErrNotFound):
+ return fmt.Errorf("no status page for %s", host)
+ default:
+ return fmt.Errorf("asking whether to order a certificate for %s: %w", host, err)
+ }
+}
+
// AllowCertificate decides whether to obtain a certificate for name on
// demand: only for the default hosts and for verified custom domains of
// pages this server may serve. Anything else would let strangers make us
diff --git a/internal/statuspage/tls_test.go b/internal/statuspage/tls_test.go
new file mode 100644
index 0000000..8daed5a
--- /dev/null
+++ b/internal/statuspage/tls_test.go
@@ -0,0 +1,115 @@
+package statuspage
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "net/http"
+ "testing"
+ "time"
+
+ "git.zb-server.de/ZB-Server/uptimesebi/internal/agentapi"
+)
+
+func (f *fakeSource) callCount() int {
+ f.mu.Lock()
+ defer f.mu.Unlock()
+ return f.calls
+}
+
+func TestUnknownNamesAreNotAskedAgainAtOnce(t *testing.T) {
+ now := time.Now()
+ src := newSource()
+ h := newHarness(t, src, "", &now)
+ for range 3 {
+ if code, _ := h.get("nope.example.test", "/"); code != http.StatusNotFound {
+ t.Fatalf("unknown host = %d, want 404", code)
+ }
+ }
+ if n := src.callCount(); n != 1 {
+ t.Errorf("the API was asked %d times about one unknown host, want 1", n)
+ }
+ now = now.Add(missFor)
+ h.get("nope.example.test", "/")
+ if n := src.callCount(); n != 2 {
+ t.Errorf("after %v the API was asked %d times in all, want 2", missFor, n)
+ }
+ h.srv.mu.Lock()
+ visited := len(h.srv.visited)
+ h.srv.mu.Unlock()
+ if visited != 0 {
+ t.Errorf("unknown hosts were recorded as visited pages: %d", visited)
+ }
+}
+
+func TestFloodOfMadeUpNamesIsThrottled(t *testing.T) {
+ now := time.Now()
+ src := newSource()
+ h := newHarness(t, src, "", &now)
+ h.srv.Sync(context.Background())
+ before := src.callCount()
+ for i := range 200 {
+ h.get(fmt.Sprintf("x%d.example.test", i), "/")
+ }
+ if n := src.callCount() - before; n > unknownPerSecond {
+ t.Errorf("a flood of made-up hosts reached the API %d times in one second, want at most %d", n, unknownPerSecond)
+ }
+ // Pages the sync cached are still served during the flood.
+ if code, _ := h.get("status.acme.test", "/"); code != http.StatusOK {
+ t.Errorf("a known page during the flood = %d, want 200", code)
+ }
+ now = now.Add(time.Second)
+ if err := h.srv.AllowCertificate(context.Background(), "status.acme.test"); err != nil {
+ t.Errorf("a known custom domain after the flood: %v", err)
+ }
+}
+
+type gatedSource struct {
+ *fakeSource
+ asked []string
+ err error
+}
+
+func (g *gatedSource) AllowCertificate(_ context.Context, name string) error {
+ g.asked = append(g.asked, name)
+ return g.err
+}
+
+func TestNewCertificatesAreOrderedOnlyWhenTheAPIAllows(t *testing.T) {
+ now := time.Now()
+ g := &gatedSource{fakeSource: newSource()}
+ h := newHarness(t, g.fakeSource, "", &now)
+ h.srv.src = g
+ ctx := context.Background()
+ obtain := func(name string, renewal bool) error {
+ data := map[string]any{"identifier": name}
+ if renewal {
+ data["renewal"] = true
+ }
+ return h.srv.OnCertEvent(ctx, "cert_obtaining", data)
+ }
+
+ if err := obtain("status.acme.test", false); err != nil {
+ t.Errorf("allowed order: %v", err)
+ }
+ // Renewals, the default hosts and other events are not asked about.
+ if err := obtain("status.acme.test", true); err != nil {
+ t.Errorf("renewal: %v", err)
+ }
+ if err := obtain("status.example.test", false); err != nil {
+ t.Errorf("default host: %v", err)
+ }
+ if err := h.srv.OnCertEvent(ctx, "cert_obtained", map[string]any{"identifier": "status.acme.test"}); err != nil {
+ t.Errorf("other event: %v", err)
+ }
+ if len(g.asked) != 1 || g.asked[0] != "status.acme.test" {
+ t.Errorf("asked about %v, want only the new order", g.asked)
+ }
+
+ for _, refuse := range []error{agentapi.ErrRateLimited, agentapi.ErrNotFound, errors.New("api down")} {
+ g.err = refuse
+ if err := obtain("status.acme.test", false); err == nil {
+ t.Errorf("order went ahead although the API answered %v", refuse)
+ }
+ }
+}
diff --git a/internal/web/statuspages.templ b/internal/web/statuspages.templ
index 2377201..1233506 100644
--- a/internal/web/statuspages.templ
+++ b/internal/web/statuspages.templ
@@ -106,6 +106,11 @@ type PageEditor struct {
URL string
Domain string
DomainVerified bool
+ // CNAMETarget is the host of the platform's status page servers that
+ // custom domains point at; empty when unknown.
+ CNAMETarget string
+ // DomainChangesPerDay is how often the domain may be changed a day.
+ DomainChangesPerDay int
RecordName string
RecordValue string
Suspended bool
@@ -290,27 +295,49 @@ templ StatusPageEditor(p Page, me Me, e PageEditor) {
@sectionHeading("pages.domain")
+ { i18n.T(ctx, "pages.domain_intro") }
if e.Domain != "" {
-
- if e.DomainVerified {
-
● { i18n.T(ctx, "pages.domain_verified") }
-
{ i18n.T(ctx, "pages.domain_cname") }
- } else {
-
{ i18n.T(ctx, "pages.domain_instructions") }
-
- TXT
- { e.RecordName }
- { i18n.T(ctx, "pages.value") }
- { e.RecordValue }
-
-
{ i18n.T(ctx, "pages.verify") }
- }
-
+
+
+ if e.DomainVerified {
+ ● { i18n.T(ctx, "pages.domain_step_verified") }
+ } else {
+ { i18n.T(ctx, "pages.domain_step_verify") }
+
+ TXT
+ { e.RecordName }
+ { i18n.T(ctx, "pages.value") }
+ { e.RecordValue }
+
+ { i18n.T(ctx, "pages.verify") }
+ }
+
+
+ switch {
+ case e.OwnServers:
+ { i18n.T(ctx, "pages.domain_step_cname_own") }
+ case e.CNAMETarget != "":
+ { i18n.T(ctx, "pages.domain_step_cname") }
+
+ CNAME
+ { e.Domain }
+ { i18n.T(ctx, "pages.value") }
+ { e.CNAMETarget + "." }
+
+ default:
+ { i18n.T(ctx, "pages.domain_step_cname_unknown") }
+ }
+ { i18n.T(ctx, "pages.domain_apex") }
+
+
+ { i18n.T(ctx, "pages.domain_step_tls", "Count", e.DomainChangesPerDay) }
+
+
}
diff --git a/internal/web/statuspages_templ.go b/internal/web/statuspages_templ.go
index 7f15358..80e925a 100644
--- a/internal/web/statuspages_templ.go
+++ b/internal/web/statuspages_templ.go
@@ -321,26 +321,31 @@ type PageMonitorOption struct {
type PageEditor struct {
// OwnServers is set when the organization's own status page servers
// serve its pages instead of the platform's.
- OwnServers bool
- ID string
- Title string
- Slug string
- Description string
- Published bool
- ShowDetails bool
- Accent string
- LogoURL string
- CSS string
- URL string
- Domain string
- DomainVerified bool
- RecordName string
- RecordValue string
- Suspended bool
- SuspendedReason string
- Groups []PageGroupRow
- HasOrgGroups bool
- Monitors []PageMonitorOption
+ OwnServers bool
+ ID string
+ Title string
+ Slug string
+ Description string
+ Published bool
+ ShowDetails bool
+ Accent string
+ LogoURL string
+ CSS string
+ URL string
+ Domain string
+ DomainVerified bool
+ // CNAMETarget is the host of the platform's status page servers that
+ // custom domains point at; empty when unknown.
+ CNAMETarget string
+ // DomainChangesPerDay is how often the domain may be changed a day.
+ DomainChangesPerDay int
+ RecordName string
+ RecordValue string
+ Suspended bool
+ SuspendedReason string
+ Groups []PageGroupRow
+ HasOrgGroups bool
+ Monitors []PageMonitorOption
}
func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
@@ -379,7 +384,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.title"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 120, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 125, Col: 115}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
@@ -397,7 +402,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.suspended_notice"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 123, Col: 43}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 128, Col: 43}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
@@ -411,7 +416,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(" " + i18n.T(ctx, "console.suspended_reason", "Reason", e.SuspendedReason))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 125, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 130, Col: 81}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
@@ -430,7 +435,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(e.Title)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 130, Col: 46}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 135, Col: 46}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
@@ -448,7 +453,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(e.URL)).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 133, Col: 35}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 138, Col: 35}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18)
if templ_7745c5c3_Err != nil {
@@ -461,7 +466,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.open"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 133, Col: 130}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 138, Col: 130}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
if templ_7745c5c3_Err != nil {
@@ -479,7 +484,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL("/api/v1/org/statuspages/" + e.ID + "/export")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 135, Col: 74}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 140, Col: 74}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var20)
if templ_7745c5c3_Err != nil {
@@ -492,7 +497,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var21 string
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.export"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 135, Col: 140}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 140, Col: 140}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
if templ_7745c5c3_Err != nil {
@@ -510,7 +515,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var22 string
templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.own_servers"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 139, Col: 88}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 144, Col: 88}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
if templ_7745c5c3_Err != nil {
@@ -536,7 +541,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/statuspages/" + e.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 144, Col: 47}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 149, Col: 47}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var23)
if templ_7745c5c3_Err != nil {
@@ -549,7 +554,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var24 string
templ_7745c5c3_Var24, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/statuspages/" + e.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 144, Col: 102}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 149, Col: 102}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24)
if templ_7745c5c3_Err != nil {
@@ -578,7 +583,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.description"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 149, Col: 121}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 154, Col: 121}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
if templ_7745c5c3_Err != nil {
@@ -611,7 +616,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.show_details_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 154, Col: 86}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 159, Col: 86}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
if templ_7745c5c3_Err != nil {
@@ -624,7 +629,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.theme"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 155, Col: 111}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 160, Col: 111}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil {
@@ -649,7 +654,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var28 string
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.css"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 159, Col: 113}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 164, Col: 113}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
if templ_7745c5c3_Err != nil {
@@ -662,7 +667,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var29 string
templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(e.CSS)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 160, Col: 160}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 165, Col: 160}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
if templ_7745c5c3_Err != nil {
@@ -683,7 +688,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/statuspages/" + e.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 166, Col: 45}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 171, Col: 45}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var30)
if templ_7745c5c3_Err != nil {
@@ -696,7 +701,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "pages.delete_confirm")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 167, Col: 55}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 172, Col: 55}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var31)
if templ_7745c5c3_Err != nil {
@@ -709,7 +714,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.delete"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 170, Col: 34}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 175, Col: 34}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
if templ_7745c5c3_Err != nil {
@@ -731,7 +736,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var33 string
templ_7745c5c3_Var33, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/statuspages/" + e.ID + "/groups/import").Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 179, Col: 65}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 184, Col: 65}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var33)
if templ_7745c5c3_Err != nil {
@@ -744,7 +749,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var34 string
templ_7745c5c3_Var34, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "pages.groups_import_confirm")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 180, Col: 65}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 185, Col: 65}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var34)
if templ_7745c5c3_Err != nil {
@@ -757,7 +762,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var35 string
templ_7745c5c3_Var35, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "pages.groups_imported")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 181, Col: 54}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 186, Col: 54}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var35)
if templ_7745c5c3_Err != nil {
@@ -770,7 +775,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var36 string
templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.groups_import"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 184, Col: 44}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 189, Col: 44}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36))
if templ_7745c5c3_Err != nil {
@@ -788,7 +793,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var37 string
templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.groups_intro"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 187, Col: 75}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 192, Col: 75}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
if templ_7745c5c3_Err != nil {
@@ -811,7 +816,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var38 string
templ_7745c5c3_Var38, templ_7745c5c3_Err = templruntime.SanitizeStyleAttributeValues(indent(g.Depth))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 191, Col: 48}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 196, Col: 48}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var38))
if templ_7745c5c3_Err != nil {
@@ -824,7 +829,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var39 string
templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(g.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 194, Col: 25}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 199, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39))
if templ_7745c5c3_Err != nil {
@@ -837,7 +842,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var40 string
templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "common.edit"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 195, Col: 72}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 200, Col: 72}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40))
if templ_7745c5c3_Err != nil {
@@ -850,7 +855,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var41 string
templ_7745c5c3_Var41, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/statuspages/" + e.ID + "/groups/" + g.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 197, Col: 73}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 202, Col: 73}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var41)
if templ_7745c5c3_Err != nil {
@@ -863,7 +868,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var42 string
templ_7745c5c3_Var42, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/statuspages/" + e.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 197, Col: 128}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 202, Col: 128}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var42)
if templ_7745c5c3_Err != nil {
@@ -888,7 +893,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var43 string
templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.parent"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 201, Col: 123}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 206, Col: 123}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43))
if templ_7745c5c3_Err != nil {
@@ -941,7 +946,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var46 string
templ_7745c5c3_Var46, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.none"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 203, Col: 58}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 208, Col: 58}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var46))
if templ_7745c5c3_Err != nil {
@@ -960,7 +965,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var47 string
templ_7745c5c3_Var47, templ_7745c5c3_Err = templruntime.NewAttributeExpression(opt.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 206, Col: 37}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 211, Col: 37}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var47)
if templ_7745c5c3_Err != nil {
@@ -983,7 +988,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var48 string
templ_7745c5c3_Var48, templ_7745c5c3_Err = templ.JoinStringErrs(opt.Label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 206, Col: 86}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 211, Col: 86}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var48))
if templ_7745c5c3_Err != nil {
@@ -1002,7 +1007,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var49 string
templ_7745c5c3_Var49, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.group_position"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 212, Col: 130}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 217, Col: 130}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var49))
if templ_7745c5c3_Err != nil {
@@ -1023,7 +1028,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var50 string
templ_7745c5c3_Var50, templ_7745c5c3_Err = templruntime.NewAttributeExpression(strconv.Itoa(g.Position)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 213, Col: 93}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 218, Col: 93}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var50)
if templ_7745c5c3_Err != nil {
@@ -1076,7 +1081,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var53 string
templ_7745c5c3_Var53, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/statuspages/" + e.ID + "/groups/" + g.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 219, Col: 73}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 224, Col: 73}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var53)
if templ_7745c5c3_Err != nil {
@@ -1089,7 +1094,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var54 string
templ_7745c5c3_Var54, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "groups.delete_confirm")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 220, Col: 64}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 225, Col: 64}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var54)
if templ_7745c5c3_Err != nil {
@@ -1102,7 +1107,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var55 string
templ_7745c5c3_Var55, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/statuspages/" + e.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 221, Col: 47}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 226, Col: 47}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var55)
if templ_7745c5c3_Err != nil {
@@ -1115,7 +1120,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var56 string
templ_7745c5c3_Var56, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "common.delete"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 223, Col: 43}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 228, Col: 43}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var56))
if templ_7745c5c3_Err != nil {
@@ -1138,7 +1143,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var57 string
templ_7745c5c3_Var57, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/statuspages/" + e.ID + "/groups").Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 231, Col: 60}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 236, Col: 60}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var57)
if templ_7745c5c3_Err != nil {
@@ -1151,7 +1156,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var58 string
templ_7745c5c3_Var58, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/statuspages/" + e.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 231, Col: 97}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 236, Col: 97}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var58)
if templ_7745c5c3_Err != nil {
@@ -1172,7 +1177,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var59 string
templ_7745c5c3_Var59, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.create"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 235, Col: 82}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 240, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var59))
if templ_7745c5c3_Err != nil {
@@ -1193,7 +1198,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var60 string
templ_7745c5c3_Var60, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "sso.field.name")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 236, Col: 95}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 241, Col: 95}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var60)
if templ_7745c5c3_Err != nil {
@@ -1238,7 +1243,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var63 string
templ_7745c5c3_Var63, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.parent"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 239, Col: 82}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 244, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var63))
if templ_7745c5c3_Err != nil {
@@ -1291,7 +1296,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var66 string
templ_7745c5c3_Var66, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.none"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 241, Col: 54}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 246, Col: 54}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var66))
if templ_7745c5c3_Err != nil {
@@ -1309,7 +1314,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var67 string
templ_7745c5c3_Var67, templ_7745c5c3_Err = templruntime.NewAttributeExpression(opt.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 243, Col: 32}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 248, Col: 32}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var67)
if templ_7745c5c3_Err != nil {
@@ -1322,7 +1327,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var68 string
templ_7745c5c3_Var68, templ_7745c5c3_Err = templ.JoinStringErrs(opt.Label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 243, Col: 46}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 248, Col: 46}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var68))
if templ_7745c5c3_Err != nil {
@@ -1340,7 +1345,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var69 string
templ_7745c5c3_Var69, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.group_position"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 248, Col: 89}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 253, Col: 89}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var69))
if templ_7745c5c3_Err != nil {
@@ -1361,7 +1366,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var70 string
templ_7745c5c3_Var70, templ_7745c5c3_Err = templruntime.NewAttributeExpression(strconv.Itoa(len(e.Groups))).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 249, Col: 92}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 254, Col: 92}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var70)
if templ_7745c5c3_Err != nil {
@@ -1422,7 +1427,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var73 string
templ_7745c5c3_Var73, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/statuspages/" + e.ID + "/monitors").Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 259, Col: 62}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 264, Col: 62}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var73)
if templ_7745c5c3_Err != nil {
@@ -1435,7 +1440,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var74 string
templ_7745c5c3_Var74, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/statuspages/" + e.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 259, Col: 138}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 264, Col: 138}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var74)
if templ_7745c5c3_Err != nil {
@@ -1457,7 +1462,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var75 string
templ_7745c5c3_Var75, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.monitors.empty"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 262, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 267, Col: 81}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var75))
if templ_7745c5c3_Err != nil {
@@ -1490,7 +1495,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var76 string
templ_7745c5c3_Var76, templ_7745c5c3_Err = templruntime.NewAttributeExpression(m.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 267, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 272, Col: 115}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var76)
if templ_7745c5c3_Err != nil {
@@ -1503,7 +1508,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var77 string
templ_7745c5c3_Var77, templ_7745c5c3_Err = templ.JoinStringErrs(m.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 269, Col: 24}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 274, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var77))
if templ_7745c5c3_Err != nil {
@@ -1521,7 +1526,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var78 string
templ_7745c5c3_Var78, templ_7745c5c3_Err = templ.JoinStringErrs(m.MonitorGroupPath)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 271, Col: 74}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 276, Col: 74}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var78))
if templ_7745c5c3_Err != nil {
@@ -1539,7 +1544,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var79 string
templ_7745c5c3_Var79, templ_7745c5c3_Err = templruntime.NewAttributeExpression(m.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 274, Col: 66}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 279, Col: 66}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var79)
if templ_7745c5c3_Err != nil {
@@ -1552,7 +1557,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var80 string
templ_7745c5c3_Var80, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "pages.group")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 277, Col: 93}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 282, Col: 93}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var80)
if templ_7745c5c3_Err != nil {
@@ -1565,7 +1570,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var81 string
templ_7745c5c3_Var81, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.no_group"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 278, Col: 59}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 283, Col: 59}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var81))
if templ_7745c5c3_Err != nil {
@@ -1583,7 +1588,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var82 string
templ_7745c5c3_Var82, templ_7745c5c3_Err = templruntime.NewAttributeExpression(opt.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 280, Col: 34}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 285, Col: 34}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var82)
if templ_7745c5c3_Err != nil {
@@ -1606,7 +1611,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var83 string
templ_7745c5c3_Var83, templ_7745c5c3_Err = templ.JoinStringErrs(opt.Label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 280, Col: 82}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 285, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var83))
if templ_7745c5c3_Err != nil {
@@ -1624,7 +1629,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var84 string
templ_7745c5c3_Var84, templ_7745c5c3_Err = templruntime.NewAttributeExpression(m.Label).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 283, Col: 51}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 288, Col: 51}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var84)
if templ_7745c5c3_Err != nil {
@@ -1637,7 +1642,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var85 string
templ_7745c5c3_Var85, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "pages.label")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 283, Col: 94}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 288, Col: 94}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var85)
if templ_7745c5c3_Err != nil {
@@ -1664,33 +1669,46 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 144, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 148, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if e.Domain != "" {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 148, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 149, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if e.DomainVerified {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 149, "● ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var88 string
- templ_7745c5c3_Var88, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_verified"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 301, Col: 82}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var88))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 150, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 150, "
● ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var89 string
- templ_7745c5c3_Var89, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_cname"))
+ templ_7745c5c3_Var89, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_verified"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 302, Col: 78}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 308, Col: 88}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var89))
if templ_7745c5c3_Err != nil {
@@ -1752,9 +1757,9 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var90 string
- templ_7745c5c3_Var90, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_instructions"))
+ templ_7745c5c3_Var90, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_verify"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 304, Col: 66}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 310, Col: 66}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var90))
if templ_7745c5c3_Err != nil {
@@ -1767,7 +1772,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var91 string
templ_7745c5c3_Var91, templ_7745c5c3_Err = templ.JoinStringErrs(e.RecordName)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 307, Col: 45}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 313, Col: 46}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var91))
if templ_7745c5c3_Err != nil {
@@ -1780,7 +1785,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var92 string
templ_7745c5c3_Var92, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.value"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 308, Col: 60}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 314, Col: 61}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var92))
if templ_7745c5c3_Err != nil {
@@ -1793,7 +1798,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var93 string
templ_7745c5c3_Var93, templ_7745c5c3_Err = templ.JoinStringErrs(e.RecordValue)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 309, Col: 46}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 315, Col: 47}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var93))
if templ_7745c5c3_Err != nil {
@@ -1806,7 +1811,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var94 string
templ_7745c5c3_Var94, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/statuspages/" + e.ID + "/domain/verify").Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 311, Col: 87}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 317, Col: 88}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var94)
if templ_7745c5c3_Err != nil {
@@ -1819,7 +1824,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var95 string
templ_7745c5c3_Var95, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "pages.domain_verified")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 311, Col: 136}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 317, Col: 137}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var95)
if templ_7745c5c3_Err != nil {
@@ -1832,7 +1837,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var96 string
templ_7745c5c3_Var96, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.verify"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 311, Col: 256}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 317, Col: 257}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var96))
if templ_7745c5c3_Err != nil {
@@ -1843,12 +1848,137 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 160, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 160, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ switch {
+ case e.OwnServers:
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 161, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var97 string
+ templ_7745c5c3_Var97, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_cname_own"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 323, Col: 57}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var97))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 162, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ case e.CNAMETarget != "":
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 163, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var98 string
+ templ_7745c5c3_Var98, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_cname"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 325, Col: 66}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var98))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 164, "
CNAME ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var99 string
+ templ_7745c5c3_Var99, templ_7745c5c3_Err = templ.JoinStringErrs(e.Domain)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 328, Col: 43}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var99))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 165, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var100 string
+ templ_7745c5c3_Var100, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.value"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 329, Col: 62}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var100))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 166, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var101 string
+ templ_7745c5c3_Var101, templ_7745c5c3_Err = templ.JoinStringErrs(e.CNAMETarget + ".")
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 330, Col: 54}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var101))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 167, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ default:
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 168, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var102 string
+ templ_7745c5c3_Var102, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_cname_unknown"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 333, Col: 61}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var102))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 169, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 170, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var103 string
+ templ_7745c5c3_Var103, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_apex"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 335, Col: 77}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var103))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 171, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var104 string
+ templ_7745c5c3_Var104, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_tls", "Count", e.DomainChangesPerDay))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 338, Col: 108}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var104))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 172, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 161, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 173, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
--
2.54.1
From 66537f4e651352f942d29f228b2d790fb442581f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Untersch=C3=BCtz?=
Date: Wed, 25 Nov 2026 22:58:54 +0100
Subject: [PATCH 2/3] fix: keep Redis timeouts below a second exact
A checker's long poll ends with BLPOP waiting the rest of it, often below
a second, which go-redis rounded up to one second with a warning in the
log; the poll then ran up to a second too long. Such waits now pass BLPOP
a fraction of a second, which Redis takes since 6.0. A session's sliding
expiry, which can be below a second near its absolute end, uses PEXPIRE.
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
---
internal/auth/session.go | 3 ++-
internal/schedule/schedule.go | 11 ++++++++++-
internal/schedule/schedule_test.go | 17 ++++++++++++++++-
3 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/internal/auth/session.go b/internal/auth/session.go
index f283914..b1be3ca 100644
--- a/internal/auth/session.go
+++ b/internal/auth/session.go
@@ -152,7 +152,8 @@ func (s *Sessions) Get(ctx context.Context, token string) (*Session, error) {
}
// Sliding expiry, but never beyond the absolute lifetime.
remaining := s.absolute - s.now().Sub(sess.CreatedAt)
- if err := s.rdb.Expire(ctx, k, min(s.idle, remaining)).Err(); err != nil {
+ // PEXPIRE: the rest of the lifetime may be below a second.
+ if err := s.rdb.PExpire(ctx, k, min(s.idle, remaining)).Err(); err != nil {
return nil, fmt.Errorf("auth: touch session: %w", err)
}
return sess, nil
diff --git a/internal/schedule/schedule.go b/internal/schedule/schedule.go
index be11e75..e54d358 100644
--- a/internal/schedule/schedule.go
+++ b/internal/schedule/schedule.go
@@ -281,7 +281,7 @@ func (s *Scheduler) Take(ctx context.Context, instance uuid.UUID, max int, wait
return nil, nil
}
// BLPOP blocks server side and ignores ctx, so wait in slices.
- first, err := s.rdb.BLPop(ctx, min(left, time.Second), q).Result()
+ first, err := s.blpop(ctx, min(left, time.Second), q)
if errors.Is(err, redis.Nil) {
continue
}
@@ -306,6 +306,15 @@ func (s *Scheduler) Take(ctx context.Context, instance uuid.UUID, max int, wait
return out, nil
}
+// blpop is BLPOP with a timeout below a second, which go-redis would round
+// up to one (Redis takes fractions of seconds since 6.0).
+func (s *Scheduler) blpop(ctx context.Context, timeout time.Duration, key string) ([]string, error) {
+ if timeout >= time.Second {
+ return s.rdb.BLPop(ctx, timeout, key).Result()
+ }
+ return s.rdb.Do(ctx, "BLPOP", key, strconv.FormatFloat(timeout.Seconds(), 'f', 3, 64)).StringSlice()
+}
+
// Release returns instance's queued runs to its region and forgets it.
func (s *Scheduler) Release(ctx context.Context, region string, instance uuid.UUID) error {
// Marking the instance stale lets the dispatch script do the handover,
diff --git a/internal/schedule/schedule_test.go b/internal/schedule/schedule_test.go
index 590d071..77b6dff 100644
--- a/internal/schedule/schedule_test.go
+++ b/internal/schedule/schedule_test.go
@@ -188,11 +188,26 @@ func TestTakeWaits(t *testing.T) {
if err != nil || len(got) != 0 {
t.Fatalf("Take() on empty queue = %v, %v", got, err)
}
- if waited := time.Since(start); waited < 250*time.Millisecond {
+ // Not rounded up to the second that BLPOP counts in.
+ if waited := time.Since(start); waited < 250*time.Millisecond || waited > 800*time.Millisecond {
t.Errorf("Take() returned after %v, want it to wait about 300ms", waited)
}
}
+func TestTakeGetsAJobDuringAShortWait(t *testing.T) {
+ s, _ := newTest(t)
+ ctx := context.Background()
+ in, monitor := uuid.New(), uuid.New()
+ go func() {
+ time.Sleep(100 * time.Millisecond)
+ s.rdb.RPush(ctx, jobsPrefix+in.String(), monitor.String()+"|1800000000000")
+ }()
+ got, err := s.Take(ctx, in, 10, 600*time.Millisecond)
+ if err != nil || len(got) != 1 || got[0].MonitorID != monitor {
+ t.Fatalf("Take() = %v, %v; want the job pushed while waiting", got, err)
+ }
+}
+
func TestTakeReturnsWhenCancelled(t *testing.T) {
s, _ := newTest(t)
ctx, cancel := context.WithCancel(context.Background())
--
2.54.1
From 5934bd74e8cee48d13ba219a391f5e70165d27b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Untersch=C3=BCtz?=
Date: Wed, 25 Nov 2026 22:58:54 +0100
Subject: [PATCH 3/3] feat: verify custom domains by a CNAME unique to the page
A custom domain now needs a single record: a CNAME to
., where the label is derived from the page's
domain token. The wildcard record of the status page host routes it, and
since the target belongs to one page alone it also proves who set it up;
a CNAME to the shared host would not, as any organization could then
claim a domain pointing at the platform. The TXT record stays for domains
whose CNAME cannot be seen, behind a proxy or without a subdomain.
- The domain watch looks for the records of a new domain every minute for
a quarter of an hour, then every ten minutes for two days, and verifies
it on its own; "Check now" still works.
- Verified domains are checked daily. When the record is gone the owners
are told, and a week later the domain is switched off, so a record left
behind cannot be taken over. Domains verified before keep working
without checks.
- The editor shows the CNAME record first, the TXT way for proxies and
apex domains, how the domain was verified and when a missing record will
switch it off. The API returns cname_record and domain_missing_since.
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
---
cmd/api/main.go | 1 +
internal/api/certificates_test.go | 2 +-
internal/api/console.go | 11 +-
internal/api/domains.go | 176 +++++
internal/api/domains_test.go | 205 ++++++
internal/api/export_test.go | 8 +
internal/api/statuspages.go | 31 +-
internal/i18n/locales/de.json | 25 +-
internal/i18n/locales/en.json | 25 +-
.../migrations/sql/00052_domain_checks.sql | 19 +
internal/store/models.go | 4 +
internal/store/querier.go | 15 +-
internal/store/queries/status_pages.sql | 53 +-
internal/store/status_pages.sql.go | 165 ++++-
internal/web/statuspages.templ | 99 +--
internal/web/statuspages_templ.go | 600 +++++++++++-------
16 files changed, 1132 insertions(+), 307 deletions(-)
create mode 100644 internal/api/domains.go
create mode 100644 internal/api/domains_test.go
create mode 100644 internal/migrations/sql/00052_domain_checks.sql
diff --git a/cmd/api/main.go b/cmd/api/main.go
index f178a84..f7cc2ed 100644
--- a/cmd/api/main.go
+++ b/cmd/api/main.go
@@ -93,6 +93,7 @@ func run(log *slog.Logger, level *slog.LevelVar, args []string) error {
go srv.RunNotifier(ctx)
go srv.RunHousekeeping(ctx)
go srv.RunRegionWatch(ctx)
+ go srv.RunDomainWatch(ctx)
go srv.RunHeartbeats(ctx)
return platform.Serve(ctx, log, platform.NewHTTPServer(cfg.Listen, r), health, 5*time.Second, cfg.ShutdownTimeout)
diff --git a/internal/api/certificates_test.go b/internal/api/certificates_test.go
index 6d03d35..afa9ff5 100644
--- a/internal/api/certificates_test.go
+++ b/internal/api/certificates_test.go
@@ -49,7 +49,7 @@ func TestCertificateOrdersAreLimited(t *testing.T) {
// The editor explains the records, with the platform's servers as the
// CNAME target.
_, _, html := owner.page("/statuspages/" + id1)
- for _, want := range []string{"Prove the domain is yours", "status.platform.test.", "ALIAS or ANAME", "at most 10 times a day"} {
+ for _, want := range []string{"Create this CNAME record", ".status.platform.test.", "Prove the domain with this TXT record", "ALIAS or ANAME", "at most 10 times a day"} {
if !strings.Contains(html, want) {
t.Errorf("the editor lacks %q", want)
}
diff --git a/internal/api/console.go b/internal/api/console.go
index 8a2b70e..aefd208 100644
--- a/internal/api/console.go
+++ b/internal/api/console.go
@@ -1142,7 +1142,7 @@ func (s *Server) statusPageEditor(c *gin.Context, p *principal, page web.Page, m
if err != nil {
return nil, err
}
- v := viewStatusPage(row)
+ v := s.viewStatusPage(row)
e := web.PageEditor{
ID: row.ID.String(), Title: row.Title, Slug: row.Slug, Description: row.Description,
Published: row.Published, ShowDetails: row.ShowComponentDetails,
@@ -1155,8 +1155,13 @@ func (s *Server) statusPageEditor(c *gin.Context, p *principal, page web.Page, m
e.RecordName, e.RecordValue = v.DomainRecord.Name, v.DomainRecord.Value
}
e.DomainChangesPerDay = domainChangesPerDay
- if !own {
- e.CNAMETarget = s.cnameTarget()
+ if v.CNAMERecord != nil {
+ e.CNAMEValue = v.CNAMERecord.Value
+ }
+ e.VerifiedBy = deref(row.DomainVerifyMethod)
+ if f := row.DomainFailingSince; f != nil {
+ e.MissingSince = f.Local().Format("2006-01-02 15:04")
+ e.SwitchOffAt = f.Add(domainGrace).Local().Format("2006-01-02 15:04")
}
newPageGroupTree(pageGroups).walk(func(g store.StatusPageGroup, depth int) {
var parentID string
diff --git a/internal/api/domains.go b/internal/api/domains.go
new file mode 100644
index 0000000..47f213d
--- /dev/null
+++ b/internal/api/domains.go
@@ -0,0 +1,176 @@
+package api
+
+import (
+ "context"
+ "crypto/sha256"
+ "encoding/base32"
+ "net"
+ "slices"
+ "strings"
+ "time"
+
+ "github.com/google/uuid"
+
+ "git.zb-server.de/ZB-Server/uptimesebi/internal/notify"
+ "git.zb-server.de/ZB-Server/uptimesebi/internal/store"
+ "git.zb-server.de/ZB-Server/uptimesebi/internal/tenant"
+)
+
+// A custom domain proves it belongs to its page in one of two ways:
+//
+// - a CNAME to ., where the label is unique to
+// the page. The platform's status page host has a wildcard record, so
+// the CNAME also routes the domain; one record does both. A CNAME to
+// the shared host alone would not do: it proves the domain points at
+// the platform, not which organization put it there.
+// - the TXT record _uptimesebi., for domains whose CNAME cannot be
+// seen: behind a proxy such as Cloudflare's, or a domain without a
+// subdomain using ALIAS or CNAME flattening.
+//
+// The domain watch looks for them on its own after a domain is set, and
+// checks verified domains daily. One whose record has been missing for
+// domainGrace is switched off, so a record left behind after a page is
+// gone or moved cannot be claimed by anybody else.
+
+const (
+ domainWatchEvery = time.Minute
+ domainGrace = 7 * 24 * time.Hour
+ keyDomainWatch = "domainwatch:lock"
+)
+
+// lookupCNAME is replaced in tests.
+var lookupCNAME = net.DefaultResolver.LookupCNAME
+
+var labelEncoding = base32.NewEncoding("abcdefghijklmnopqrstuvwxyz234567").WithPadding(base32.NoPadding)
+
+// cnameLabel is the page's label below the status page host, derived from
+// its domain token.
+func cnameLabel(token string) string {
+ sum := sha256.Sum256([]byte("cname\x00" + token))
+ return "p" + labelEncoding.EncodeToString(sum[:10])
+}
+
+// cnameFor is the CNAME target of the page with token, or empty when the
+// platform's status page host is not known.
+func (s *Server) cnameFor(token string) string {
+ host := s.cnameTarget()
+ if host == "" {
+ return ""
+ }
+ return cnameLabel(token) + "." + host
+}
+
+// checkDomain looks for the records proving domain belongs to the page
+// with token and returns "cname", "txt" or "" for neither.
+func (s *Server) checkDomain(ctx context.Context, domain, token string) string {
+ if target := s.cnameFor(token); target != "" {
+ if c, err := lookupCNAME(ctx, domain); err == nil && strings.EqualFold(strings.TrimSuffix(c, "."), target) {
+ return "cname"
+ }
+ }
+ if records, err := lookupTXT(ctx, verifyPrefix+domain); err == nil && slices.Contains(records, token) {
+ return "txt"
+ }
+ return ""
+}
+
+// RunDomainWatch checks custom domains until ctx ends. Replicas take
+// turns through a lock in Redis.
+func (s *Server) RunDomainWatch(ctx context.Context) {
+ tick := time.NewTicker(domainWatchEvery)
+ defer tick.Stop()
+ for {
+ if ok, err := s.rdb.SetNX(ctx, keyDomainWatch, 1, domainWatchEvery-5*time.Second).Result(); err == nil && ok {
+ if err := s.WatchDomains(ctx, time.Now()); err != nil && ctx.Err() == nil {
+ s.log.WarnContext(ctx, "checking custom domains failed", "error", err)
+ }
+ }
+ select {
+ case <-ctx.Done():
+ return
+ case <-tick.C:
+ }
+ }
+}
+
+// WatchDomains checks the domains that are due once.
+func (s *Server) WatchDomains(ctx context.Context, now time.Time) error {
+ return s.watchDomains(ctx, now, nil)
+}
+
+// watchDomains is WatchDomains limited to the page only, unless it is nil.
+func (s *Server) watchDomains(ctx context.Context, now time.Time, only *uuid.UUID) error {
+ var due []store.DomainsToCheckRow
+ if err := s.db.Tx(ctx, tenant.System(), func(q *store.Queries) error {
+ var err error
+ due, err = q.DomainsToCheck(ctx, store.DomainsToCheckParams{Now: now, PageID: only})
+ return err
+ }); err != nil {
+ return err
+ }
+ for _, d := range due {
+ if err := s.watchDomain(ctx, d, now); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func (s *Server) watchDomain(ctx context.Context, d store.DomainsToCheckRow, now time.Time) error {
+ method := s.checkDomain(ctx, d.Domain, d.DomainToken)
+ var (
+ failing *time.Time
+ off bool
+ )
+ err := s.db.Tx(ctx, tenant.System(), func(q *store.Queries) error {
+ if method != "" {
+ return q.MarkDomainVerified(ctx, store.MarkDomainVerifiedParams{ID: d.ID, Now: now, Method: method})
+ }
+ var err error
+ if failing, err = q.MarkDomainUnconfirmed(ctx, store.MarkDomainUnconfirmedParams{ID: d.ID, Now: now}); err != nil || failing == nil {
+ return err
+ }
+ if now.Sub(*failing) >= domainGrace {
+ off = true
+ return q.UnverifyDomain(ctx, d.ID)
+ }
+ return nil
+ })
+ if err != nil {
+ return err
+ }
+ switch {
+ case method != "" && d.DomainVerifiedAt == nil:
+ s.log.InfoContext(ctx, "custom domain verified", "page", d.ID, "domain", d.Domain, "method", method)
+ case off:
+ s.log.InfoContext(ctx, "custom domain switched off: its record is gone", "page", d.ID, "domain", d.Domain)
+ s.mailDomain(ctx, d, "email.domain_off", now)
+ case failing != nil && d.DomainFailingSince == nil:
+ s.log.InfoContext(ctx, "custom domain record missing", "page", d.ID, "domain", d.Domain)
+ s.mailDomain(ctx, d, "email.domain_missing", now.Add(domainGrace))
+ }
+ return nil
+}
+
+// mailDomain tells the organization's owners about d.
+func (s *Server) mailDomain(ctx context.Context, d store.DomainsToCheckRow, kind string, at time.Time) {
+ if s.smtp == nil {
+ return
+ }
+ var to []string
+ if err := s.db.Tx(ctx, tenant.System(), func(q *store.Queries) error {
+ var err error
+ to, err = q.OrgOwnerEmails(ctx, d.OrgID)
+ return err
+ }); err != nil || len(to) == 0 {
+ return
+ }
+ l := s.catalog.Match("")
+ data := map[string]any{
+ "Domain": d.Domain, "Page": d.Title, "Link": s.ticketLink("/statuspages/" + d.ID.String()),
+ "Date": at.UTC().Format("2006-01-02 15:04 MST"),
+ }
+ if err := s.smtp.Send(ctx, notify.Mail{To: to, Subject: l.T(kind+".subject", data), Body: l.T(kind+".body", data)}); err != nil {
+ s.log.WarnContext(ctx, "mail about a custom domain failed", "page", d.ID, "error", err)
+ }
+}
diff --git a/internal/api/domains_test.go b/internal/api/domains_test.go
new file mode 100644
index 0000000..76a6ac1
--- /dev/null
+++ b/internal/api/domains_test.go
@@ -0,0 +1,205 @@
+package api_test
+
+import (
+ "context"
+ "errors"
+ "net/http"
+ "strings"
+ "sync"
+ "testing"
+ "time"
+
+ "github.com/google/uuid"
+ "github.com/jackc/pgx/v5"
+
+ "git.zb-server.de/ZB-Server/uptimesebi/internal/api"
+ "git.zb-server.de/ZB-Server/uptimesebi/internal/config"
+ "git.zb-server.de/ZB-Server/uptimesebi/internal/notify/notifytest"
+)
+
+// fakeDNS answers CNAME lookups from a map, and TXT lookups with nothing.
+type fakeDNS struct {
+ mu sync.Mutex
+ cname map[string]string
+}
+
+func (d *fakeDNS) set(name, target string) {
+ d.mu.Lock()
+ defer d.mu.Unlock()
+ if target == "" {
+ delete(d.cname, name)
+ } else {
+ d.cname[name] = target
+ }
+}
+
+func useFakeDNS(t *testing.T) *fakeDNS {
+ d := &fakeDNS{cname: map[string]string{}}
+ savedC, savedT := *api.LookupCNAME, *api.LookupTXT
+ t.Cleanup(func() { *api.LookupCNAME, *api.LookupTXT = savedC, savedT })
+ *api.LookupCNAME = func(_ context.Context, name string) (string, error) {
+ d.mu.Lock()
+ defer d.mu.Unlock()
+ if c, ok := d.cname[name]; ok {
+ return c, nil
+ }
+ return "", errors.New("no such host")
+ }
+ *api.LookupTXT = func(context.Context, string) ([]string, error) { return nil, errors.New("no such record") }
+ return d
+}
+
+func TestCustomDomainByCNAME(t *testing.T) {
+ mail := notifytest.NewSMTP(t)
+ e := newEnvWith(t, func(c *config.API) {
+ c.SMTPURL, c.SignupVerify = mail.URL(), "off"
+ c.StatusPageURL = "https://status.platform.test"
+ })
+ ctx := context.Background()
+ dns := useFakeDNS(t)
+ platform := e.statuspageClient(t, nil)
+
+ newPage := func(b *browser) uuid.UUID {
+ slug := uniq("cn-")
+ _, p := b.do("POST", "/api/v1/org/statuspages", map[string]any{"slug": slug, "title": "Shop status"})
+ b.do("PUT", "/api/v1/org/statuspages/"+p["id"].(string), map[string]any{"slug": slug, "title": "Shop status", "published": true})
+ return uuid.MustParse(p["id"].(string))
+ }
+ setDomain := func(b *browser, id uuid.UUID, domain string) string {
+ t.Helper()
+ st, body := b.do("PUT", "/api/v1/org/statuspages/"+id.String()+"/domain", map[string]any{"domain": domain})
+ if st != http.StatusOK {
+ t.Fatalf("set domain = %d %v", st, body)
+ }
+ rec, _ := body["cname_record"].(map[string]any)
+ if rec == nil || rec["name"] != domain {
+ t.Fatalf("cname_record = %v", body["cname_record"])
+ }
+ return rec["value"].(string)
+ }
+ served := func(domain string) bool {
+ _, err := platform.Page(ctx, domain, "")
+ return err == nil
+ }
+
+ a := e.browser(t)
+ aEmail := "a@" + uniq("cn") + ".test"
+ a.signup(aEmail, uniq("cn-"))
+ pageA := newPage(a)
+ domain := uniq("status") + ".shop.test"
+ target := setDomain(a, pageA, domain)
+ if !strings.HasSuffix(target, ".status.platform.test") || len(target) < 30 {
+ t.Errorf("CNAME target %q is not unique to the page below the status host", target)
+ }
+ if _, _, html := a.page("/statuspages/" + pageA.String()); !strings.Contains(html, target+".") || !strings.Contains(html, "Check now") {
+ t.Error("the editor does not show the page's CNAME record")
+ }
+
+ // A CNAME to the shared host alone proves nothing.
+ now := time.Now()
+ dns.set(domain, "status.platform.test.")
+ if err := e.api.WatchDomainOf(ctx, now, pageA); err != nil {
+ t.Fatal(err)
+ }
+ if served(domain) {
+ t.Fatal("a CNAME to the shared host verified the domain")
+ }
+ // The page's own target verifies it, without anybody pressing a button.
+ dns.set(domain, strings.ToUpper(target)+".")
+ if err := e.api.WatchDomainOf(ctx, now.Add(time.Minute), pageA); err != nil {
+ t.Fatal(err)
+ }
+ if !served(domain) {
+ t.Fatal("the watch did not verify the domain by its CNAME")
+ }
+ if _, _, html := a.page("/statuspages/" + pageA.String()); !strings.Contains(html, "verified by its CNAME record") {
+ t.Error("the editor does not say how the domain was verified")
+ }
+
+ // Another organization taking the domain over, while the CNAME still
+ // points at the first page, gets nowhere.
+ a.do("PUT", "/api/v1/org/statuspages/"+pageA.String()+"/domain", map[string]any{"domain": ""})
+ b := e.browser(t)
+ b.signup("b@"+uniq("cn")+".test", uniq("cn-"))
+ pageB := newPage(b)
+ setDomain(b, pageB, domain)
+ if err := e.api.WatchDomainOf(ctx, now.Add(2*time.Minute), pageB); err != nil {
+ t.Fatal(err)
+ }
+ if st, _ := b.do("POST", "/api/v1/org/statuspages/"+pageB.String()+"/domain/verify", nil); st != http.StatusUnprocessableEntity || served(domain) {
+ t.Fatalf("a record left by another page verified the domain (verify = %d)", st)
+ }
+ b.do("PUT", "/api/v1/org/statuspages/"+pageB.String()+"/domain", map[string]any{"domain": ""})
+
+ // Once verified, the record is checked daily. Gone, the owners are told
+ // and, a week later, the domain is switched off.
+ setDomain(a, pageA, domain)
+ if st, body := a.do("POST", "/api/v1/org/statuspages/"+pageA.String()+"/domain/verify", nil); st != http.StatusNoContent {
+ t.Fatalf("verify = %d %v", st, body)
+ }
+ dns.set(domain, "")
+ day := now.Add(25 * time.Hour)
+ if err := e.api.WatchDomainOf(ctx, day, pageA); err != nil {
+ t.Fatal(err)
+ }
+ waitFor(t, 5*time.Second, "a mail that the record is gone", func() bool {
+ return mailedTo(mail, aEmail, "is gone", domain)
+ })
+ if !served(domain) {
+ t.Error("the domain was switched off at once")
+ }
+ if _, _, html := a.page("/statuspages/" + pageA.String()); !strings.Contains(html, "has not been found since") {
+ t.Error("the editor does not warn about the missing record")
+ }
+ if err := e.api.WatchDomainOf(ctx, day.Add(8*24*time.Hour), pageA); err != nil {
+ t.Fatal(err)
+ }
+ if served(domain) {
+ t.Error("the domain is still served a week after its record went")
+ }
+ waitFor(t, 5*time.Second, "a mail that the domain was switched off", func() bool {
+ return mailedTo(mail, aEmail, "switched off", domain)
+ })
+}
+
+func TestDomainsVerifiedBeforeAreNotCheckedAgain(t *testing.T) {
+ e := newEnvWith(t, func(c *config.API) { c.StatusPageURL = "https://status.platform.test" })
+ ctx := context.Background()
+ useFakeDNS(t)
+ owner := e.browser(t)
+ owner.signup("o@"+uniq("old")+".test", uniq("old-"))
+ slug := uniq("old-")
+ _, p := owner.do("POST", "/api/v1/org/statuspages", map[string]any{"slug": slug, "title": "Status"})
+ id := p["id"].(string)
+ owner.do("PUT", "/api/v1/org/statuspages/"+id, map[string]any{"slug": slug, "title": "Status", "published": true})
+ domain := uniq("old") + ".example.test"
+ owner.do("PUT", "/api/v1/org/statuspages/"+id+"/domain", map[string]any{"domain": domain})
+ if err := e.asSystem(t, func(tx pgx.Tx) error {
+ _, err := tx.Exec(ctx, `UPDATE status_pages SET domain_verified_at = now() - interval '1 year', domain_set_at = now() - interval '1 year' WHERE id = $1`, id)
+ return err
+ }); err != nil {
+ t.Fatal(err)
+ }
+ if err := e.api.WatchDomainOf(ctx, time.Now().Add(30*24*time.Hour), uuid.MustParse(id)); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := e.statuspageClient(t, nil).Page(ctx, domain, ""); err != nil {
+ t.Errorf("a domain verified before the checks was switched off: %v", err)
+ }
+}
+
+func mailedTo(mail *notifytest.SMTP, to string, want ...string) bool {
+ for _, m := range mail.Messages() {
+ if !strings.Contains(strings.Join(m.To, ","), to) {
+ continue
+ }
+ ok := true
+ for _, w := range want {
+ ok = ok && strings.Contains(m.Data, w)
+ }
+ if ok {
+ return true
+ }
+ }
+ return false
+}
diff --git a/internal/api/export_test.go b/internal/api/export_test.go
index 8bc00bb..cd69c31 100644
--- a/internal/api/export_test.go
+++ b/internal/api/export_test.go
@@ -30,3 +30,11 @@ func OpenAPI() map[string]any { return buildOpenAPI("https://uptime.example") }
func (s *Server) WatchRegionsOf(ctx context.Context, now time.Time, ids ...uuid.UUID) error {
return s.watchRegions(ctx, now, ids)
}
+
+// LookupCNAME lets tests replace DNS lookups for domain verification.
+var LookupCNAME = &lookupCNAME
+
+// WatchDomainOf runs the domain watch for one page only.
+func (s *Server) WatchDomainOf(ctx context.Context, now time.Time, page uuid.UUID) error {
+ return s.watchDomains(ctx, now, &page)
+}
diff --git a/internal/api/statuspages.go b/internal/api/statuspages.go
index 7c3e3ae..580f02a 100644
--- a/internal/api/statuspages.go
+++ b/internal/api/statuspages.go
@@ -480,6 +480,13 @@ type statusPageView struct {
DomainVerified bool `json:"domain_verified"`
// DomainRecord is the TXT record that proves control of CustomDomain.
DomainRecord *dnsRecord `json:"domain_record,omitempty"`
+ // CNAMERecord points CustomDomain at the platform's status page
+ // servers and proves control of it in one, where the platform knows
+ // their host.
+ CNAMERecord *dnsRecord `json:"cname_record,omitempty"`
+ // DomainMissingSince is set when the record of a verified domain has
+ // not been found since then; it is switched off a week later.
+ DomainMissingSince *time.Time `json:"domain_missing_since,omitempty"`
// Suspended is set when platform admins took the page offline; it is
// not served whatever Published says.
Suspended bool `json:"suspended,omitempty"`
@@ -492,7 +499,7 @@ type dnsRecord struct {
Value string `json:"value"`
}
-func viewStatusPage(p store.StatusPage) statusPageView {
+func (s *Server) viewStatusPage(p store.StatusPage) statusPageView {
v := statusPageView{
ID: p.ID, Slug: p.Slug, Title: p.Title, Description: p.Description,
Published: p.Published, ShowComponentDetails: p.ShowComponentDetails,
@@ -502,6 +509,10 @@ func viewStatusPage(p store.StatusPage) statusPageView {
_ = json.Unmarshal(p.Theme, &v.Theme)
if p.CustomDomain != nil {
v.DomainRecord = &dnsRecord{Name: verifyPrefix + *p.CustomDomain, Type: "TXT", Value: p.DomainToken}
+ if target := s.cnameFor(p.DomainToken); target != "" {
+ v.CNAMERecord = &dnsRecord{Name: *p.CustomDomain, Type: "CNAME", Value: target}
+ }
+ v.DomainMissingSince = p.DomainFailingSince
}
return v
}
@@ -540,7 +551,7 @@ func (s *Server) listStatusPages(c *gin.Context) {
out := []statusPageView{}
for _, r := range rows {
if p.Grants.Can(authz.StatusPagesRead, pageResource(r.ID)) {
- out = append(out, viewStatusPage(r))
+ out = append(out, s.viewStatusPage(r))
}
}
c.JSON(http.StatusOK, gin.H{"pages": out})
@@ -582,7 +593,7 @@ func (s *Server) createStatusPage(c *gin.Context) {
internalError(c, err)
return
}
- c.JSON(http.StatusCreated, viewStatusPage(row))
+ c.JSON(http.StatusCreated, s.viewStatusPage(row))
}
func newDomainToken() string {
@@ -621,7 +632,7 @@ func (s *Server) updateStatusPage(c *gin.Context) {
case err != nil:
internalError(c, err)
default:
- c.JSON(http.StatusOK, viewStatusPage(row))
+ c.JSON(http.StatusOK, s.viewStatusPage(row))
}
}
@@ -770,14 +781,14 @@ func (s *Server) setPageDomain(c *gin.Context) {
case err != nil:
internalError(c, err)
default:
- c.JSON(http.StatusOK, viewStatusPage(row))
+ c.JSON(http.StatusOK, s.viewStatusPage(row))
}
}
// lookupTXT is replaced in tests.
var lookupTXT = net.DefaultResolver.LookupTXT
-// verifyPageDomain checks the TXT record. Only verified domains are served,
+// verifyPageDomain looks for the CNAME or the TXT record now. Only verified domains are served,
// so nobody can claim a domain they do not control.
func (s *Server) verifyPageDomain(c *gin.Context) {
id := uuid.MustParse(c.Param("id"))
@@ -804,12 +815,14 @@ func (s *Server) verifyPageDomain(c *gin.Context) {
fail(c, http.StatusConflict, "no_domain")
return
}
- records, err := lookupTXT(ctx, verifyPrefix+*row.CustomDomain)
- if err != nil || !slices.Contains(records, row.DomainToken) {
+ method := s.checkDomain(ctx, *row.CustomDomain, row.DomainToken)
+ if method == "" {
fail(c, http.StatusUnprocessableEntity, "domain_not_verified")
return
}
- err = s.db.Tx(ctx, p.scope(), func(q *store.Queries) error { return q.MarkDomainVerified(ctx, id) })
+ err = s.db.Tx(ctx, p.scope(), func(q *store.Queries) error {
+ return q.MarkDomainVerified(ctx, store.MarkDomainVerifiedParams{ID: id, Now: time.Now(), Method: method})
+ })
if err != nil {
internalError(c, err)
return
diff --git a/internal/i18n/locales/de.json b/internal/i18n/locales/de.json
index f8ff9f5..5ba0d1c 100644
--- a/internal/i18n/locales/de.json
+++ b/internal/i18n/locales/de.json
@@ -514,6 +514,10 @@
"console.sso_required_action": "Mit SSO anmelden",
"console.suspended_reason": "Grund: {{.Reason}}",
"console.totp_missing_action": "Jetzt einrichten",
+ "email.domain_missing.body": "Die Statusseite {{.Page}} wird unter {{.Domain}} ausgeliefert, aber der DNS-Eintrag, der nachweist, dass die Domain zu ihr gehört, ist nicht mehr zu finden.\n\nIst er bis {{.Date}} nicht zurück, wird die Domain abgeschaltet und die Seite dort nicht mehr ausgeliefert. Den Eintrag, der wiederhergestellt werden muss, findest du hier:\n{{.Link}}",
+ "email.domain_missing.subject": "Der DNS-Eintrag von {{.Domain}} fehlt",
+ "email.domain_off.body": "Der DNS-Eintrag von {{.Domain}} fehlt seit einer Woche, deshalb wird die Statusseite {{.Page}} dort nicht mehr ausgeliefert.\n\nStelle den Eintrag wieder her und prüfe die Domain erneut:\n{{.Link}}",
+ "email.domain_off.subject": "{{.Domain}} wurde abgeschaltet",
"email.opened.body": "{{.Monitor}} ({{.Target}}) ist in allen Regionen nicht erreichbar seit {{.Since}}.\n\nLetzte Fehler:\n{{.Cause}}\n\nDu erhältst diese Nachricht, weil ein Benachrichtigungskanal deiner Organisation diese Adresse nutzt.",
"email.opened.subject": "[DOWN] {{.Monitor}}",
"email.region_back.body": "Region {{.Region}} hat wieder einen aktiven Checker; seit {{.Since}} hatte sie keinen. Überfällige Prüfungen laufen sofort.\n\n{{.Link}}",
@@ -544,7 +548,7 @@
"error.consent_outdated": "Die Dokumente haben sich inzwischen geändert. Lade die Seite neu und stimme der aktuellen Fassung zu.",
"error.consent_required": "Bitte stimme zuerst Datenschutz und AGB zu.",
"error.domain_changes_exceeded": "Die eigene Domain wurde heute schon {{.Count}}-mal geändert. Versuch es morgen wieder.",
- "error.domain_not_verified": "Der TXT-Eintrag wurde noch nicht gefunden. DNS-Änderungen brauchen manchmal etwas Zeit.",
+ "error.domain_not_verified": "Weder der CNAME- noch der TXT-Eintrag wurde bisher gefunden. DNS-Änderungen brauchen manchmal etwas, bis sie sichtbar sind.",
"error.domain_taken": "Diese Domain nutzt bereits eine andere Statuspage.",
"error.email_not_configured": "E-Mail ist auf diesem Server nicht verfügbar.",
"error.email_taken": "Diese E-Mail-Adresse ist bereits registriert.",
@@ -1250,16 +1254,22 @@
"pages.delete_confirm": "Diese Statuspage löschen?",
"pages.description": "Beschreibung",
"pages.domain": "Eigene Domain",
+ "pages.domain_alt": "Dann ist der CNAME von außen nicht zu sehen. Weise die Domain stattdessen mit diesem TXT-Eintrag nach und lass die Domain oder den Origin deines Proxys auf {{.Target}} zeigen; für eine Domain ohne Subdomain nutze einen ALIAS- oder ANAME-Eintrag oder CNAME-Flattening.",
+ "pages.domain_alt_summary": "Hinter einem Proxy wie Cloudflare oder eine Domain ohne Subdomain?",
"pages.domain_apex": "Eine Domain ohne Subdomain (example.com) kann keinen CNAME-Eintrag haben. Nutze stattdessen den ALIAS- oder ANAME-Eintrag deines DNS-Anbieters oder A/AAAA-Einträge.",
- "pages.domain_intro": "Liefere diese Seite unter einer eigenen Domain aus, z. B. status.example.com. Drei Schritte: Nachweisen, dass die Domain dir gehört, sie auf die Statusseiten-Server zeigen lassen, und HTTPS kommt von selbst.",
+ "pages.domain_cname_step": "Lege diesen CNAME-Eintrag an. Er lässt die Domain auf die Statusseiten-Server zeigen und weist zugleich nach, dass sie dir gehört, denn sein Ziel gehört nur zu dieser Seite. Wir sehen alle paar Minuten nach und prüfen die Domain von selbst; DNS-Änderungen brauchen manchmal etwas, bis sie sichtbar sind.",
+ "pages.domain_intro": "Liefere diese Seite unter einer eigenen Domain aus, z. B. status.example.com. Meist reicht ein einziger DNS-Eintrag; HTTPS kommt von selbst.",
+ "pages.domain_keep": "Lass den Eintrag bestehen: Er wird täglich geprüft, und eine Domain, deren Eintrag eine Woche lang fehlt, wird abgeschaltet, damit niemand anderes sie übernehmen kann.",
+ "pages.domain_missing": "Der Eintrag dieser Domain ist seit {{.Since}} nicht mehr zu finden. Kommt er nicht zurück, wird die Domain am {{.Date}} abgeschaltet.",
"pages.domain_name": "Domain",
- "pages.domain_step_cname": "2. Lass die Domain mit diesem CNAME-Eintrag auf die Statusseiten-Server zeigen:",
- "pages.domain_step_cname_own": "2. Lass die Domain auf die eigenen Statusseiten-Server deiner Organisation zeigen: per CNAME-Eintrag auf deren Hostnamen oder per A/AAAA-Eintrag auf deren Adressen.",
- "pages.domain_step_cname_unknown": "2. Lass die Domain per CNAME-Eintrag auf die Statusseiten-Server der Plattform zeigen; das Ziel nennt dir der Betreiber dieser Installation.",
- "pages.domain_step_tls": "3. HTTPS: Das Zertifikat wird beim ersten Aufruf über HTTPS automatisch geholt, das kann bis zu einer Minute dauern. Zum Schutz der Limits der Zertifizierungsstelle, die sich alle Organisationen teilen, sind neue Zertifikate pro Tag begrenzt, und die Domain lässt sich höchstens {{.Count}}-mal am Tag ändern.",
+ "pages.domain_step_cname_own": "Lass die Domain dann auf die eigenen Statusseiten-Server deiner Organisation zeigen: per CNAME-Eintrag auf deren Hostnamen oder per A/AAAA-Eintrag auf deren Adressen.",
+ "pages.domain_step_cname_unknown": "Lass die Domain dann per CNAME-Eintrag auf die Statusseiten-Server der Plattform zeigen; das Ziel nennt dir der Betreiber dieser Installation.",
+ "pages.domain_step_tls": "HTTPS: Das Zertifikat wird beim ersten Aufruf über HTTPS automatisch geholt, das kann bis zu einer Minute dauern. Zum Schutz der Limits der Zertifizierungsstelle, die sich alle Organisationen teilen, sind neue Zertifikate pro Tag begrenzt, und die Domain lässt sich höchstens {{.Count}}-mal am Tag ändern.",
"pages.domain_step_verified": "1. Domain geprüft.",
- "pages.domain_step_verify": "1. Weise mit diesem TXT-Eintrag nach, dass die Domain dir gehört, und prüfe ihn dann. Bis dahin wird die Domain weder ausgeliefert noch bekommt sie ein Zertifikat.",
+ "pages.domain_step_verify": "Weise mit diesem TXT-Eintrag nach, dass die Domain dir gehört, und prüfe ihn dann. Bis dahin wird die Domain weder ausgeliefert noch bekommt sie ein Zertifikat.",
"pages.domain_verified": "Domain geprüft.",
+ "pages.domain_verified_by_cname": "Domain über ihren CNAME-Eintrag geprüft.",
+ "pages.domain_verified_by_txt": "Domain über ihren TXT-Eintrag geprüft.",
"pages.draft": "Entwurf",
"pages.export": "Als HTML exportieren",
"pages.group": "Gruppe",
@@ -1289,6 +1299,7 @@
"pages.title": "Statuspages",
"pages.value": "Wert",
"pages.verify": "Prüfen",
+ "pages.verify_now": "Jetzt prüfen",
"perm.audit.read": "Audit-Log einsehen",
"perm.incidents.read": "Incidents sehen",
"perm.incidents.write": "Incidents verwalten",
diff --git a/internal/i18n/locales/en.json b/internal/i18n/locales/en.json
index 57eb73a..0b5b463 100644
--- a/internal/i18n/locales/en.json
+++ b/internal/i18n/locales/en.json
@@ -514,6 +514,10 @@
"console.sso_required_action": "Sign in with SSO",
"console.suspended_reason": "Reason: {{.Reason}}",
"console.totp_missing_action": "Set up now",
+ "email.domain_missing.body": "The status page {{.Page}} is served at {{.Domain}}, but the DNS record proving that the domain belongs to it can no longer be found.\n\nUnless it is back by {{.Date}}, the domain is switched off and the page is no longer served there. The record to restore is shown here:\n{{.Link}}",
+ "email.domain_missing.subject": "The DNS record of {{.Domain}} is gone",
+ "email.domain_off.body": "The DNS record of {{.Domain}} has been missing for a week, so the status page {{.Page}} is no longer served there.\n\nRestore the record and verify the domain again:\n{{.Link}}",
+ "email.domain_off.subject": "{{.Domain}} has been switched off",
"email.opened.body": "{{.Monitor}} ({{.Target}}) is down in all of its regions since {{.Since}}.\n\nLast errors:\n{{.Cause}}\n\nYou receive this because a notification channel of your organization is set up for this address.",
"email.opened.subject": "[DOWN] {{.Monitor}}",
"email.region_back.body": "Region {{.Region}} has an active checker again; it had none since {{.Since}}. Overdue checks run right away.\n\n{{.Link}}",
@@ -544,7 +548,7 @@
"error.consent_outdated": "The documents changed in the meantime. Reload the page and accept the current version.",
"error.consent_required": "Please accept the privacy policy and terms first.",
"error.domain_changes_exceeded": "The custom domain was changed {{.Count}} times today already. Try again tomorrow.",
- "error.domain_not_verified": "The TXT record was not found yet. DNS changes can take a while to appear.",
+ "error.domain_not_verified": "Neither the CNAME nor the TXT record was found yet. DNS changes can take a while to appear.",
"error.domain_taken": "This domain is already used by another status page.",
"error.email_not_configured": "Email is not available on this server.",
"error.email_taken": "This email address is already registered.",
@@ -1250,16 +1254,22 @@
"pages.delete_confirm": "Delete this status page?",
"pages.description": "Description",
"pages.domain": "Custom domain",
+ "pages.domain_alt": "Then the CNAME cannot be seen from outside. Prove the domain with this TXT record instead, and point the domain, or your proxy's origin, at {{.Target}}; for a domain without a subdomain use an ALIAS or ANAME record or CNAME flattening.",
+ "pages.domain_alt_summary": "Behind a proxy such as Cloudflare, or a domain without a subdomain?",
"pages.domain_apex": "A domain without a subdomain (example.com) cannot have a CNAME record. Use your DNS provider's ALIAS or ANAME record, or A/AAAA records, instead.",
- "pages.domain_intro": "Serve this page under a domain of your own, e.g. status.example.com. Three steps: prove the domain is yours, point it at the status page servers, and HTTPS follows by itself.",
+ "pages.domain_cname_step": "Create this CNAME record. It points the domain at the status page servers and proves that the domain is yours, because its target belongs to this page alone. We look for it every few minutes and verify the domain on our own; DNS changes can take a while to appear.",
+ "pages.domain_intro": "Serve this page under a domain of your own, e.g. status.example.com. One DNS record is usually all it takes; HTTPS follows by itself.",
+ "pages.domain_keep": "Keep the record in place: it is checked daily, and a domain whose record has been gone for a week is switched off, so nobody else can take it over.",
+ "pages.domain_missing": "The record of this domain has not been found since {{.Since}}. Unless it is back, the domain is switched off on {{.Date}}.",
"pages.domain_name": "Domain",
- "pages.domain_step_cname": "2. Point the domain at the status page servers with this CNAME record:",
- "pages.domain_step_cname_own": "2. Point the domain at your organization's own status page servers: a CNAME record to their host name, or A/AAAA records to their addresses.",
- "pages.domain_step_cname_unknown": "2. Point the domain at the platform's status page servers with a CNAME record; the operator of this installation tells you its target.",
- "pages.domain_step_tls": "3. HTTPS: the certificate is obtained automatically on the first visit over HTTPS, which can take up to a minute. To protect the certificate authority's limits that all organizations share, new certificates are limited per day, and the domain can be changed at most {{.Count}} times a day.",
+ "pages.domain_step_cname_own": "Then point the domain at your organization's own status page servers: a CNAME record to their host name, or A/AAAA records to their addresses.",
+ "pages.domain_step_cname_unknown": "Then point the domain at the platform's status page servers with a CNAME record; the operator of this installation tells you its target.",
+ "pages.domain_step_tls": "HTTPS: the certificate is obtained automatically on the first visit over HTTPS, which can take up to a minute. To protect the certificate authority's limits that all organizations share, new certificates are limited per day, and the domain can be changed at most {{.Count}} times a day.",
"pages.domain_step_verified": "1. Domain verified.",
- "pages.domain_step_verify": "1. Prove the domain is yours with this TXT record, then verify. Until then the domain is neither served nor given a certificate.",
+ "pages.domain_step_verify": "Prove the domain is yours with this TXT record, then verify. Until then the domain is neither served nor given a certificate.",
"pages.domain_verified": "Domain verified.",
+ "pages.domain_verified_by_cname": "Domain verified by its CNAME record.",
+ "pages.domain_verified_by_txt": "Domain verified by its TXT record.",
"pages.draft": "draft",
"pages.export": "Export as HTML",
"pages.group": "Group",
@@ -1289,6 +1299,7 @@
"pages.title": "Status pages",
"pages.value": "Value",
"pages.verify": "Verify",
+ "pages.verify_now": "Check now",
"perm.audit.read": "View the audit log",
"perm.incidents.read": "View incidents",
"perm.incidents.write": "Manage incidents",
diff --git a/internal/migrations/sql/00052_domain_checks.sql b/internal/migrations/sql/00052_domain_checks.sql
new file mode 100644
index 0000000..c6e2628
--- /dev/null
+++ b/internal/migrations/sql/00052_domain_checks.sql
@@ -0,0 +1,19 @@
+-- +goose Up
+-- Custom domains are verified by a CNAME to a target unique to the page, or
+-- by the TXT record, and checked again while they are in use: a domain that
+-- no longer points at the page is switched off after a grace period, so a
+-- record left behind cannot be taken over. Domains verified before this
+-- have no method and are not checked again.
+ALTER TABLE status_pages
+ ADD COLUMN domain_set_at timestamptz,
+ ADD COLUMN domain_checked_at timestamptz,
+ ADD COLUMN domain_failing_since timestamptz,
+ ADD COLUMN domain_verify_method text CHECK (domain_verify_method IN ('cname', 'txt'));
+UPDATE status_pages SET domain_set_at = updated_at WHERE custom_domain IS NOT NULL;
+
+-- +goose Down
+ALTER TABLE status_pages
+ DROP COLUMN domain_verify_method,
+ DROP COLUMN domain_failing_since,
+ DROP COLUMN domain_checked_at,
+ DROP COLUMN domain_set_at;
diff --git a/internal/store/models.go b/internal/store/models.go
index 0048349..92e4e1b 100644
--- a/internal/store/models.go
+++ b/internal/store/models.go
@@ -418,6 +418,10 @@ type StatusPage struct {
ShowComponentDetails bool
SuspendedAt *time.Time
SuspendedReason string
+ DomainSetAt *time.Time
+ DomainCheckedAt *time.Time
+ DomainFailingSince *time.Time
+ DomainVerifyMethod *string
}
type StatusPageGroup struct {
diff --git a/internal/store/querier.go b/internal/store/querier.go
index 14d6d65..08046f8 100644
--- a/internal/store/querier.go
+++ b/internal/store/querier.go
@@ -118,6 +118,11 @@ type Querier interface {
DeleteSuccessEvidence(ctx context.Context, arg DeleteSuccessEvidenceParams) error
DeleteUser(ctx context.Context, id uuid.UUID) (int64, error)
DisableTOTP(ctx context.Context, id uuid.UUID) error
+ // System scope: domains due for a look at their DNS records. A new one is
+ // looked at every minute for a quarter of an hour, then every ten minutes
+ // for two days, after which only the verify button tries again. A verified
+ // one is checked daily, hourly once its record went missing.
+ DomainsToCheck(ctx context.Context, arg DomainsToCheckParams) ([]DomainsToCheckRow, error)
EmailKeyTaken(ctx context.Context, emailKey *string) (bool, error)
EnableTOTP(ctx context.Context, arg EnableTOTPParams) error
EnqueueNotification(ctx context.Context, arg EnqueueNotificationParams) error
@@ -261,7 +266,11 @@ type Querier interface {
// their group or one of its ancestors.
MaintenanceForMonitors(ctx context.Context, ids []uuid.UUID) ([]MaintenanceForMonitorsRow, error)
MakeAdmin(ctx context.Context, id uuid.UUID) error
- MarkDomainVerified(ctx context.Context, id uuid.UUID) error
+ // The record of a domain was not found. Returns since when it has not
+ // been, for a verified domain.
+ MarkDomainUnconfirmed(ctx context.Context, arg MarkDomainUnconfirmedParams) (*time.Time, error)
+ // The domain's record was found: verified, or still in place.
+ MarkDomainVerified(ctx context.Context, arg MarkDomainVerifiedParams) error
MarkEmailVerified(ctx context.Context, id uuid.UUID) (User, error)
MarkInvitationAccepted(ctx context.Context, id uuid.UUID) (int64, error)
MarkNotificationFailed(ctx context.Context, arg MarkNotificationFailedParams) error
@@ -353,7 +362,7 @@ type Querier interface {
SetOwner(ctx context.Context, arg SetOwnerParams) (int64, error)
SetPasswordHash(ctx context.Context, arg SetPasswordHashParams) error
SetPlatformSetting(ctx context.Context, arg SetPlatformSettingParams) error
- // Changing the domain drops a previous verification.
+ // Changing the domain drops a previous verification and its checks.
SetStatusPageDomain(ctx context.Context, arg SetStatusPageDomainParams) (StatusPage, error)
SetStatusPageMonitorGroup(ctx context.Context, arg SetStatusPageMonitorGroupParams) error
SetSupportTicketStatus(ctx context.Context, arg SetSupportTicketStatusParams) (int64, error)
@@ -391,6 +400,8 @@ type Querier interface {
TouchAgentInstance(ctx context.Context, arg TouchAgentInstanceParams) error
TouchIdentity(ctx context.Context, arg TouchIdentityParams) error
TouchPlatformIdentity(ctx context.Context, arg TouchPlatformIdentityParams) error
+ // A verified domain whose record stayed missing past the grace period.
+ UnverifyDomain(ctx context.Context, id uuid.UUID) error
UpdateAlertGroup(ctx context.Context, arg UpdateAlertGroupParams) (AlertGroup, error)
UpdateChannel(ctx context.Context, arg UpdateChannelParams) (NotificationChannel, error)
UpdateGroup(ctx context.Context, arg UpdateGroupParams) (MonitorGroup, error)
diff --git a/internal/store/queries/status_pages.sql b/internal/store/queries/status_pages.sql
index 6ad3b7f..96d7f25 100644
--- a/internal/store/queries/status_pages.sql
+++ b/internal/store/queries/status_pages.sql
@@ -16,16 +16,63 @@ WHERE id = $1
RETURNING *;
-- name: SetStatusPageDomain :one
--- Changing the domain drops a previous verification.
+-- Changing the domain drops a previous verification and its checks.
UPDATE status_pages SET
- custom_domain = sqlc.narg(custom_domain),
domain_verified_at = CASE WHEN custom_domain IS NOT DISTINCT FROM sqlc.narg(custom_domain) THEN domain_verified_at END,
+ domain_verify_method = CASE WHEN custom_domain IS NOT DISTINCT FROM sqlc.narg(custom_domain) THEN domain_verify_method END,
+ domain_failing_since = CASE WHEN custom_domain IS NOT DISTINCT FROM sqlc.narg(custom_domain) THEN domain_failing_since END,
+ domain_checked_at = CASE WHEN custom_domain IS NOT DISTINCT FROM sqlc.narg(custom_domain) THEN domain_checked_at END,
+ domain_set_at = CASE WHEN custom_domain IS NOT DISTINCT FROM sqlc.narg(custom_domain) THEN domain_set_at ELSE now() END,
+ custom_domain = sqlc.narg(custom_domain),
updated_at = now()
WHERE id = sqlc.arg(id)
RETURNING *;
-- name: MarkDomainVerified :exec
-UPDATE status_pages SET domain_verified_at = now() WHERE id = $1;
+-- The domain's record was found: verified, or still in place.
+UPDATE status_pages SET
+ domain_verified_at = coalesce(domain_verified_at, sqlc.arg(now)::timestamptz),
+ domain_verify_method = sqlc.arg(method)::text,
+ domain_checked_at = sqlc.arg(now)::timestamptz,
+ domain_failing_since = NULL
+WHERE id = sqlc.arg(id);
+
+-- name: MarkDomainUnconfirmed :one
+-- The record of a domain was not found. Returns since when it has not
+-- been, for a verified domain.
+UPDATE status_pages SET
+ domain_checked_at = sqlc.arg(now)::timestamptz,
+ domain_failing_since = CASE WHEN domain_verified_at IS NULL THEN NULL
+ ELSE coalesce(domain_failing_since, sqlc.arg(now)::timestamptz) END
+WHERE id = sqlc.arg(id)
+RETURNING domain_failing_since;
+
+-- name: UnverifyDomain :exec
+-- A verified domain whose record stayed missing past the grace period.
+UPDATE status_pages SET
+ domain_verified_at = NULL, domain_verify_method = NULL, domain_failing_since = NULL
+WHERE id = $1;
+
+-- name: DomainsToCheck :many
+-- System scope: domains due for a look at their DNS records. A new one is
+-- looked at every minute for a quarter of an hour, then every ten minutes
+-- for two days, after which only the verify button tries again. A verified
+-- one is checked daily, hourly once its record went missing.
+SELECT id, org_id, title, custom_domain::text AS domain, domain_token,
+ domain_verified_at, domain_failing_since
+FROM status_pages
+WHERE custom_domain IS NOT NULL
+ AND (sqlc.narg(page_id)::uuid IS NULL OR id = sqlc.narg(page_id))
+ AND (
+ (domain_verified_at IS NULL AND domain_set_at > sqlc.arg(now)::timestamptz - interval '48 hours'
+ AND (domain_checked_at IS NULL OR domain_checked_at <= sqlc.arg(now)::timestamptz - CASE
+ WHEN domain_set_at > sqlc.arg(now)::timestamptz - interval '15 minutes' THEN interval '50 seconds'
+ ELSE interval '10 minutes' END))
+ OR (domain_verified_at IS NOT NULL AND domain_verify_method IS NOT NULL
+ AND (domain_checked_at IS NULL OR domain_checked_at <= sqlc.arg(now)::timestamptz - CASE
+ WHEN domain_failing_since IS NULL THEN interval '24 hours' ELSE interval '1 hour' END)))
+ORDER BY domain_checked_at NULLS FIRST
+LIMIT 500;
-- name: GetStatusPage :one
SELECT * FROM status_pages WHERE id = $1;
diff --git a/internal/store/status_pages.sql.go b/internal/store/status_pages.sql.go
index ae58f77..97f1078 100644
--- a/internal/store/status_pages.sql.go
+++ b/internal/store/status_pages.sql.go
@@ -7,6 +7,7 @@ package store
import (
"context"
+ "time"
"github.com/google/uuid"
)
@@ -60,7 +61,7 @@ func (q *Queries) ClearStatusPageMonitors(ctx context.Context, pageID uuid.UUID)
const createStatusPage = `-- name: CreateStatusPage :one
INSERT INTO status_pages (org_id, slug, title, description, published, show_component_details, domain_token, theme)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
-RETURNING id, org_id, slug, title, description, published, custom_domain, domain_token, domain_verified_at, theme, created_at, updated_at, show_component_details, suspended_at, suspended_reason
+RETURNING id, org_id, slug, title, description, published, custom_domain, domain_token, domain_verified_at, theme, created_at, updated_at, show_component_details, suspended_at, suspended_reason, domain_set_at, domain_checked_at, domain_failing_since, domain_verify_method
`
type CreateStatusPageParams struct {
@@ -102,6 +103,10 @@ func (q *Queries) CreateStatusPage(ctx context.Context, arg CreateStatusPagePara
&i.ShowComponentDetails,
&i.SuspendedAt,
&i.SuspendedReason,
+ &i.DomainSetAt,
+ &i.DomainCheckedAt,
+ &i.DomainFailingSince,
+ &i.DomainVerifyMethod,
)
return i, err
}
@@ -171,8 +176,73 @@ func (q *Queries) DeleteStatusPageGroup(ctx context.Context, arg DeleteStatusPag
return result.RowsAffected(), nil
}
+const domainsToCheck = `-- name: DomainsToCheck :many
+SELECT id, org_id, title, custom_domain::text AS domain, domain_token,
+ domain_verified_at, domain_failing_since
+FROM status_pages
+WHERE custom_domain IS NOT NULL
+ AND ($1::uuid IS NULL OR id = $1)
+ AND (
+ (domain_verified_at IS NULL AND domain_set_at > $2::timestamptz - interval '48 hours'
+ AND (domain_checked_at IS NULL OR domain_checked_at <= $2::timestamptz - CASE
+ WHEN domain_set_at > $2::timestamptz - interval '15 minutes' THEN interval '50 seconds'
+ ELSE interval '10 minutes' END))
+ OR (domain_verified_at IS NOT NULL AND domain_verify_method IS NOT NULL
+ AND (domain_checked_at IS NULL OR domain_checked_at <= $2::timestamptz - CASE
+ WHEN domain_failing_since IS NULL THEN interval '24 hours' ELSE interval '1 hour' END)))
+ORDER BY domain_checked_at NULLS FIRST
+LIMIT 500
+`
+
+type DomainsToCheckParams struct {
+ PageID *uuid.UUID
+ Now time.Time
+}
+
+type DomainsToCheckRow struct {
+ ID uuid.UUID
+ OrgID uuid.UUID
+ Title string
+ Domain string
+ DomainToken string
+ DomainVerifiedAt *time.Time
+ DomainFailingSince *time.Time
+}
+
+// System scope: domains due for a look at their DNS records. A new one is
+// looked at every minute for a quarter of an hour, then every ten minutes
+// for two days, after which only the verify button tries again. A verified
+// one is checked daily, hourly once its record went missing.
+func (q *Queries) DomainsToCheck(ctx context.Context, arg DomainsToCheckParams) ([]DomainsToCheckRow, error) {
+ rows, err := q.db.Query(ctx, domainsToCheck, arg.PageID, arg.Now)
+ if err != nil {
+ return nil, err
+ }
+ defer rows.Close()
+ items := []DomainsToCheckRow{}
+ for rows.Next() {
+ var i DomainsToCheckRow
+ if err := rows.Scan(
+ &i.ID,
+ &i.OrgID,
+ &i.Title,
+ &i.Domain,
+ &i.DomainToken,
+ &i.DomainVerifiedAt,
+ &i.DomainFailingSince,
+ ); err != nil {
+ return nil, err
+ }
+ items = append(items, i)
+ }
+ if err := rows.Err(); err != nil {
+ return nil, err
+ }
+ return items, nil
+}
+
const findPublishedPage = `-- name: FindPublishedPage :one
-SELECT id, org_id, slug, title, description, published, custom_domain, domain_token, domain_verified_at, theme, created_at, updated_at, show_component_details, suspended_at, suspended_reason FROM status_pages
+SELECT id, org_id, slug, title, description, published, custom_domain, domain_token, domain_verified_at, theme, created_at, updated_at, show_component_details, suspended_at, suspended_reason, domain_set_at, domain_checked_at, domain_failing_since, domain_verify_method FROM status_pages
WHERE published AND suspended_at IS NULL
AND NOT EXISTS (SELECT 1 FROM orgs o WHERE o.id = status_pages.org_id AND o.suspended_at IS NOT NULL)
AND (($1::citext IS NOT NULL AND custom_domain = $1 AND domain_verified_at IS NOT NULL)
@@ -205,12 +275,16 @@ func (q *Queries) FindPublishedPage(ctx context.Context, arg FindPublishedPagePa
&i.ShowComponentDetails,
&i.SuspendedAt,
&i.SuspendedReason,
+ &i.DomainSetAt,
+ &i.DomainCheckedAt,
+ &i.DomainFailingSince,
+ &i.DomainVerifyMethod,
)
return i, err
}
const getStatusPage = `-- name: GetStatusPage :one
-SELECT id, org_id, slug, title, description, published, custom_domain, domain_token, domain_verified_at, theme, created_at, updated_at, show_component_details, suspended_at, suspended_reason FROM status_pages WHERE id = $1
+SELECT id, org_id, slug, title, description, published, custom_domain, domain_token, domain_verified_at, theme, created_at, updated_at, show_component_details, suspended_at, suspended_reason, domain_set_at, domain_checked_at, domain_failing_since, domain_verify_method FROM status_pages WHERE id = $1
`
func (q *Queries) GetStatusPage(ctx context.Context, id uuid.UUID) (StatusPage, error) {
@@ -232,6 +306,10 @@ func (q *Queries) GetStatusPage(ctx context.Context, id uuid.UUID) (StatusPage,
&i.ShowComponentDetails,
&i.SuspendedAt,
&i.SuspendedReason,
+ &i.DomainSetAt,
+ &i.DomainCheckedAt,
+ &i.DomainFailingSince,
+ &i.DomainVerifyMethod,
)
return i, err
}
@@ -272,7 +350,7 @@ func (q *Queries) ListStatusPageGroups(ctx context.Context, pageID uuid.UUID) ([
}
const listStatusPages = `-- name: ListStatusPages :many
-SELECT id, org_id, slug, title, description, published, custom_domain, domain_token, domain_verified_at, theme, created_at, updated_at, show_component_details, suspended_at, suspended_reason FROM status_pages ORDER BY title
+SELECT id, org_id, slug, title, description, published, custom_domain, domain_token, domain_verified_at, theme, created_at, updated_at, show_component_details, suspended_at, suspended_reason, domain_set_at, domain_checked_at, domain_failing_since, domain_verify_method FROM status_pages ORDER BY title
`
func (q *Queries) ListStatusPages(ctx context.Context) ([]StatusPage, error) {
@@ -300,6 +378,10 @@ func (q *Queries) ListStatusPages(ctx context.Context) ([]StatusPage, error) {
&i.ShowComponentDetails,
&i.SuspendedAt,
&i.SuspendedReason,
+ &i.DomainSetAt,
+ &i.DomainCheckedAt,
+ &i.DomainFailingSince,
+ &i.DomainVerifyMethod,
); err != nil {
return nil, err
}
@@ -311,12 +393,47 @@ func (q *Queries) ListStatusPages(ctx context.Context) ([]StatusPage, error) {
return items, nil
}
-const markDomainVerified = `-- name: MarkDomainVerified :exec
-UPDATE status_pages SET domain_verified_at = now() WHERE id = $1
+const markDomainUnconfirmed = `-- name: MarkDomainUnconfirmed :one
+UPDATE status_pages SET
+ domain_checked_at = $1::timestamptz,
+ domain_failing_since = CASE WHEN domain_verified_at IS NULL THEN NULL
+ ELSE coalesce(domain_failing_since, $1::timestamptz) END
+WHERE id = $2
+RETURNING domain_failing_since
`
-func (q *Queries) MarkDomainVerified(ctx context.Context, id uuid.UUID) error {
- _, err := q.db.Exec(ctx, markDomainVerified, id)
+type MarkDomainUnconfirmedParams struct {
+ Now time.Time
+ ID uuid.UUID
+}
+
+// The record of a domain was not found. Returns since when it has not
+// been, for a verified domain.
+func (q *Queries) MarkDomainUnconfirmed(ctx context.Context, arg MarkDomainUnconfirmedParams) (*time.Time, error) {
+ row := q.db.QueryRow(ctx, markDomainUnconfirmed, arg.Now, arg.ID)
+ var domain_failing_since *time.Time
+ err := row.Scan(&domain_failing_since)
+ return domain_failing_since, err
+}
+
+const markDomainVerified = `-- name: MarkDomainVerified :exec
+UPDATE status_pages SET
+ domain_verified_at = coalesce(domain_verified_at, $1::timestamptz),
+ domain_verify_method = $2::text,
+ domain_checked_at = $1::timestamptz,
+ domain_failing_since = NULL
+WHERE id = $3
+`
+
+type MarkDomainVerifiedParams struct {
+ Now time.Time
+ Method string
+ ID uuid.UUID
+}
+
+// The domain's record was found: verified, or still in place.
+func (q *Queries) MarkDomainVerified(ctx context.Context, arg MarkDomainVerifiedParams) error {
+ _, err := q.db.Exec(ctx, markDomainVerified, arg.Now, arg.Method, arg.ID)
return err
}
@@ -394,11 +511,15 @@ func (q *Queries) ServablePages(ctx context.Context, agentOrg *uuid.UUID) ([]Ser
const setStatusPageDomain = `-- name: SetStatusPageDomain :one
UPDATE status_pages SET
- custom_domain = $1,
domain_verified_at = CASE WHEN custom_domain IS NOT DISTINCT FROM $1 THEN domain_verified_at END,
+ domain_verify_method = CASE WHEN custom_domain IS NOT DISTINCT FROM $1 THEN domain_verify_method END,
+ domain_failing_since = CASE WHEN custom_domain IS NOT DISTINCT FROM $1 THEN domain_failing_since END,
+ domain_checked_at = CASE WHEN custom_domain IS NOT DISTINCT FROM $1 THEN domain_checked_at END,
+ domain_set_at = CASE WHEN custom_domain IS NOT DISTINCT FROM $1 THEN domain_set_at ELSE now() END,
+ custom_domain = $1,
updated_at = now()
WHERE id = $2
-RETURNING id, org_id, slug, title, description, published, custom_domain, domain_token, domain_verified_at, theme, created_at, updated_at, show_component_details, suspended_at, suspended_reason
+RETURNING id, org_id, slug, title, description, published, custom_domain, domain_token, domain_verified_at, theme, created_at, updated_at, show_component_details, suspended_at, suspended_reason, domain_set_at, domain_checked_at, domain_failing_since, domain_verify_method
`
type SetStatusPageDomainParams struct {
@@ -406,7 +527,7 @@ type SetStatusPageDomainParams struct {
ID uuid.UUID
}
-// Changing the domain drops a previous verification.
+// Changing the domain drops a previous verification and its checks.
func (q *Queries) SetStatusPageDomain(ctx context.Context, arg SetStatusPageDomainParams) (StatusPage, error) {
row := q.db.QueryRow(ctx, setStatusPageDomain, arg.CustomDomain, arg.ID)
var i StatusPage
@@ -426,6 +547,10 @@ func (q *Queries) SetStatusPageDomain(ctx context.Context, arg SetStatusPageDoma
&i.ShowComponentDetails,
&i.SuspendedAt,
&i.SuspendedReason,
+ &i.DomainSetAt,
+ &i.DomainCheckedAt,
+ &i.DomainFailingSince,
+ &i.DomainVerifyMethod,
)
return i, err
}
@@ -506,6 +631,18 @@ func (q *Queries) StatusPageMonitors(ctx context.Context, pageID uuid.UUID) ([]S
return items, nil
}
+const unverifyDomain = `-- name: UnverifyDomain :exec
+UPDATE status_pages SET
+ domain_verified_at = NULL, domain_verify_method = NULL, domain_failing_since = NULL
+WHERE id = $1
+`
+
+// A verified domain whose record stayed missing past the grace period.
+func (q *Queries) UnverifyDomain(ctx context.Context, id uuid.UUID) error {
+ _, err := q.db.Exec(ctx, unverifyDomain, id)
+ return err
+}
+
const updateStatusPage = `-- name: UpdateStatusPage :one
UPDATE status_pages
SET slug = $2,
@@ -516,7 +653,7 @@ SET slug = $2,
theme = $7,
updated_at = now()
WHERE id = $1
-RETURNING id, org_id, slug, title, description, published, custom_domain, domain_token, domain_verified_at, theme, created_at, updated_at, show_component_details, suspended_at, suspended_reason
+RETURNING id, org_id, slug, title, description, published, custom_domain, domain_token, domain_verified_at, theme, created_at, updated_at, show_component_details, suspended_at, suspended_reason, domain_set_at, domain_checked_at, domain_failing_since, domain_verify_method
`
type UpdateStatusPageParams struct {
@@ -556,6 +693,10 @@ func (q *Queries) UpdateStatusPage(ctx context.Context, arg UpdateStatusPagePara
&i.ShowComponentDetails,
&i.SuspendedAt,
&i.SuspendedReason,
+ &i.DomainSetAt,
+ &i.DomainCheckedAt,
+ &i.DomainFailingSince,
+ &i.DomainVerifyMethod,
)
return i, err
}
diff --git a/internal/web/statuspages.templ b/internal/web/statuspages.templ
index 1233506..d2d787a 100644
--- a/internal/web/statuspages.templ
+++ b/internal/web/statuspages.templ
@@ -106,9 +106,16 @@ type PageEditor struct {
URL string
Domain string
DomainVerified bool
- // CNAMETarget is the host of the platform's status page servers that
- // custom domains point at; empty when unknown.
- CNAMETarget string
+ // CNAMEValue is the target unique to the page that its domain points
+ // at; empty when the platform's status page host is not known.
+ CNAMEValue string
+ // VerifiedBy is "cname" or "txt", empty for domains verified before
+ // either was recorded.
+ VerifiedBy string
+ // MissingSince and SwitchOffAt are set while the record of a verified
+ // domain cannot be found.
+ MissingSince string
+ SwitchOffAt string
// DomainChangesPerDay is how often the domain may be changed a day.
DomainChangesPerDay int
RecordName string
@@ -302,45 +309,63 @@ templ StatusPageEditor(p Page, me Me, e PageEditor) {
@submit(i18n.T(ctx, "common.save"))
if e.Domain != "" {
-
-
- if e.DomainVerified {
- ● { i18n.T(ctx, "pages.domain_step_verified") }
+
+ if e.DomainVerified {
+
+ ●
+ switch e.VerifiedBy {
+ case "cname":
+ { i18n.T(ctx, "pages.domain_verified_by_cname") }
+ case "txt":
+ { i18n.T(ctx, "pages.domain_verified_by_txt") }
+ default:
+ { i18n.T(ctx, "pages.domain_step_verified") }
+ }
+
+ if e.MissingSince != "" {
+
{ i18n.T(ctx, "pages.domain_missing", "Since", e.MissingSince, "Date", e.SwitchOffAt) }
+ } else if e.VerifiedBy != "" {
+
{ i18n.T(ctx, "pages.domain_keep") }
+ }
+ } else if e.CNAMEValue != "" && !e.OwnServers {
+
{ i18n.T(ctx, "pages.domain_cname_step") }
+ @dnsRecordList("CNAME", e.Domain, e.CNAMEValue+".")
+ @verifyButton(e.ID, "pages.verify_now")
+
+ { i18n.T(ctx, "pages.domain_alt_summary") }
+ { i18n.T(ctx, "pages.domain_alt", "Target", e.CNAMEValue) }
+ @dnsRecordList("TXT", e.RecordName, e.RecordValue)
+ @verifyButton(e.ID, "pages.verify")
+
+ } else {
+
{ i18n.T(ctx, "pages.domain_step_verify") }
+ @dnsRecordList("TXT", e.RecordName, e.RecordValue)
+ @verifyButton(e.ID, "pages.verify")
+ if e.OwnServers {
+
{ i18n.T(ctx, "pages.domain_step_cname_own") }
} else {
-
{ i18n.T(ctx, "pages.domain_step_verify") }
-
- TXT
- { e.RecordName }
- { i18n.T(ctx, "pages.value") }
- { e.RecordValue }
-
-
{ i18n.T(ctx, "pages.verify") }
+
{ i18n.T(ctx, "pages.domain_step_cname_unknown") }
}
-
-
- switch {
- case e.OwnServers:
- { i18n.T(ctx, "pages.domain_step_cname_own") }
- case e.CNAMETarget != "":
- { i18n.T(ctx, "pages.domain_step_cname") }
-
- CNAME
- { e.Domain }
- { i18n.T(ctx, "pages.value") }
- { e.CNAMETarget + "." }
-
- default:
- { i18n.T(ctx, "pages.domain_step_cname_unknown") }
- }
- { i18n.T(ctx, "pages.domain_apex") }
-
-
- { i18n.T(ctx, "pages.domain_step_tls", "Count", e.DomainChangesPerDay) }
-
-
+
{ i18n.T(ctx, "pages.domain_apex") }
+ }
+
{ i18n.T(ctx, "pages.domain_step_tls", "Count", e.DomainChangesPerDay) }
+
}
}
}
+
+templ dnsRecordList(kind, name, value string) {
+
+ { kind }
+ { name }
+ { i18n.T(ctx, "pages.value") }
+ { value }
+
+}
+
+templ verifyButton(pageID, label string) {
+ { i18n.T(ctx, label) }
+}
diff --git a/internal/web/statuspages_templ.go b/internal/web/statuspages_templ.go
index 80e925a..c576aab 100644
--- a/internal/web/statuspages_templ.go
+++ b/internal/web/statuspages_templ.go
@@ -334,9 +334,16 @@ type PageEditor struct {
URL string
Domain string
DomainVerified bool
- // CNAMETarget is the host of the platform's status page servers that
- // custom domains point at; empty when unknown.
- CNAMETarget string
+ // CNAMEValue is the target unique to the page that its domain points
+ // at; empty when the platform's status page host is not known.
+ CNAMEValue string
+ // VerifiedBy is "cname" or "txt", empty for domains verified before
+ // either was recorded.
+ VerifiedBy string
+ // MissingSince and SwitchOffAt are set while the record of a verified
+ // domain cannot be found.
+ MissingSince string
+ SwitchOffAt string
// DomainChangesPerDay is how often the domain may be changed a day.
DomainChangesPerDay int
RecordName string
@@ -384,7 +391,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.title"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 125, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 132, Col: 115}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
@@ -402,7 +409,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.suspended_notice"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 128, Col: 43}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 135, Col: 43}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
@@ -416,7 +423,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(" " + i18n.T(ctx, "console.suspended_reason", "Reason", e.SuspendedReason))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 130, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 137, Col: 81}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
@@ -435,7 +442,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(e.Title)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 135, Col: 46}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 142, Col: 46}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
@@ -453,7 +460,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(e.URL)).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 138, Col: 35}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 145, Col: 35}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18)
if templ_7745c5c3_Err != nil {
@@ -466,7 +473,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.open"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 138, Col: 130}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 145, Col: 130}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
if templ_7745c5c3_Err != nil {
@@ -484,7 +491,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL("/api/v1/org/statuspages/" + e.ID + "/export")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 140, Col: 74}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 147, Col: 74}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var20)
if templ_7745c5c3_Err != nil {
@@ -497,7 +504,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var21 string
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.export"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 140, Col: 140}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 147, Col: 140}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
if templ_7745c5c3_Err != nil {
@@ -515,7 +522,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var22 string
templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.own_servers"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 144, Col: 88}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 151, Col: 88}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
if templ_7745c5c3_Err != nil {
@@ -541,7 +548,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/statuspages/" + e.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 149, Col: 47}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 156, Col: 47}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var23)
if templ_7745c5c3_Err != nil {
@@ -554,7 +561,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var24 string
templ_7745c5c3_Var24, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/statuspages/" + e.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 149, Col: 102}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 156, Col: 102}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24)
if templ_7745c5c3_Err != nil {
@@ -583,7 +590,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.description"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 154, Col: 121}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 161, Col: 121}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
if templ_7745c5c3_Err != nil {
@@ -616,7 +623,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.show_details_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 159, Col: 86}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 166, Col: 86}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
if templ_7745c5c3_Err != nil {
@@ -629,7 +636,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.theme"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 160, Col: 111}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 167, Col: 111}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil {
@@ -654,7 +661,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var28 string
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.css"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 164, Col: 113}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 171, Col: 113}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
if templ_7745c5c3_Err != nil {
@@ -667,7 +674,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var29 string
templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(e.CSS)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 165, Col: 160}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 172, Col: 160}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
if templ_7745c5c3_Err != nil {
@@ -688,7 +695,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/statuspages/" + e.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 171, Col: 45}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 178, Col: 45}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var30)
if templ_7745c5c3_Err != nil {
@@ -701,7 +708,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "pages.delete_confirm")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 172, Col: 55}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 179, Col: 55}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var31)
if templ_7745c5c3_Err != nil {
@@ -714,7 +721,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.delete"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 175, Col: 34}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 182, Col: 34}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
if templ_7745c5c3_Err != nil {
@@ -736,7 +743,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var33 string
templ_7745c5c3_Var33, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/statuspages/" + e.ID + "/groups/import").Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 184, Col: 65}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 191, Col: 65}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var33)
if templ_7745c5c3_Err != nil {
@@ -749,7 +756,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var34 string
templ_7745c5c3_Var34, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "pages.groups_import_confirm")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 185, Col: 65}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 192, Col: 65}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var34)
if templ_7745c5c3_Err != nil {
@@ -762,7 +769,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var35 string
templ_7745c5c3_Var35, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "pages.groups_imported")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 186, Col: 54}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 193, Col: 54}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var35)
if templ_7745c5c3_Err != nil {
@@ -775,7 +782,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var36 string
templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.groups_import"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 189, Col: 44}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 196, Col: 44}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36))
if templ_7745c5c3_Err != nil {
@@ -793,7 +800,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var37 string
templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.groups_intro"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 192, Col: 75}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 199, Col: 75}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
if templ_7745c5c3_Err != nil {
@@ -816,7 +823,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var38 string
templ_7745c5c3_Var38, templ_7745c5c3_Err = templruntime.SanitizeStyleAttributeValues(indent(g.Depth))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 196, Col: 48}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 203, Col: 48}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var38))
if templ_7745c5c3_Err != nil {
@@ -829,7 +836,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var39 string
templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(g.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 199, Col: 25}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 206, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39))
if templ_7745c5c3_Err != nil {
@@ -842,7 +849,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var40 string
templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "common.edit"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 200, Col: 72}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 207, Col: 72}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40))
if templ_7745c5c3_Err != nil {
@@ -855,7 +862,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var41 string
templ_7745c5c3_Var41, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/statuspages/" + e.ID + "/groups/" + g.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 202, Col: 73}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 209, Col: 73}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var41)
if templ_7745c5c3_Err != nil {
@@ -868,7 +875,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var42 string
templ_7745c5c3_Var42, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/statuspages/" + e.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 202, Col: 128}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 209, Col: 128}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var42)
if templ_7745c5c3_Err != nil {
@@ -893,7 +900,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var43 string
templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.parent"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 206, Col: 123}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 213, Col: 123}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43))
if templ_7745c5c3_Err != nil {
@@ -946,7 +953,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var46 string
templ_7745c5c3_Var46, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.none"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 208, Col: 58}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 215, Col: 58}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var46))
if templ_7745c5c3_Err != nil {
@@ -965,7 +972,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var47 string
templ_7745c5c3_Var47, templ_7745c5c3_Err = templruntime.NewAttributeExpression(opt.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 211, Col: 37}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 218, Col: 37}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var47)
if templ_7745c5c3_Err != nil {
@@ -988,7 +995,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var48 string
templ_7745c5c3_Var48, templ_7745c5c3_Err = templ.JoinStringErrs(opt.Label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 211, Col: 86}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 218, Col: 86}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var48))
if templ_7745c5c3_Err != nil {
@@ -1007,7 +1014,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var49 string
templ_7745c5c3_Var49, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.group_position"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 217, Col: 130}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 224, Col: 130}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var49))
if templ_7745c5c3_Err != nil {
@@ -1028,7 +1035,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var50 string
templ_7745c5c3_Var50, templ_7745c5c3_Err = templruntime.NewAttributeExpression(strconv.Itoa(g.Position)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 218, Col: 93}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 225, Col: 93}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var50)
if templ_7745c5c3_Err != nil {
@@ -1081,7 +1088,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var53 string
templ_7745c5c3_Var53, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/statuspages/" + e.ID + "/groups/" + g.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 224, Col: 73}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 231, Col: 73}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var53)
if templ_7745c5c3_Err != nil {
@@ -1094,7 +1101,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var54 string
templ_7745c5c3_Var54, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "groups.delete_confirm")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 225, Col: 64}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 232, Col: 64}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var54)
if templ_7745c5c3_Err != nil {
@@ -1107,7 +1114,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var55 string
templ_7745c5c3_Var55, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/statuspages/" + e.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 226, Col: 47}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 233, Col: 47}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var55)
if templ_7745c5c3_Err != nil {
@@ -1120,7 +1127,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var56 string
templ_7745c5c3_Var56, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "common.delete"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 228, Col: 43}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 235, Col: 43}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var56))
if templ_7745c5c3_Err != nil {
@@ -1143,7 +1150,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var57 string
templ_7745c5c3_Var57, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/statuspages/" + e.ID + "/groups").Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 236, Col: 60}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 243, Col: 60}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var57)
if templ_7745c5c3_Err != nil {
@@ -1156,7 +1163,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var58 string
templ_7745c5c3_Var58, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/statuspages/" + e.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 236, Col: 97}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 243, Col: 97}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var58)
if templ_7745c5c3_Err != nil {
@@ -1177,7 +1184,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var59 string
templ_7745c5c3_Var59, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.create"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 240, Col: 82}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 247, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var59))
if templ_7745c5c3_Err != nil {
@@ -1198,7 +1205,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var60 string
templ_7745c5c3_Var60, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "sso.field.name")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 241, Col: 95}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 248, Col: 95}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var60)
if templ_7745c5c3_Err != nil {
@@ -1243,7 +1250,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var63 string
templ_7745c5c3_Var63, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.parent"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 244, Col: 82}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 251, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var63))
if templ_7745c5c3_Err != nil {
@@ -1296,7 +1303,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var66 string
templ_7745c5c3_Var66, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.none"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 246, Col: 54}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 253, Col: 54}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var66))
if templ_7745c5c3_Err != nil {
@@ -1314,7 +1321,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var67 string
templ_7745c5c3_Var67, templ_7745c5c3_Err = templruntime.NewAttributeExpression(opt.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 248, Col: 32}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 255, Col: 32}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var67)
if templ_7745c5c3_Err != nil {
@@ -1327,7 +1334,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var68 string
templ_7745c5c3_Var68, templ_7745c5c3_Err = templ.JoinStringErrs(opt.Label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 248, Col: 46}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 255, Col: 46}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var68))
if templ_7745c5c3_Err != nil {
@@ -1345,7 +1352,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var69 string
templ_7745c5c3_Var69, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.group_position"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 253, Col: 89}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 260, Col: 89}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var69))
if templ_7745c5c3_Err != nil {
@@ -1366,7 +1373,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var70 string
templ_7745c5c3_Var70, templ_7745c5c3_Err = templruntime.NewAttributeExpression(strconv.Itoa(len(e.Groups))).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 254, Col: 92}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 261, Col: 92}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var70)
if templ_7745c5c3_Err != nil {
@@ -1427,7 +1434,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var73 string
templ_7745c5c3_Var73, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/statuspages/" + e.ID + "/monitors").Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 264, Col: 62}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 271, Col: 62}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var73)
if templ_7745c5c3_Err != nil {
@@ -1440,7 +1447,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var74 string
templ_7745c5c3_Var74, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/statuspages/" + e.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 264, Col: 138}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 271, Col: 138}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var74)
if templ_7745c5c3_Err != nil {
@@ -1462,7 +1469,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var75 string
templ_7745c5c3_Var75, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.monitors.empty"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 267, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 274, Col: 81}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var75))
if templ_7745c5c3_Err != nil {
@@ -1495,7 +1502,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var76 string
templ_7745c5c3_Var76, templ_7745c5c3_Err = templruntime.NewAttributeExpression(m.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 272, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 279, Col: 115}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var76)
if templ_7745c5c3_Err != nil {
@@ -1508,7 +1515,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var77 string
templ_7745c5c3_Var77, templ_7745c5c3_Err = templ.JoinStringErrs(m.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 274, Col: 24}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 281, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var77))
if templ_7745c5c3_Err != nil {
@@ -1526,7 +1533,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var78 string
templ_7745c5c3_Var78, templ_7745c5c3_Err = templ.JoinStringErrs(m.MonitorGroupPath)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 276, Col: 74}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 283, Col: 74}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var78))
if templ_7745c5c3_Err != nil {
@@ -1544,7 +1551,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var79 string
templ_7745c5c3_Var79, templ_7745c5c3_Err = templruntime.NewAttributeExpression(m.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 279, Col: 66}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 286, Col: 66}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var79)
if templ_7745c5c3_Err != nil {
@@ -1557,7 +1564,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var80 string
templ_7745c5c3_Var80, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "pages.group")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 282, Col: 93}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 289, Col: 93}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var80)
if templ_7745c5c3_Err != nil {
@@ -1570,7 +1577,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var81 string
templ_7745c5c3_Var81, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.no_group"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 283, Col: 59}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 290, Col: 59}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var81))
if templ_7745c5c3_Err != nil {
@@ -1588,7 +1595,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var82 string
templ_7745c5c3_Var82, templ_7745c5c3_Err = templruntime.NewAttributeExpression(opt.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 285, Col: 34}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 292, Col: 34}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var82)
if templ_7745c5c3_Err != nil {
@@ -1611,7 +1618,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var83 string
templ_7745c5c3_Var83, templ_7745c5c3_Err = templ.JoinStringErrs(opt.Label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 285, Col: 82}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 292, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var83))
if templ_7745c5c3_Err != nil {
@@ -1629,7 +1636,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var84 string
templ_7745c5c3_Var84, templ_7745c5c3_Err = templruntime.NewAttributeExpression(m.Label).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 288, Col: 51}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 295, Col: 51}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var84)
if templ_7745c5c3_Err != nil {
@@ -1642,7 +1649,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var85 string
templ_7745c5c3_Var85, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "pages.label")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 288, Col: 94}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 295, Col: 94}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var85)
if templ_7745c5c3_Err != nil {
@@ -1676,7 +1683,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var86 string
templ_7745c5c3_Var86, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_intro"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 298, Col: 75}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 305, Col: 75}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var86))
if templ_7745c5c3_Err != nil {
@@ -1689,7 +1696,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var87 string
templ_7745c5c3_Var87, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/statuspages/" + e.ID + "/domain").Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 299, Col: 60}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 306, Col: 60}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var87)
if templ_7745c5c3_Err != nil {
@@ -1702,7 +1709,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
var templ_7745c5c3_Var88 string
templ_7745c5c3_Var88, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/statuspages/" + e.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 299, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 306, Col: 115}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var88)
if templ_7745c5c3_Err != nil {
@@ -1729,7 +1736,7 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
return templ_7745c5c3_Err
}
if e.Domain != "" {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 149, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 149, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1738,247 +1745,247 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var89 string
- templ_7745c5c3_Var89, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_verified"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 308, Col: 88}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var89))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ switch e.VerifiedBy {
+ case "cname":
+ var templ_7745c5c3_Var89 string
+ templ_7745c5c3_Var89, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_verified_by_cname"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 318, Col: 58}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var89))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ case "txt":
+ var templ_7745c5c3_Var90 string
+ templ_7745c5c3_Var90, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_verified_by_txt"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 320, Col: 56}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var90))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ default:
+ var templ_7745c5c3_Var91 string
+ templ_7745c5c3_Var91, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_verified"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 322, Col: 54}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var91))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 151, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- } else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 152, "
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ if e.MissingSince != "" {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 152, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var92 string
+ templ_7745c5c3_Var92, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_missing", "Since", e.MissingSince, "Date", e.SwitchOffAt))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 326, Col: 146}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var92))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 153, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ } else if e.VerifiedBy != "" {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 154, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var93 string
+ templ_7745c5c3_Var93, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_keep"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 328, Col: 73}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var93))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 155, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
}
- var templ_7745c5c3_Var90 string
- templ_7745c5c3_Var90, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_verify"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 310, Col: 66}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var90))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 153, "
TXT ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var91 string
- templ_7745c5c3_Var91, templ_7745c5c3_Err = templ.JoinStringErrs(e.RecordName)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 313, Col: 46}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var91))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 154, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var92 string
- templ_7745c5c3_Var92, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.value"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 314, Col: 61}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var92))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 155, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var93 string
- templ_7745c5c3_Var93, templ_7745c5c3_Err = templ.JoinStringErrs(e.RecordValue)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 315, Col: 47}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var93))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 156, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var94 string
- templ_7745c5c3_Var94, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/statuspages/" + e.ID + "/domain/verify").Resolve(ctx)
+ templ_7745c5c3_Var94, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_cname_step"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 317, Col: 88}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 331, Col: 51}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var94)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var94))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 157, "\" data-ok=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 157, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = dnsRecordList("CNAME", e.Domain, e.CNAMEValue+".").Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = verifyButton(e.ID, "pages.verify_now").Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 158, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var95 string
- templ_7745c5c3_Var95, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "pages.domain_verified")).Resolve(ctx)
+ templ_7745c5c3_Var95, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_alt_summary"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 317, Col: 137}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 335, Col: 116}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var95)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var95))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 158, "\" data-reload class=\"border border-ink px-3 py-1.5 text-sm hover:bg-ink hover:text-paper\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 159, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var96 string
- templ_7745c5c3_Var96, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.verify"))
+ templ_7745c5c3_Var96, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_alt", "Target", e.CNAMEValue))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 317, Col: 257}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 336, Col: 95}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var96))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 159, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 160, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 160, "
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- switch {
- case e.OwnServers:
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 161, "")
+ templ_7745c5c3_Err = dnsRecordList("TXT", e.RecordName, e.RecordValue).Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = verifyButton(e.ID, "pages.verify").Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 161, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ } else {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 162, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var97 string
- templ_7745c5c3_Var97, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_cname_own"))
+ templ_7745c5c3_Var97, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_verify"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 323, Col: 57}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 341, Col: 52}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var97))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 162, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 163, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- case e.CNAMETarget != "":
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 163, "")
+ templ_7745c5c3_Err = dnsRecordList("TXT", e.RecordName, e.RecordValue).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var98 string
- templ_7745c5c3_Var98, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_cname"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 325, Col: 66}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var98))
+ templ_7745c5c3_Err = verifyButton(e.ID, "pages.verify").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 164, "
CNAME ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ if e.OwnServers {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 164, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var98 string
+ templ_7745c5c3_Var98, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_cname_own"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 345, Col: 56}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var98))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 165, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ } else {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 166, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var99 string
+ templ_7745c5c3_Var99, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_cname_unknown"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 347, Col: 60}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var99))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 167, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
}
- var templ_7745c5c3_Var99 string
- templ_7745c5c3_Var99, templ_7745c5c3_Err = templ.JoinStringErrs(e.Domain)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 328, Col: 43}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var99))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 165, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 168, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var100 string
- templ_7745c5c3_Var100, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.value"))
+ templ_7745c5c3_Var100, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_apex"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 329, Col: 62}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 349, Col: 72}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var100))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 166, "
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var101 string
- templ_7745c5c3_Var101, templ_7745c5c3_Err = templ.JoinStringErrs(e.CNAMETarget + ".")
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 330, Col: 54}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var101))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 167, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- default:
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 168, "")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var102 string
- templ_7745c5c3_Var102, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_cname_unknown"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 333, Col: 61}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var102))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 169, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 170, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 170, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var103 string
- templ_7745c5c3_Var103, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_apex"))
+ var templ_7745c5c3_Var101 string
+ templ_7745c5c3_Var101, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_tls", "Count", e.DomainChangesPerDay))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 335, Col: 77}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 351, Col: 107}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var103))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var101))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 171, "
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var104 string
- templ_7745c5c3_Var104, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_tls", "Count", e.DomainChangesPerDay))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 338, Col: 108}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var104))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 172, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 171, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 173, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 172, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1992,4 +1999,145 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component {
})
}
+func dnsRecordList(kind, name, value string) templ.Component {
+ return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
+ if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
+ return templ_7745c5c3_CtxErr
+ }
+ templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
+ if !templ_7745c5c3_IsBuffer {
+ defer func() {
+ templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err == nil {
+ templ_7745c5c3_Err = templ_7745c5c3_BufErr
+ }
+ }()
+ }
+ ctx = templ.InitializeContext(ctx)
+ ctx = templ.ClearChildren(ctx)
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 173, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var103 string
+ templ_7745c5c3_Var103, templ_7745c5c3_Err = templ.JoinStringErrs(kind)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 362, Col: 31}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var103))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 174, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var104 string
+ templ_7745c5c3_Var104, templ_7745c5c3_Err = templ.JoinStringErrs(name)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 363, Col: 30}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var104))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 175, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var105 string
+ templ_7745c5c3_Var105, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.value"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 364, Col: 53}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var105))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 176, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var106 string
+ templ_7745c5c3_Var106, templ_7745c5c3_Err = templ.JoinStringErrs(value)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 365, Col: 31}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var106))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 177, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ return nil
+ })
+}
+
+func verifyButton(pageID, label string) templ.Component {
+ return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
+ if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
+ return templ_7745c5c3_CtxErr
+ }
+ templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
+ if !templ_7745c5c3_IsBuffer {
+ defer func() {
+ templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err == nil {
+ templ_7745c5c3_Err = templ_7745c5c3_BufErr
+ }
+ }()
+ }
+ ctx = templ.InitializeContext(ctx)
+ ctx = templ.ClearChildren(ctx)
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 178, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var110 string
+ templ_7745c5c3_Var110, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, label))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 370, Col: 247}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var110))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 181, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ return nil
+ })
+}
+
var _ = templruntime.GeneratedTemplate
--
2.54.1