From 6379f788d88fff3c9f615fec804ff1f97fb675a3 Mon Sep 17 00:00:00 2001 From: deploy Date: Fri, 17 Jul 2026 00:10:43 +0100 Subject: [PATCH] esp: remover VPS Alemanha das paginas + fix mqtt.php - esp_proxmox.php: fora os botoes switch V/P (fica indicador P read-only), o link "Ver VPS" e os syncs p/ web.xpto em approve/block (brokers ESP da Alemanha foram desativados; frota so no Proxmox) - painel.php: remove cartao "ESP VPS" - api/mqtt.php: publicava p/ 127.0.0.1:1883 que nao existe -- passa a publicar por TLS no broker CT106 (mqtt.xupas.mywire.org:8883); a pagina OTA volta a funcionar - .gitignore: ota/ (binarios fw + manifest, como no repo da VPS) Co-Authored-By: Claude Fable 5 --- .gitignore | 1 + api/mqtt.php | 4 +++- esp_proxmox.php | 15 ++------------- painel.php | 5 ----- 4 files changed, 6 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 30ecb68..a1ab293 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ vendor/ *.sqlite-shm *.sqlite-wal +ota/ diff --git a/api/mqtt.php b/api/mqtt.php index f75f5e1..227b88a 100644 --- a/api/mqtt.php +++ b/api/mqtt.php @@ -2,8 +2,10 @@ declare(strict_types=1); function mqtt_publish(string $topic, string $msg): void { + // broker Proxmox (CT106) por TLS; 127.0.0.1:1883 era de um mosquitto + // local que já não existe (corrigido 2026-07-16) $cmd = sprintf( - 'mosquitto_pub -h 127.0.0.1 -p 1883 -t %s -m %s', + 'mosquitto_pub -h mqtt.xupas.mywire.org -p 8883 --capath /etc/ssl/certs -u xupa -P xupa -t %s -m %s', escapeshellarg($topic), escapeshellarg($msg) ); diff --git a/esp_proxmox.php b/esp_proxmox.php index e1ac479..722d868 100644 --- a/esp_proxmox.php +++ b/esp_proxmox.php @@ -66,17 +66,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { [PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION]); if ($action === 'approve') { $pdo->prepare("UPDATE contadores SET blocked=0 WHERE uid=?")->execute([$uid]); - // sincronizar na VPS - $vps = ['http'=>['method'=>'POST','header'=>'Content-Type: application/x-www-form-urlencoded', - 'content'=>http_build_query(['action'=>'approve','uid'=>$uid]),'timeout'=>4]]; - @file_get_contents('https://web.xpto.ooguy.com/esp_api.php?key=esp_api_xupas_2025', false, stream_context_create($vps)); $msg = "[$uid] aprovado OK"; $msgOk = true; } elseif ($action === 'block') { $pdo->prepare("UPDATE contadores SET blocked=1,online=0 WHERE uid=?")->execute([$uid]); - // sincronizar na VPS - $vps = ['http'=>['method'=>'POST','header'=>'Content-Type: application/x-www-form-urlencoded', - 'content'=>http_build_query(['action'=>'block','uid'=>$uid]),'timeout'=>4]]; - @file_get_contents('https://web.xpto.ooguy.com/esp_api.php?key=esp_api_xupas_2025', false, stream_context_create($vps)); $msg = "[$uid] bloqueado OK"; $msgOk = true; } elseif ($action === 'delete') { // CT106 api.py: envia DELETE_CERT via MQTT + apaga CT106 SQLite + apaga VPS SQLite @@ -111,7 +103,6 @@ ob_start();

ESP Devices Proxmox broker

- ← Ver VPS @@ -205,10 +196,8 @@ ob_start(); - V - P + P diff --git a/painel.php b/painel.php index 20f528e..b74423f 100644 --- a/painel.php +++ b/painel.php @@ -25,11 +25,6 @@ ob_start();
OTA
Firmware updates
- -
📡
-
ESP VPS
-
Dispositivos VPS
-