https://gitlab.synchro.net/main/sbbs/-/commit/6fa50f05fd33485fa399a6d1
Modified Files:
src/sbbs3/mqtt.cpp src/sbbs3/scfg/scfgnet.c
Log Message:
mqtt: start internal broker only when broker_addr matches local hostname
Previously, enabling "Internal Broker" in SCFG forced broker_addr to
127.0.0.1 and always started the in-process broker. Now the address is configurable and compared against the local hostname (startup->host_name
from the INI, falling back to gethostname()). localhost, 127.0.0.1, and
::1 are always treated as local.
When the address doesn't match, the server falls through to the normal
TCP client path, connecting to the remote broker with whatever TLS mode
is configured. This allows multi-host BBS setups where one instance runs
the internal broker and the others connect to it over the network.
SCFG now shows and allows editing Broker Address in internal broker mode,
and only defaults to "localhost" when the field is empty.
Note: MQTT still borrows whichever startup struct happens to be passed
in by the calling server Ä there is no mqtt_startup_t of its own. This
means host_name resolution depends on the caller, and the lputs callback
has to be threaded through from whoever called mqtt_startup() rather
than being a first-class member of the MQTT config. A dedicated startup
struct would clean up both of these and avoid the gethostname() fallback.
Co-Authored-By: Claude Opus 4.6 (1M context) <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net