This commit is contained in:
Halbe Bruno
2025-12-05 19:40:39 -03:00
commit f37bc712e6
4312 changed files with 359196 additions and 0 deletions

39
public/debug_domains.php Normal file
View File

@@ -0,0 +1,39 @@
<?php
require_once __DIR__ . '/../vendor/autoload.php';
use App\Models\Domain;
use App\Config\Database;
// Simple security check: only allow from localhost or private IPs if desired.
// For dev environment convenience, we'll allow it but add a warning header.
header('Content-Type: application/json');
header('X-Debug-Mode: True');
try {
$domainModel = new Domain();
// Use findAll and filter manually to be safe
$all = $domainModel->findAll();
$domains = array_filter($all, function ($d) {
return isset($d['status']) && $d['status'] === 'blocked';
});
$domains = array_values($domains); // Reindex
$domainNames = array_column($domains, 'name');
// Calculate checksum
$checksum = md5(json_encode($domainNames));
echo json_encode([
'count' => count($domainNames),
'checksum' => $checksum,
'timestamp' => time(),
'domains' => $domainNames
], JSON_PRETTY_PRINT);
} catch (\Exception $e) {
http_response_code(500);
echo json_encode(['error' => $e->getMessage()]);
}