fix(multi): CrowdSec health check, MetaBlogizer menu, Portal apps

- CrowdSec Dashboard: Add bouncer_count, geoip_enabled, acquisition_count,
  scenario_count fields to get_overview and get_health_check RPCD functions
- MetaBlogizer: Fix menu path to admin/secubox/services/metablogizer
- Portal: Add MetaBlogizer and Gitea to apps registry for services section

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-01-27 12:34:50 +01:00
parent 40195b5983
commit bca0ba5ada
3 changed files with 71 additions and 4 deletions

View File

@ -1816,6 +1816,7 @@ get_health_check() {
cs_running=1
fi
json_add_boolean "crowdsec_running" "$cs_running"
json_add_string "crowdsec" "$([ "$cs_running" = "1" ] && echo running || echo stopped)"
# Version
local version=""
@ -1908,6 +1909,27 @@ get_health_check() {
json_add_int "local_decisions" "${local_decisions:-0}"
json_add_int "capi_decisions" "${capi_decisions:-0}"
# GeoIP status - check if GeoIP database exists
local geoip_enabled=0
[ -f "/var/lib/crowdsec/data/GeoLite2-City.mmdb" ] && geoip_enabled=1
[ -f "/var/lib/crowdsec/data/GeoLite2-ASN.mmdb" ] && geoip_enabled=1
json_add_boolean "geoip_enabled" "$geoip_enabled"
# Acquisition sources count
local acquisition_count=0
if [ -d "/etc/crowdsec/acquis.d" ]; then
acquisition_count=$(ls -1 /etc/crowdsec/acquis.d/*.yaml 2>/dev/null | wc -l)
fi
[ -f "/etc/crowdsec/acquis.yaml" ] && acquisition_count=$((acquisition_count + 1))
json_add_int "acquisition_count" "${acquisition_count:-0}"
# Scenario count (installed scenarios)
local scenario_count=0
if [ -x "$CSCLI" ]; then
scenario_count=$(run_cscli scenarios list -o json 2>/dev/null | jsonfilter -e '@[*]' 2>/dev/null | wc -l)
fi
json_add_int "scenario_count" "${scenario_count:-0}"
json_dump
}
@ -2192,7 +2214,28 @@ get_overview() {
json_add_int "local_decisions" "${local_decisions:-0}"
json_add_int "capi_decisions" "${capi_decisions:-0}"
json_add_int "alerts_24h" "${alerts_count:-0}"
json_add_int "bouncers" "${bouncers_count:-0}"
json_add_int "bouncer_count" "${bouncers_count:-0}"
# GeoIP status - check if GeoIP database exists
local geoip_enabled=0
[ -f "/var/lib/crowdsec/data/GeoLite2-City.mmdb" ] && geoip_enabled=1
[ -f "/var/lib/crowdsec/data/GeoLite2-ASN.mmdb" ] && geoip_enabled=1
json_add_boolean "geoip_enabled" "$geoip_enabled"
# Acquisition sources count
local acquisition_count=0
if [ -d "/etc/crowdsec/acquis.d" ]; then
acquisition_count=$(ls -1 /etc/crowdsec/acquis.d/*.yaml 2>/dev/null | wc -l)
fi
[ -f "/etc/crowdsec/acquis.yaml" ] && acquisition_count=$((acquisition_count + 1))
json_add_int "acquisition_count" "${acquisition_count:-0}"
# Scenario count (installed scenarios)
local scenario_count=0
if [ "$cs_running" = "1" ] && [ -x "$CSCLI" ]; then
scenario_count=$(run_cscli scenarios list -o json 2>/dev/null | jsonfilter -e '@[*]' 2>/dev/null | wc -l)
fi
json_add_int "scenario_count" "${scenario_count:-0}"
# Top scenarios (from cached/limited alerts)
local scenarios=""

View File

@ -1,5 +1,5 @@
{
"admin/services/metablogizer": {
"admin/secubox/services/metablogizer": {
"title": "MetaBlogizer",
"action": {
"type": "view",
@ -11,7 +11,7 @@
},
"order": 85
},
"admin/services/metablogizer/overview": {
"admin/secubox/services/metablogizer/overview": {
"title": "Sites",
"action": {
"type": "view",
@ -19,7 +19,7 @@
},
"order": 10
},
"admin/services/metablogizer/settings": {
"admin/secubox/services/metablogizer/settings": {
"title": "Settings",
"action": {
"type": "view",

View File

@ -380,6 +380,30 @@ return baseclass.extend({
path: 'admin/services/nextcloud/overview',
service: 'nextcloud',
version: '28.0'
},
'metablogizer': {
id: 'metablogizer',
name: 'MetaBlogizer',
desc: 'KISS static site publisher with auto-vhost creation, QR codes, and social sharing',
icon: '\ud83d\udcdd',
iconBg: 'rgba(102, 126, 234, 0.15)',
iconColor: '#667eea',
section: 'services',
path: 'admin/secubox/services/metablogizer/overview',
service: null,
version: '1.0.0'
},
'gitea': {
id: 'gitea',
name: 'Gitea',
desc: 'Self-hosted Git service for code hosting, collaboration, and CI/CD',
icon: '\ud83d\udc19',
iconBg: 'rgba(34, 197, 94, 0.15)',
iconColor: '#22c55e',
section: 'services',
path: 'admin/secubox/services/gitea/overview',
service: 'gitea',
version: '1.22.0'
}
},