feat(statuspage): keep serving status pages while the api is down
Snapshots are persisted to UPTIME_STATUSPAGE_CACHE_DIR and loaded at start, so pages survive restarts during an outage. Cached pages are answered without waiting for the API, refreshed in the background and served for as long as the API stays unreachable, with a notice once they are older than five minutes. Only an explicit not found from the API removes a page. Readiness no longer depends on the API when pages are cached, the server starts without a reachable API, and certificates are mirrored locally so HTTPS keeps working after a restart. Closes #56 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
20664dd5dd
commit
6e2f8d0626
12 files changed
+660
-214
No files matched your search
@@ -147,6 +147,10 @@ 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"`
|
||||
// CacheDir keeps snapshots and certificates so pages survive restarts
|
||||
// while the API is down. Defaults to the user cache directory; on
|
||||
// Kubernetes mount a persistent volume or at least an emptyDir.
|
||||
CacheDir string `env:"UPTIME_STATUSPAGE_CACHE_DIR"`
|
||||
// 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.
|
||||
|
||||
Reference in new issue
Block a user