Files
deepseek beaf0e1f37 Toolvana: production-ready media tools platform (CodeIgniter 4)
- 134-tool registry with programmatic SEO (unique titles/H1/descriptions,
  JSON-LD graphs, sitemap index, canonical 301 enforcement via required filter)
- DB-backed job queue (SKIP LOCKED) with drivers: Ffmpeg, Images (GD),
  Pdf (qpdf/gs/poppler), Youtube (thumbnails), Qr (server-side PNG)
- Security: SSRF guard, MIME validation, rate limits, API-key auth,
  bcrypt admin login, security headers
- Admin panel: dashboard, tools/categories/guides CRUD, SEO audit,
  analytics, job inspector with retry, system health, feature flags
- Docker deployment (nginx + web/api FPM pools + scalable workers),
  PHPUnit suite (19 tests / 1139 assertions), PWA manifest + service worker
2026-08-23 07:10:30 +00:00

51 lines
1.5 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Controllers\Admin;
/**
* System health: binaries, storage, queue depth, worker heartbeat.
* Workers touch the heartbeat cache key every pass (see supervisor config).
*/
final class SystemAdmin extends AdminBase
{
public function index(): string
{
$site = config('Site');
$binaries = [];
foreach ($site->binaries as $name => $path) {
$binaries[$name] = [
'path' => $path,
'ok' => $path !== '' && is_executable($path),
];
}
return $this->render('system_index', [
'phpVersion' => PHP_VERSION,
'ciVersion' => \CodeIgniter\CodeIgniter::CI_VERSION,
'environment' => ENVIRONMENT,
'dbOk' => $this->checkDb(),
'diskFreeMb' => (int) round(disk_free_space(WRITEPATH) / 1048576),
'storageFiles' => count(glob(\App\Libraries\Pipeline::storageDir() . '/*') ?: []),
'incoming' => count(glob(\App\Libraries\Pipeline::incomingDir() . '/*') ?: []),
'workerBeat' => cache()->get('tv_worker_heartbeat'),
'ytDlpEnabled' => service('pipeline')->youtubeEnabled(),
'retentionHrs' => $site->retentionHours,
'maxUploadMb' => $site->maxUploadMb,
] + ['binaries' => $binaries]);
}
private function checkDb(): bool
{
try {
db_connect()->query('SELECT 1');
return true;
} catch (\Throwable) {
return false;
}
}
}