mirror of
https://github.com/myronblair/novacpx
synced 2026-06-30 17:50:41 -05:00
feat: #41-#47 admin root controls — enhanced pages + new APIs
#41 phpMyAdmin: quick-access links in database manager #43 PostgreSQL: Adminer at /adminer.php (MySQL + PostgreSQL) #44 Mail server: virtual domains list, mail log tail, better service controls #45 FTP server: full account list from DB, better service controls #47 Web server: stats cards, PHP defaults, log viewer New APIs: system/read-log, email/domains Fix: PHP-FPM pm.max_children increased to 20 (was 5, causing exhaustion) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LP9Q4kfCAYAjJnsbHBrViZ
This commit is contained in:
@@ -1057,5 +1057,22 @@ BASH;
|
||||
exit;
|
||||
})(),
|
||||
|
||||
default => Response::error("Unknown system action: $action", 404),
|
||||
|
||||
'read-log' => (function() {
|
||||
Auth::getInstance()->require('admin');
|
||||
$log = preg_replace('/[^a-z0-9-]/', '', $_GET['log'] ?? 'panel');
|
||||
$map = [
|
||||
'panel' => '/var/log/novacpx/panel.log',
|
||||
'deploy' => '/var/log/novacpx/deploy.log',
|
||||
'nginx-error' => '/var/log/novacpx/nginx-error.log',
|
||||
'nginx-access' => '/var/log/novacpx/nginx-access.log',
|
||||
'mail' => '/var/log/mail.log',
|
||||
'stats' => '/var/log/novacpx/stats-collector.log',
|
||||
];
|
||||
$path = $map[$log] ?? '/var/log/novacpx/panel.log';
|
||||
$raw = file_exists($path) ? trim(shell_exec('tail -100 ' . escapeshellarg($path)) ?: '') : '';
|
||||
Response::success(['content' => $raw, 'log' => $log]);
|
||||
})(),
|
||||
|
||||
default => Response::error("Unknown system action: $action", 404),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user