Files
html/api/wevia-master-registry.php
2026-04-16 02:28:32 +02:00

65 lines
2.9 KiB
PHP

<?php
header('Content-Type:application/json');
set_time_limit(120);
$ts=date('c');$apps=[];
function check($host,$port,$name,$server,$path='/'){
$url="http://$host:$port$path";
$ch=curl_init($url);
curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>1,CURLOPT_TIMEOUT=>5,CURLOPT_SSL_VERIFYPEER=>0,CURLOPT_CONNECTTIMEOUT=>3]);
$body=curl_exec($ch);$code=curl_getinfo($ch,CURLINFO_HTTP_CODE);curl_close($ch);
return['name'=>$name,'server'=>$server,'port'=>$port,'code'=>$code,'size'=>strlen($body),'up'=>$code>=200&&$code<500];
}
// === S204 (127.0.0.1) ===
$s204=[
[80,'Nginx','web'],[443,'Nginx SSL','web'],
[2024,'LangGraph/DeerFlow','ai'],[2026,'WEVAL Service','app'],
[3000,'Twenty CRM','crm'],[3002,'DeerFlow UI','ai'],
[3088,'Uptime Kuma','monitor'],[3100,'Langfuse','observe'],
[3200,'Paperclip UI','agent'],[3201,'Paperclip API','agent'],
[3900,'ClawCode IDE','code'],[4000,'WEVAL Sovereign API','api'],
[4001,'WEVAL Service 2','api'],[5001,'MiroFish Backend','ai'],
[5432,'PostgreSQL','db'],[5433,'PG Replica','db'],
[5678,'n8n','automation'],[6333,'Qdrant','vector'],
[8000,'Plausible','analytics'],[8065,'Mattermost','chat'],
[8080,'SearXNG','search'],[8123,'ClickHouse','db'],
[8222,'Vaultwarden','security'],[8443,'S95 Backup','infra'],
[8888,'SearXNG Proxy','search'],[9090,'Prometheus','monitor'],
[9100,'Node Exporter','monitor'],[11434,'Ollama','ai'],
[49222,'SSH','infra'],
];
foreach($s204 as $s){$apps[]=check('127.0.0.1',$s[0],$s[1],'S204');}
// === S95 (10.1.0.3) ===
$s95=[
[80,'Apache/WEVADS','web'],[443,'Apache SSL','web'],
[5432,'PostgreSQL','db'],[5678,'n8n S95','automation'],
[5890,'Sentinel Brain','api'],[6333,'Qdrant S95','vector'],
[6380,'Redis S95','cache'],[8222,'Vaultwarden S95','security'],
[8443,'Sentinel Backup','api'],
];
foreach($s95 as $s){$apps[]=check('10.1.0.3',$s[0],$s[1],'S95');}
// === S151 (151.80.235.110) ===
$s151=[
[80,'OVH Web','web'],[443,'OVH SSL','web'],
[11434,'Ollama S151','ai'],
];
foreach($s151 as $s){$apps[]=check('151.80.235.110',$s[0],$s[1],'S151');}
// === SUBDOMAINS ===
$subs=['crm','mirofish','paperclip','langfuse','deerflow','analytics','mm','monitor','n8n'];
foreach($subs as $s){
$ch=curl_init("https://$s.weval-consulting.com/");
curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>1,CURLOPT_TIMEOUT=>8,CURLOPT_SSL_VERIFYPEER=>0,CURLOPT_FOLLOWLOCATION=>1]);
$body=curl_exec($ch);$code=curl_getinfo($ch,CURLINFO_HTTP_CODE);curl_close($ch);
$apps[]=['name'=>"Sub:$s",'server'=>'CF','port'=>443,'code'=>$code,'size'=>strlen($body),'up'=>$code>=200&&$code<400];
}
$up=count(array_filter($apps,fn($a)=>$a['up']));
$total=count($apps);
$down=array_values(array_filter($apps,fn($a)=>!$a['up']));
echo json_encode(['ts'=>$ts,'total'=>$total,'up'=>$up,'down'=>count($down),'pct'=>round(100*$up/$total),'apps'=>$apps,'fails'=>$down],JSON_PRETTY_PRINT);