From cf64e205a23909660ad49410519cf827e8c5996e Mon Sep 17 00:00:00 2001 From: Opus-Yacine Date: Fri, 17 Apr 2026 03:47:33 +0200 Subject: [PATCH] DOCTRINE 54 NO-DORMANT: page dormant-dashboard.html + API scan + cron audit-hebdo - 35 OSS clones scannes, 6 dormants detectes (claw-code 1.2GB 2.5ans + aios/claude-mem/deepagent/keyhacks/rnd-swarm) - Yacine order NE RIEN LAISSER DORMANT --- api/dormant-scan.php | 47 ++++++++++++++++++ dormant-dashboard.html | 105 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 152 insertions(+) create mode 100644 api/dormant-scan.php create mode 100644 dormant-dashboard.html diff --git a/api/dormant-scan.php b/api/dormant-scan.php new file mode 100644 index 000000000..39ece596f --- /dev/null +++ b/api/dormant-scan.php @@ -0,0 +1,47 @@ + date('c'), 'doctrine' => 'NO-DORMANT-CAPABILITIES']; + +// 1. Open source clones +$oss = []; +$opt_dirs = array_filter(explode("\n", trim(@shell_exec('ls -d /opt/*/ 2>/dev/null')))); +foreach ($opt_dirs as $d) { + if (!is_dir($d . '.git')) continue; + $remote = trim(@shell_exec("cd " . escapeshellarg($d) . " && git remote -v 2>/dev/null | grep -oE 'github\\.com[:/][a-zA-Z0-9_-]+/[a-zA-Z0-9_.-]+' | head -1")); + if (!$remote) continue; + $size = trim(@shell_exec("du -sh " . escapeshellarg($d) . " 2>/dev/null | cut -f1")); + $last_commit_days = (int)trim(@shell_exec("cd " . escapeshellarg($d) . " && git log -1 --format=%ct 2>/dev/null")); + $age_days = $last_commit_days ? intval((time() - $last_commit_days) / 86400) : 999; + $is_dormant = $age_days > 60; + $oss[] = ['path' => $d, 'remote' => $remote, 'size' => $size, 'age_days' => $age_days, 'dormant' => $is_dormant]; +} +$out['oss_total'] = count($oss); +$out['oss_dormant'] = count(array_filter($oss, fn($o) => $o['dormant'])); +$out['oss_samples'] = array_slice($oss, 0, 40); + +// 2. Services inactive (hors normaux) +$svc_raw = @shell_exec("systemctl list-units --state=inactive --type=service --no-legend --no-pager 2>/dev/null | grep -vE 'sys-|systemd-|dev-|dbus-|user-runtime-' | head -30"); +$svc_lines = array_filter(explode("\n", trim($svc_raw))); +$svc_dormant = []; +foreach ($svc_lines as $line) { + if (preg_match('/^[●\s]*(\S+\.service)\s+(loaded|not-found)\s+inactive/', $line, $m)) { + $name = $m[1]; + // Exempt normal + if (preg_match('/^(apt-|cloud-init|snap\.|acpid|apport|certbot|console-|connman|auditd|e2scrub|nftables|ssh-|ua-|fwupd|hostname|fail2ban)/', $name)) continue; + $svc_dormant[] = $name; + } +} +$out['services_dormant'] = $svc_dormant; + +// 3. Docker stopped +$docker_stopped_raw = @shell_exec("docker ps -a --filter status=exited --format '{{.Names}} {{.Status}}' 2>/dev/null"); +$out['docker_stopped'] = array_filter(explode("\n", trim($docker_stopped_raw))); + +// 4. Ports écoutés +$ports = @shell_exec("ss -tlnp 2>/dev/null | awk 'NR>1 {print \$4}' | sort -u | wc -l"); +$out['ports_open'] = intval(trim($ports)); + +// 5. /opt size total +$out['opt_total_size'] = trim(@shell_exec("du -sh /opt 2>/dev/null | cut -f1")); + +echo json_encode($out, JSON_PRETTY_PRINT); diff --git a/dormant-dashboard.html b/dormant-dashboard.html new file mode 100644 index 000000000..c4a25672a --- /dev/null +++ b/dormant-dashboard.html @@ -0,0 +1,105 @@ + + +Dormant Capabilities · NO-DORMANT + + +

🛌 Dormant Capabilities · NO-DORMANT Doctrine

+

Scan de tout ce qui dort sur la plateforme : open-source clones, services, containers stopped, tools non-utilisés. Doctrine nouvelle : ne rien laisser dormant.

+ +

📊 Stats live

+
+
OSS clones /opt
+
Dormants (>60j)
+
Services inactive
+
Docker stopped
+
/opt total
+
+ +

🛌 Open-source clones dormants (>60 jours)

+
Chargement…
+ +

🛌 Tous les OSS clones (actifs et dormants)

+
Chargement…
+ +

🔧 Services inactive détectés

+
Chargement…
+ +

📌 Actions suggérées

+
+ +
+ +

🔗 Liens

+
+ +
+ + +