summaryrefslogtreecommitdiff
path: root/internal/config.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-01-06 10:03:43 +0200
committerPaul Buetow <paul@buetow.org>2026-01-06 10:03:43 +0200
commitf5cffe240c44045684d4f74981235b060828550e (patch)
treea1be9ab5edee3c42052a81391a307dfe1202e08d /internal/config.go
parent5fa8012c6b085c8d4244d3b4f9c99c1937fb65a2 (diff)
Add HTML status page generation (v1.3.0)v1.3.0
- Add configurable HTML status page generation after each check-run - Default output: /var/www/htdocs/buetow.org/self/gogios/index.html - New config options: HTMLStatusFile (path) and HTMLDisable (bool) - Auto-creates output directory if it doesn't exist - Uses atomic writes (tmp file + rename) to prevent corruption - Auto-refresh every 5 minutes via meta tag - Minimal, clean styling based on f3s_fallback template - W3C HTML5 compliant output - Email notifications on I/O errors via existing notifyError mechanism - Mirrors email report structure (status changes, unhandled alerts, stale alerts) - Comprehensive unit tests including W3C compliance validation - All user-generated content properly HTML-escaped for security 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/config.go')
-rw-r--r--internal/config.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/config.go b/internal/config.go
index 740b19b..2ade802 100644
--- a/internal/config.go
+++ b/internal/config.go
@@ -14,6 +14,8 @@ type config struct {
SMTPServer string `json:"SMTPServer,omitempty"`
SMTPDisable bool `json:"SMTPDisable,omitempty"` // TODO: Document this option
StateDir string `json:"StateDir,omitempty"`
+ HTMLStatusFile string `json:"HTMLStatusFile,omitempty"` // Path to HTML status file
+ HTMLDisable bool `json:"HTMLDisable,omitempty"` // Disable HTML status page generation
CheckTimeoutS int
CheckConcurrency int
StaleThreshold int `json:"StaleThreshold,omitempty"`
@@ -58,6 +60,11 @@ func newConfig(configFile string) (config, error) {
conf.StaleThreshold = 3600 // Default to 1 hour
}
+ if !conf.HTMLDisable && conf.HTMLStatusFile == "" {
+ conf.HTMLStatusFile = "/var/www/htdocs/buetow.org/self/gogios/index.html"
+ log.Println("Set HTMLStatusFile to " + conf.HTMLStatusFile)
+ }
+
return conf, nil
}