feat(statuspage): obtain tls certificates on demand for custom domains

With UPTIME_STATUSPAGE_TLS the server serves HTTPS with ACME
certificates for its hosts and for verified custom domains of pages it
may serve, shared by all instances through the API. Plain HTTP answers
ACME challenges and health checks and redirects everything else.

Closes #22

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-22 08:54:08 +01:00
1 parent 46f1f82481
commit 4d1db0943e
8 files changed
+255 -17

No files matched your search

+8
View File
@@ -147,6 +147,14 @@ type StatusPage struct {
// Hosts are the host names that serve pages by slug, e.g.
// status.example.com. Any other host is treated as a custom domain.
Hosts []string `env:"UPTIME_STATUSPAGE_HOSTS" envSeparator:"," envDefault:"localhost"`
// TLS obtains certificates via ACME for the hosts and verified custom
// domains and serves HTTPS on TLSListen; Listen then answers ACME HTTP
// challenges and redirects to HTTPS.
TLS bool `env:"UPTIME_STATUSPAGE_TLS"`
TLSListen string `env:"UPTIME_STATUSPAGE_TLS_LISTEN" envDefault:":443"`
ACMEEmail string `env:"UPTIME_ACME_EMAIL"`
// ACMECA defaults to Let's Encrypt; use its staging URL for testing.
ACMECA string `env:"UPTIME_ACME_CA" envDefault:"https://acme-v02.api.letsencrypt.org/directory"`
}
// Load parses the environment into a T, applying envDefault tags.