Fix Stats

This commit is contained in:
leosw
2025-12-27 19:12:01 +01:00
parent de4c629ee5
commit 982d5fe20b

View File

@@ -161,7 +161,7 @@ if ($action === 'admin_generate_stats') {
$report = __DIR__ . "/stats.html";
// Récupérer tous les logs gzip
$gz_files = glob('/var/log/nginx/materiel.org-access.log*.gz');
$gz_files = glob('/var/log/nginx/materiel.kabano.org-access.log*.gz');
// Construire la commande
$cmd = "/bin/bash -c '(";
@@ -172,12 +172,12 @@ if ($action === 'admin_generate_stats') {
}
// 2. Log dhier
if (file_exists('/var/log/nginx/materiel.org-access.log.1')) {
$cmd .= "cat /var/log/nginx/materiel.org-access.log.1 ; ";
if (file_exists('/var/log/nginx/materiel.kabano.org-access.log.1')) {
$cmd .= "cat /var/log/nginx/materiel.kabano.org-access.log.1 ; ";
}
// 3. Log du jour
$cmd .= "cat /var/log/nginx/materiel.org-access.log";
$cmd .= "cat /var/log/nginx/materiel.kabano.org-access.log";
$cmd .= ") | goaccess --log-format=COMBINED --no-progress -o "
. escapeshellarg($report)