Add certbot status to dashboard services and sidebar nav indicator
- Add certbot to getDaemonStatus: checks binary availability and version - Dashboard: add Certificates card to services grid - Sidebar: show green/red status dot for certbot on Certificates nav item
This commit is contained in:
@@ -550,6 +550,20 @@ func getDaemonStatus() map[string]map[string]any {
|
||||
}
|
||||
result["nftables"] = nftEntry
|
||||
|
||||
// certbot is a CLI tool, not a daemon — check if installed
|
||||
certbotEntry := map[string]any{"active": false}
|
||||
if _, err := exec.LookPath("certbot"); err == nil {
|
||||
certbotEntry["active"] = true
|
||||
if out, verErr := exec.Command("certbot", "--version").Output(); verErr == nil {
|
||||
// "certbot 2.11.0"
|
||||
s := strings.TrimSpace(string(out))
|
||||
if _, after, found := strings.Cut(s, " "); found {
|
||||
certbotEntry["version"] = after
|
||||
}
|
||||
}
|
||||
}
|
||||
result["certbot"] = certbotEntry
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user