ENHANCE: Pollinations AI image gen + SSE streaming endpoint for public
This commit is contained in:
2
api/$_IC
2
api/$_IC
@@ -1 +1 @@
|
||||
{"timestamp":"2026-04-06 20:39:54","scan_ms":8291,"servers":{"s204":{"ip":"204.168.152.13","label":"S204 Primary","services":[{"name":"nginx","status":"active","port":"80\/443"},{"name":"php-fpm","status":"active","port":"9000"},{"name":"postgresql-16","status":"active","port":"5432"},{"name":"deerflow","status":"active","port":"2024"},{"name":"deerflow-gw","status":"active","port":"8001"},{"name":"deerflow-fe","status":"active","port":"3000"},{"name":"ollama","status":"active","port":"11434","info":"9 models"}],"docker":[{"name":"authentik-db","status":"Up 24 minutes"},{"name":"authentik-redis","status":"Up 24 minutes"},{"name":"authentik-server","status":"Up 19 minutes (healthy)"},{"name":"authentik-worker","status":"Up 19 minutes (healthy)"},{"name":"chatwoot-redis","status":"Up 24 minutes"},{"name":"langfuse","status":"Up 24 minutes"},{"name":"loki","status":"Up 24 minutes"},{"name":"mattermost","status":"Up 24 minutes (healthy)"},{"name":"n8n","status":"Up 24 minutes"},{"name":"node-exporter","status":"Up 24 minutes"},{"name":"plausible-db","status":"Up 24 minutes"},{"name":"plausible-events","status":"Up 24 minutes"},{"name":"plausible","status":"Up 24 minutes"},{"name":"prometheus","status":"Up 24 minutes"},{"name":"qdrant","status":"Up 24 minutes"},{"name":"searxng","status":"Up 24 minutes"},{"name":"twenty-redis","status":"Up 24 minutes"},{"name":"twenty","status":"Up 24 minutes"},{"name":"uptime-kuma","status":"Up 24 minutes (healthy)"},{"name":"vaultwarden","status":"Up 24 minutes (healthy)"}]},"s95":{"ip":"95.216.167.89","label":"S95 WEVADS","services":[{"name":"kumomta","status":"active","port":"587"},{"name":"apache2","status":"active","port":"80"},{"name":"postgresql","status":"active","port":"5432"},{"name":"postfix","status":"active","port":"2525"},{"name":"pmta","status":"active","port":"25"},{"name":"sentinel","status":"active","port":"5890"},{"name":"adx","status":"active","port":"5821"},{"name":"arsenal","status":"active","port":"5822"}],"docker":[{"name":"listmonk_db","status":"Up 3 days"},{"name":"listmonk","status":"Up 3 days"}]},"s151":{"ip":"151.80.235.110","label":"S151 OVH","services":[{"name":"nginx","status":"active","port":"80"},{"name":"php-fpm","status":"active","port":"9000"},{"name":"postgresql","status":"active","port":"5432"},{"name":"ollama","status":"active","port":"11434"}],"docker":[{"name":"ollama","status":"Up 12 days"}]},"blade":{"ip":"local","label":"Razer Blade","services":[{"name":"Sentinel Agent","status":"active","port":"\u2014","info":"C:\\ProgramData\\WEVAL\\sentinel-agent.ps1"}],"docker":[]}},"crons":[{"server":"S95","user":"root","schedule":"*\/30 * * * *","command":"php \/opt\/wevads\/scripts\/ethica\/ethica-validator.php 500 >> \/opt\/wevads\/logs\/ethica-validator.log 2>&1","source":"crontab"},{"server":"S95","user":"root","schedule":"0 *\/4 * * *","command":"php \/opt\/wevads\/scripts\/cron-bounces.php >> \/var\/log\/wevads\/bounces.log 2>&1","source":"crontab"},{"server":"S95","user":"root","schedule":"0 3 * * *","command":"\/root\/backups\/daily_backup.sh","source":"crontab"},{"server":"S95","user":"root","schedule":"0 4 * * *","command":"\/opt\/wevads\/scripts\/auto-backup-github.sh >> \/var\/log\/wevads\/backup.log 2>&1","source":"crontab"},{"server":"S95","user":"root","schedule":"30 0 * * *","command":"php \/opt\/wevads\/scripts\/daily-stats-aggregate.php >> \/var\/log\/wevads\/daily-stats.log 2>&1","source":"crontab"},{"server":"S95","user":"root","schedule":"30 1 * * *","command":"php \/opt\/wevads\/scripts\/cron-engagement.php >> \/var\/log\/wevads\/engagement.log 2>&1","source":"crontab"},{"server":"S151","user":"ubuntu","schedule":"*\/5 * * * *","command":"curl -s -m 10 http:\/\/localhost:11434\/api\/generate -d {model:granite4,prompt:ok,stream:false,keep_alive:-1} > \/dev\/null 2>&1","source":"crontab"},{"server":"S151","user":"ubuntu","schedule":"*\/10 * * * *","command":"docker start openclaw 2>\/dev\/null","source":"crontab"},{"server":"S151","user":"root","schedule":"*\/5 * * * *","command":"\/opt\/tracking_monitor.sh","source":"crontab"},{"server":"Blade","user":"SYSTEM","schedule":"*\/60s loop","command":"sentinel-agent.ps1 (auto-sync S204)","source":"Task Scheduler"}],"stats":{"total_crons":10,"total_services":20,"total_docker":23}}
|
||||
{"timestamp":"2026-04-06 20:41:24","scan_ms":7829,"servers":{"s204":{"ip":"204.168.152.13","label":"S204 Primary","services":[{"name":"nginx","status":"active","port":"80\/443"},{"name":"php-fpm","status":"active","port":"9000"},{"name":"postgresql-16","status":"active","port":"5432"},{"name":"deerflow","status":"active","port":"2024"},{"name":"deerflow-gw","status":"active","port":"8001"},{"name":"deerflow-fe","status":"active","port":"3000"},{"name":"ollama","status":"active","port":"11434","info":"9 models"}],"docker":[{"name":"authentik-db","status":"Up 25 minutes"},{"name":"authentik-redis","status":"Up 25 minutes"},{"name":"authentik-server","status":"Up 20 minutes (healthy)"},{"name":"authentik-worker","status":"Up 20 minutes (healthy)"},{"name":"chatwoot-redis","status":"Up 25 minutes"},{"name":"langfuse","status":"Up 25 minutes"},{"name":"loki","status":"Up 25 minutes"},{"name":"mattermost","status":"Up 25 minutes (healthy)"},{"name":"n8n","status":"Up 25 minutes"},{"name":"node-exporter","status":"Up 25 minutes"},{"name":"plausible-db","status":"Up 25 minutes"},{"name":"plausible-events","status":"Up 25 minutes"},{"name":"plausible","status":"Up 25 minutes"},{"name":"prometheus","status":"Up 25 minutes"},{"name":"qdrant","status":"Up 25 minutes"},{"name":"searxng","status":"Up 25 minutes"},{"name":"twenty-redis","status":"Up 25 minutes"},{"name":"twenty","status":"Up 25 minutes"},{"name":"uptime-kuma","status":"Up 25 minutes (healthy)"},{"name":"vaultwarden","status":"Up 25 minutes (healthy)"}]},"s95":{"ip":"95.216.167.89","label":"S95 WEVADS","services":[{"name":"kumomta","status":"active","port":"587"},{"name":"apache2","status":"active","port":"80"},{"name":"postgresql","status":"active","port":"5432"},{"name":"postfix","status":"active","port":"2525"},{"name":"pmta","status":"active","port":"25"},{"name":"sentinel","status":"active","port":"5890"},{"name":"adx","status":"active","port":"5821"},{"name":"arsenal","status":"active","port":"5822"}],"docker":[{"name":"listmonk_db","status":"Up 3 days"},{"name":"listmonk","status":"Up 3 days"}]},"s151":{"ip":"151.80.235.110","label":"S151 OVH","services":[{"name":"nginx","status":"active","port":"80"},{"name":"php-fpm","status":"active","port":"9000"},{"name":"postgresql","status":"active","port":"5432"},{"name":"ollama","status":"active","port":"11434"}],"docker":[{"name":"ollama","status":"Up 12 days"}]},"blade":{"ip":"local","label":"Razer Blade","services":[{"name":"Sentinel Agent","status":"active","port":"\u2014","info":"C:\\ProgramData\\WEVAL\\sentinel-agent.ps1"}],"docker":[]}},"crons":[{"server":"S95","user":"root","schedule":"*\/30 * * * *","command":"php \/opt\/wevads\/scripts\/ethica\/ethica-validator.php 500 >> \/opt\/wevads\/logs\/ethica-validator.log 2>&1","source":"crontab"},{"server":"S95","user":"root","schedule":"0 *\/4 * * *","command":"php \/opt\/wevads\/scripts\/cron-bounces.php >> \/var\/log\/wevads\/bounces.log 2>&1","source":"crontab"},{"server":"S95","user":"root","schedule":"0 3 * * *","command":"\/root\/backups\/daily_backup.sh","source":"crontab"},{"server":"S95","user":"root","schedule":"0 4 * * *","command":"\/opt\/wevads\/scripts\/auto-backup-github.sh >> \/var\/log\/wevads\/backup.log 2>&1","source":"crontab"},{"server":"S95","user":"root","schedule":"30 0 * * *","command":"php \/opt\/wevads\/scripts\/daily-stats-aggregate.php >> \/var\/log\/wevads\/daily-stats.log 2>&1","source":"crontab"},{"server":"S95","user":"root","schedule":"30 1 * * *","command":"php \/opt\/wevads\/scripts\/cron-engagement.php >> \/var\/log\/wevads\/engagement.log 2>&1","source":"crontab"},{"server":"S151","user":"ubuntu","schedule":"*\/5 * * * *","command":"curl -s -m 10 http:\/\/localhost:11434\/api\/generate -d {model:granite4,prompt:ok,stream:false,keep_alive:-1} > \/dev\/null 2>&1","source":"crontab"},{"server":"S151","user":"ubuntu","schedule":"*\/10 * * * *","command":"docker start openclaw 2>\/dev\/null","source":"crontab"},{"server":"S151","user":"root","schedule":"*\/5 * * * *","command":"\/opt\/tracking_monitor.sh","source":"crontab"},{"server":"Blade","user":"SYSTEM","schedule":"*\/60s loop","command":"sentinel-agent.ps1 (auto-sync S204)","source":"Task Scheduler"}],"stats":{"total_crons":10,"total_services":20,"total_docker":23}}
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"ts": "2026-04-06T20:40:00+00:00",
|
||||
"ts": "2026-04-06T20:41:33+00:00",
|
||||
"hostname": "LAPTOP-VE75QUHF",
|
||||
"cpu": "75%",
|
||||
"ram": "85% (16GB)",
|
||||
"cpu": "23%",
|
||||
"ram": "83% (16GB)",
|
||||
"disk": "?",
|
||||
"uptime": "0d01h23m",
|
||||
"uptime": "0d01h25m",
|
||||
"user": "Yace",
|
||||
"ip": "41.248.188.205",
|
||||
"agent_version": "2.0"
|
||||
|
||||
@@ -13,5 +13,5 @@
|
||||
"Run simulation",
|
||||
"CEO insights"
|
||||
],
|
||||
"timestamp": "2026-04-06 20:35:01"
|
||||
"timestamp": "2026-04-06 20:40:02"
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
{"ts": "20260406_223610", "version": "3.2", "score": 99, "pass": 152, "fail": 1, "total": 153, "elapsed": 38.8, "categories": {"S204": {"pass": 9, "fail": 0}, "S95-WV": {"pass": 12, "fail": 0}, "S95-ARS": {"pass": 17, "fail": 0}, "S95-iR": {"pass": 1, "fail": 0}, "INFRA": {"pass": 5, "fail": 0}, "API": {"pass": 27, "fail": 0}, "SEC": {"pass": 4, "fail": 0}, "S95-BK": {"pass": 6, "fail": 0}, "C2-API": {"pass": 4, "fail": 0}, "C2-SPA": {"pass": 1, "fail": 0}, "C2-WV": {"pass": 3, "fail": 0}, "SSO": {"pass": 25, "fail": 0}, "DATA": {"pass": 5, "fail": 0}, "CRONS": {"pass": 2, "fail": 0}, "BLADE": {"pass": 7, "fail": 0}, "LIFE": {"pass": 3, "fail": 0}, "FUNC": {"pass": 7, "fail": 0}, "01AVR": {"pass": 9, "fail": 1}, "STRUCT": {"pass": 5, "fail": 0}}, "failures": [{"n": "Caps10", "c": "01AVR", "s": "FAIL", "d": "9/10"}]}
|
||||
{"ts": "20260406_224011", "version": "3.2", "score": 99, "pass": 152, "fail": 1, "total": 153, "elapsed": 43.3, "categories": {"S204": {"pass": 9, "fail": 0}, "S95-WV": {"pass": 12, "fail": 0}, "S95-ARS": {"pass": 17, "fail": 0}, "S95-iR": {"pass": 1, "fail": 0}, "INFRA": {"pass": 5, "fail": 0}, "API": {"pass": 27, "fail": 0}, "SEC": {"pass": 4, "fail": 0}, "S95-BK": {"pass": 6, "fail": 0}, "C2-API": {"pass": 4, "fail": 0}, "C2-SPA": {"pass": 1, "fail": 0}, "C2-WV": {"pass": 3, "fail": 0}, "SSO": {"pass": 25, "fail": 0}, "DATA": {"pass": 5, "fail": 0}, "CRONS": {"pass": 2, "fail": 0}, "BLADE": {"pass": 7, "fail": 0}, "LIFE": {"pass": 3, "fail": 0}, "FUNC": {"pass": 7, "fail": 0}, "01AVR": {"pass": 9, "fail": 1}, "STRUCT": {"pass": 5, "fail": 0}}, "failures": [{"n": "Caps10", "c": "01AVR", "s": "FAIL", "d": "9/10"}]}
|
||||
File diff suppressed because one or more lines are too long
@@ -54,7 +54,7 @@ if (preg_match('/(image|photo|visuel|genere.*image|futuris)/i', $msg)) {
|
||||
$kw = array_values(array_filter($words, fn($w) => strlen($w) >= 3 && !in_array($w, $stops)));
|
||||
$query = implode(',', array_slice($kw, 0, 3));
|
||||
if (!$query) $query = 'landscape,nature';
|
||||
$seed = substr(md5($query), 0, 10); $imgUrl = "https://picsum.photos/seed/" . $seed . "/1024/768";
|
||||
$prompt = rawurlencode($query . " professional high quality 4k"); $imgUrl = "https://image.pollinations.ai/prompt/" . $prompt . "?width=1024&height=768&nologo=true";
|
||||
die(json_encode(['response'=>"Image generee avec succes\n\n",'provider'=>'WEVIA IA','sources'=>[]]));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"timestamp": "2026-04-06 22:35:05",
|
||||
"timestamp": "2026-04-06 22:40:07",
|
||||
"healthy": true,
|
||||
"issues": [],
|
||||
"fixes": [],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"timestamp": "2026-04-06 20:35:03",
|
||||
"timestamp": "2026-04-06 20:40:04",
|
||||
"healthy": true,
|
||||
"checks": {
|
||||
"outpost": "UP",
|
||||
@@ -20,7 +20,7 @@
|
||||
"docker:authentik-worker": "running",
|
||||
"docker:authentik-db": "running",
|
||||
"docker:authentik-redis": "running",
|
||||
"open_ports": 53,
|
||||
"open_ports": 52,
|
||||
"nginx": "OK"
|
||||
},
|
||||
"flow_ok": 9,
|
||||
|
||||
@@ -1,37 +1,29 @@
|
||||
{
|
||||
"timestamp": "2026-04-06 20:35:01",
|
||||
"timestamp": "2026-04-06 20:40:02",
|
||||
"version": "1.0",
|
||||
"disk": 80,
|
||||
"ram": 36,
|
||||
"ram": 37,
|
||||
"docker": 21,
|
||||
"ssl_days": 364,
|
||||
"ssl_days": 363,
|
||||
"ollama_models": 9,
|
||||
"arch_score": 93,
|
||||
"fixes_count": 1,
|
||||
"fixes_count": 0,
|
||||
"alerts_count": 1,
|
||||
"fixes": [
|
||||
{
|
||||
"title": "Docker restart mirofish",
|
||||
"cmd": "docker restart mirofish",
|
||||
"output": "mirofish",
|
||||
"time": "20:35:03"
|
||||
}
|
||||
],
|
||||
"fixes": [],
|
||||
"alerts": [
|
||||
{
|
||||
"level": "critical",
|
||||
"msg": "S204:mirofish DOWN (:5001)",
|
||||
"time": "20:35:01"
|
||||
"time": "20:40:02"
|
||||
}
|
||||
],
|
||||
"log": [
|
||||
"20:35:01 Disk: 80%",
|
||||
"20:35:01 SSL: 364d remaining",
|
||||
"20:35:03 AUTO-FIX: Docker restart mirofish",
|
||||
"20:35:04 Docker: 21 containers",
|
||||
"20:35:04 Ollama: 9 models, 26.2GB",
|
||||
"20:35:04 RAM: 36%",
|
||||
"20:35:04 Arch score: 93\/100"
|
||||
"20:40:02 Disk: 80%",
|
||||
"20:40:02 SSL: 363d remaining",
|
||||
"20:40:02 Docker: 21 containers",
|
||||
"20:40:02 Ollama: 9 models, 26.2GB",
|
||||
"20:40:02 RAM: 37%",
|
||||
"20:40:03 Arch score: 93\/100"
|
||||
],
|
||||
"s204_services": 8,
|
||||
"s95_mta": 5
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"ts":"22:38","status":"offline"}
|
||||
{"ts":"22:40","status":"offline"}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
{"ts":"22:30","disk":"80%","swap":"34%","docker_dead":"none","http":"200","ssl":"Certificate will not expire
|
||||
ok","alerts":"none","crons":45}
|
||||
{"ts":"22:40","disk":"80%","swap":"34%","docker_dead":"none","http":"200","ssl":"Certificate will not expire
|
||||
ok","alerts":"none","crons":46}
|
||||
|
||||
45
api/wevia-public-stream.php
Normal file
45
api/wevia-public-stream.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
// WEVIA Public SSE Streaming — Long responses like WEVIA Master
|
||||
header("Content-Type: text/event-stream");
|
||||
header("Cache-Control: no-cache");
|
||||
header("Connection: keep-alive");
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
if ($_SERVER["REQUEST_METHOD"]==="OPTIONS"){exit;}
|
||||
set_time_limit(60);
|
||||
|
||||
$input = json_decode(file_get_contents("php://input"), true) ?: [];
|
||||
$msg = $input["message"] ?? "";
|
||||
if (!$msg) { echo "data: " . json_encode(["type"=>"error","content"=>"No message"]) . "\n\n"; exit; }
|
||||
|
||||
function sse_send($type, $content) {
|
||||
echo "data: " . json_encode(["type"=>$type,"content"=>$content], JSON_UNESCAPED_UNICODE) . "\n\n";
|
||||
ob_flush(); flush();
|
||||
}
|
||||
|
||||
sse_send("thinking", "Analyse en cours...");
|
||||
|
||||
// Call fast engine
|
||||
$ch = curl_init("http://127.0.0.1/api/weval-ia-fast.php");
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_POST => true,
|
||||
CURLOPT_POSTFIELDS => json_encode(["message"=>$msg,"mode"=>"fast"]),
|
||||
CURLOPT_HTTPHEADER => ["Content-Type: application/json"],
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_TIMEOUT => 30,
|
||||
]);
|
||||
$result = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
$d = json_decode($result, true);
|
||||
$resp = $d["response"] ?? "Service en maintenance";
|
||||
$prov = $d["provider"] ?? "WEVIA";
|
||||
|
||||
// Stream response in chunks (simulate typing)
|
||||
$chunks = str_split($resp, 60);
|
||||
foreach ($chunks as $i => $chunk) {
|
||||
sse_send("token", $chunk);
|
||||
usleep(20000); // 20ms between chunks
|
||||
}
|
||||
|
||||
sse_send("provider", $prov);
|
||||
sse_send("done", "");
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"timestamp": "2026-04-06 20:30:06",
|
||||
"timestamp": "2026-04-06 20:40:08",
|
||||
"healthy": false,
|
||||
"global_pass": 436,
|
||||
"global_fail": 18,
|
||||
@@ -34,8 +34,8 @@
|
||||
"total": 93
|
||||
},
|
||||
"chat_monitor": {
|
||||
"pass": 2,
|
||||
"fail": 1,
|
||||
"pass": 3,
|
||||
"fail": 0,
|
||||
"total": 3,
|
||||
"caps": {
|
||||
"Lean Six Sigma": {
|
||||
@@ -49,9 +49,9 @@
|
||||
"json": true
|
||||
},
|
||||
"SearXNG": {
|
||||
"ok": false,
|
||||
"code": 429,
|
||||
"json": false
|
||||
"ok": true,
|
||||
"code": 200,
|
||||
"json": true
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -61,12 +61,12 @@
|
||||
"healthy": true
|
||||
},
|
||||
"architecture": {
|
||||
"score": 83
|
||||
"score": 93
|
||||
},
|
||||
"chatbot_post": {
|
||||
"healthy": false,
|
||||
"provider": "none",
|
||||
"code": 502
|
||||
"healthy": true,
|
||||
"provider": "Gemini 2.5 Flash",
|
||||
"code": 200
|
||||
},
|
||||
"regression_scan": {
|
||||
"ok": 250,
|
||||
@@ -86,10 +86,7 @@
|
||||
"NonReg: 1 failures ()",
|
||||
"Full NonReg: 5\/28 failures (82%)",
|
||||
"L99 Command: 7 failures",
|
||||
"Chat Monitor: 1 capabilities returning non-JSON",
|
||||
"Architecture score: 83\/100",
|
||||
"Chatbot POST: returning maintenance\/crash (provider cascade broken)",
|
||||
"L99 Mission: 7 failures (264\/292 APIs, uptime-kuma, langfuse)"
|
||||
],
|
||||
"issues_count": 8
|
||||
"issues_count": 5
|
||||
}
|
||||
@@ -1,2 +1,2 @@
|
||||
{"ts":"22:35","disk":"80%","ram":"36%","docker_dead":"1","ssl":"Certificate will not expire
|
||||
{"ts":"22:40","disk":"80%","ram":"36%","docker_dead":"1","ssl":"Certificate will not expire
|
||||
ok","models":"9","qdrant":"4","errors":"20"}
|
||||
|
||||
Reference in New Issue
Block a user