Initial commit: project openvpn-monitor
This commit is contained in:
20
openvpn-monitor/api/tls-errors.php
Normal file
20
openvpn-monitor/api/tls-errors.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
define('APP_INIT', true); // ✅ Добавлено
|
||||
|
||||
$path = __DIR__ . '/../src/OpenVPNMonitor.php';
|
||||
if (!file_exists($path)) {
|
||||
http_response_code(500);
|
||||
echo json_encode(['error' => 'File not found: ' . $path]);
|
||||
exit;
|
||||
}
|
||||
require_once $path;
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
try {
|
||||
$monitor = new OpenVPNMonitor();
|
||||
$errors = $monitor->getTlsErrors();
|
||||
echo json_encode(['tls_errors' => $errors]);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['error' => $e->getMessage()]);
|
||||
}
|
||||
Reference in New Issue
Block a user