| Server IP : 202.61.199.114 / Your IP : 216.73.217.139 Web Server : nginx/1.22.1 System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64 User : web20 ( 1018) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/safemyident.de/web/api/lib/ |
Upload File : |
<?php
/**
* Bootstrap für die IP-Check-Endpoints (eigene, konfigurierbare Limits).
*
* @package SafeMyIdent\Api
*/
declare(strict_types=1);
require_once __DIR__ . '/net.php';
require_once __DIR__ . '/response.php';
require_once __DIR__ . '/ratelimit.php';
require_once __DIR__ . '/validate.php';
require_once __DIR__ . '/ipintel.php'; // stellt smi_gateway_fetch()/smi_intel_* bereit.
header('Content-Type: application/json; charset=utf-8');
header('X-Content-Type-Options: nosniff');
header('Referrer-Policy: no-referrer');
header('Cache-Control: no-store, private');
$smi_cfg = smi_config();
$smi_allowed = ['https://safemyident.de', 'https://www.safemyident.de'];
$smi_origin = $_SERVER['HTTP_ORIGIN'] ?? '';
if (in_array($smi_origin, $smi_allowed, true)) {
header('Access-Control-Allow-Origin: ' . $smi_origin);
header('Vary: Origin');
}
if (($_SERVER['REQUEST_METHOD'] ?? 'GET') === 'OPTIONS') {
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type, Accept, X-Requested-With');
http_response_code(204);
exit;
}
if (!smi_rate_ok((int) ($smi_cfg['rate_limit'] ?? 40), (int) ($smi_cfg['rate_window'] ?? 60))) {
smi_json_error('Zu viele Anfragen. Bitte kurz warten.', 429);
}
/**
* Ist ein Modul aktiviert?
*
* @param string $name Modulname.
* @return bool
*/
function smi_module_on(string $name): bool
{
$cfg = smi_config();
return (bool) ($cfg['modules'][$name] ?? true);
}