www/api/mqtt.php
deploy 6379f788d8 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 <noreply@anthropic.com>
2026-07-17 00:10:43 +01:00

14 lines
477 B
PHP

<?php
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 mqtt.xupas.mywire.org -p 8883 --capath /etc/ssl/certs -u xupa -P xupa -t %s -m %s',
escapeshellarg($topic),
escapeshellarg($msg)
);
shell_exec($cmd . " > /dev/null 2>&1");
}