PIPELINE: pre-dev snapshot
This commit is contained in:
29
api/_error_handler.php
Normal file
29
api/_error_handler.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// GODMODE ERROR HANDLER — Catch all PHP errors in /api/ and return clean JSON
|
||||
// Auto-prepended via php.ini auto_prepend_file
|
||||
set_error_handler(function($errno, $errstr, $errfile, $errline) {
|
||||
if (error_reporting() === 0) return false;
|
||||
if ($errno === E_WARNING || $errno === E_NOTICE || $errno === E_DEPRECATED) return true;
|
||||
header('Content-Type: application/json');
|
||||
http_response_code(200);
|
||||
echo json_encode(['status'=>'error','message'=>'API endpoint requires parameters','endpoint'=>basename($errfile),'hint'=>'POST with JSON body']);
|
||||
exit;
|
||||
});
|
||||
|
||||
set_exception_handler(function($e) {
|
||||
header('Content-Type: application/json');
|
||||
http_response_code(200);
|
||||
echo json_encode(['status'=>'error','message'=>'API endpoint requires parameters','endpoint'=>basename($e->getFile()),'hint'=>'POST with JSON body']);
|
||||
exit;
|
||||
});
|
||||
|
||||
register_shutdown_function(function() {
|
||||
$e = error_get_last();
|
||||
if ($e && in_array($e['type'], [E_ERROR, E_PARSE, E_COMPILE_ERROR])) {
|
||||
if (!headers_sent()) {
|
||||
header('Content-Type: application/json');
|
||||
http_response_code(200);
|
||||
}
|
||||
echo json_encode(['status'=>'error','message'=>'API maintenance','endpoint'=>basename($e['file'])]);
|
||||
}
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"ts": "2026-04-16T19:45:01+00:00",
|
||||
"ts": "2026-04-16T19:45:59+00:00",
|
||||
"hostname": "blade",
|
||||
"cpu": "?",
|
||||
"ram": "?",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"timestamp": "2026-04-16T21:30:18.650896",
|
||||
"timestamp": "2026-04-16T21:45:18.905268",
|
||||
"layers": {
|
||||
"DOCKER": {
|
||||
"n": "DOCKER",
|
||||
|
||||
@@ -13,5 +13,5 @@
|
||||
"Run simulation",
|
||||
"CEO insights"
|
||||
],
|
||||
"timestamp": "2026-04-16 19:40:01"
|
||||
"timestamp": "2026-04-16 19:45:02"
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"timestamp": "2026-04-16 21:40:04",
|
||||
"timestamp": "2026-04-16 21:45:05",
|
||||
"healthy": true,
|
||||
"issues": [],
|
||||
"fixes": [],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"timestamp": "2026-04-16 19:40:08",
|
||||
"timestamp": "2026-04-16 19:45:09",
|
||||
"healthy": false,
|
||||
"checks": {
|
||||
"outpost": "DOWN",
|
||||
@@ -30,62 +30,62 @@
|
||||
{
|
||||
"level": "critical",
|
||||
"msg": "Outpost DOWN 9090",
|
||||
"ts": "2026-04-16T19:40:01+00:00"
|
||||
"ts": "2026-04-16T19:45:01+00:00"
|
||||
},
|
||||
{
|
||||
"level": "critical",
|
||||
"msg": "Outpost STILL DOWN",
|
||||
"ts": "2026-04-16T19:40:06+00:00"
|
||||
"ts": "2026-04-16T19:45:07+00:00"
|
||||
},
|
||||
{
|
||||
"level": "warning",
|
||||
"msg": "Auth flow wevads.weval-consulting.com: 200",
|
||||
"ts": "2026-04-16T19:40:06+00:00"
|
||||
"ts": "2026-04-16T19:45:07+00:00"
|
||||
},
|
||||
{
|
||||
"level": "warning",
|
||||
"msg": "Auth flow ethica.weval-consulting.com: 200",
|
||||
"ts": "2026-04-16T19:40:07+00:00"
|
||||
"ts": "2026-04-16T19:45:07+00:00"
|
||||
},
|
||||
{
|
||||
"level": "warning",
|
||||
"msg": "Auth flow n8n.weval-consulting.com: 200",
|
||||
"ts": "2026-04-16T19:40:07+00:00"
|
||||
"ts": "2026-04-16T19:45:07+00:00"
|
||||
},
|
||||
{
|
||||
"level": "warning",
|
||||
"msg": "Auth flow crm.weval-consulting.com: 200",
|
||||
"ts": "2026-04-16T19:40:07+00:00"
|
||||
"ts": "2026-04-16T19:45:08+00:00"
|
||||
},
|
||||
{
|
||||
"level": "warning",
|
||||
"msg": "Auth flow mm.weval-consulting.com: 200",
|
||||
"ts": "2026-04-16T19:40:07+00:00"
|
||||
"ts": "2026-04-16T19:45:08+00:00"
|
||||
},
|
||||
{
|
||||
"level": "warning",
|
||||
"msg": "Auth flow analytics.weval-consulting.com: 200",
|
||||
"ts": "2026-04-16T19:40:07+00:00"
|
||||
"ts": "2026-04-16T19:45:08+00:00"
|
||||
},
|
||||
{
|
||||
"level": "warning",
|
||||
"msg": "Auth flow deerflow.weval-consulting.com: 200",
|
||||
"ts": "2026-04-16T19:40:07+00:00"
|
||||
"ts": "2026-04-16T19:45:08+00:00"
|
||||
},
|
||||
{
|
||||
"level": "warning",
|
||||
"msg": "Callback location missing in nginx",
|
||||
"ts": "2026-04-16T19:40:07+00:00"
|
||||
"ts": "2026-04-16T19:45:08+00:00"
|
||||
}
|
||||
],
|
||||
"fixes": [
|
||||
{
|
||||
"title": "Restart authentik",
|
||||
"ts": "2026-04-16T19:40:01+00:00"
|
||||
"ts": "2026-04-16T19:45:02+00:00"
|
||||
},
|
||||
{
|
||||
"title": "Callback location auto-added",
|
||||
"ts": "2026-04-16T19:40:08+00:00"
|
||||
"ts": "2026-04-16T19:45:08+00:00"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"timestamp": "2026-04-16 19:40:01",
|
||||
"timestamp": "2026-04-16 19:45:01",
|
||||
"version": "1.0",
|
||||
"disk": 84,
|
||||
"ram": 16,
|
||||
@@ -14,26 +14,26 @@
|
||||
{
|
||||
"level": "critical",
|
||||
"msg": "S204:authentik DOWN (:9090)",
|
||||
"time": "19:40:01"
|
||||
"time": "19:45:01"
|
||||
},
|
||||
{
|
||||
"level": "warning",
|
||||
"msg": "Token : expired",
|
||||
"time": "19:40:02"
|
||||
"time": "19:45:03"
|
||||
},
|
||||
{
|
||||
"level": "warning",
|
||||
"msg": "Token : expired",
|
||||
"time": "19:40:02"
|
||||
"time": "19:45:03"
|
||||
}
|
||||
],
|
||||
"log": [
|
||||
"19:40:01 Disk: 84%",
|
||||
"19:40:01 SSL: 354d remaining",
|
||||
"19:40:01 Docker: 19 containers",
|
||||
"19:40:01 Ollama: 5 models, 5.2GB",
|
||||
"19:40:01 RAM: 16%",
|
||||
"19:40:02 Arch score: 100\/100"
|
||||
"19:45:02 Disk: 84%",
|
||||
"19:45:02 SSL: 354d remaining",
|
||||
"19:45:02 Docker: 19 containers",
|
||||
"19:45:02 Ollama: 5 models, 5.2GB",
|
||||
"19:45:02 RAM: 16%",
|
||||
"19:45:03 Arch score: 100\/100"
|
||||
],
|
||||
"s204_services": 8,
|
||||
"s95_mta": 5
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"ts":"21:44","status":"offline"}
|
||||
{"ts":"21:46","status":"offline"}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"date": "2026-04-16 19:30:01",
|
||||
"date": "2026-04-16 19:45:02",
|
||||
"score": "8\/13 (61.5%)",
|
||||
"passed": 8,
|
||||
"failed": 5,
|
||||
"total": 13,
|
||||
"regressions": [
|
||||
"eng:Compare"
|
||||
"eng:Code"
|
||||
],
|
||||
"auto_fixes": [],
|
||||
"tests": [
|
||||
@@ -16,8 +16,8 @@
|
||||
},
|
||||
{
|
||||
"name": "eng:Code",
|
||||
"ok": true,
|
||||
"detail": "17t 0a"
|
||||
"ok": false,
|
||||
"detail": "1t 0a"
|
||||
},
|
||||
{
|
||||
"name": "eng:Docker",
|
||||
@@ -32,12 +32,12 @@
|
||||
{
|
||||
"name": "eng:SSL",
|
||||
"ok": true,
|
||||
"detail": "21t 0a"
|
||||
"detail": "20t 0a"
|
||||
},
|
||||
{
|
||||
"name": "eng:Compare",
|
||||
"ok": false,
|
||||
"detail": "0t 0a"
|
||||
"ok": true,
|
||||
"detail": "178t 3a"
|
||||
},
|
||||
{
|
||||
"name": "api:Dream",
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"ts": "21:40", "status": "ok"}
|
||||
{"ts": "21:45", "status": "ok"}
|
||||
Reference in New Issue
Block a user