Repository navigation
marilib: add MARI_MQTT_INSECURE and survive a failed broker connect - #177
Merged
Merged
Conversation
Breaking: mari-edge and mari-cloud read MARI_MQTT_USER / MARI_MQTT_PASS instead of DOTBOT_MQTT_USER / DOTBOT_MQTT_PASS. The edge connects from the serial reader thread, so a refused TLS handshake (an expired broker certificate) killed the thread and left the gateway unread; the failure is now printed and paho keeps retrying in the background. AI-assisted: Claude Opus 5
AI-assisted: Claude Opus 5
AI-assisted: Claude Opus 5
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mari-edgeconnects to the broker from the serial reader thread, on the first GATEWAY_INFO. When the TLS handshake fails, for example against a broker whose certificate has expired, the exception killed that thread: the gateway was never read again while the display kept running as if nothing was wrong. There was also no way to skip certificate verification for a bench session.Now:
MARI_MQTT_INSECURE=1.MARI_MQTT_INSECURE=1(1/true/yes/on) makes the TLS context skip certificate and hostname verification, with a warning. Otherwise marilib passes paho's verifying default, unchanged.MARI_MQTT_USER/MARI_MQTT_PASS, instead of a subscribe printed as if it had worked.mari-edge,mari-cloudandexamples/mari_edge_stats.pyshare onemqtt_options_from_env()instead of three copies of the credentials helper.Breaking: the credentials are read from
MARI_MQTT_USER/MARI_MQTT_PASSinstead ofDOTBOT_MQTT_USER/DOTBOT_MQTT_PASS, so marilib stops depending on another project's variable names. Programs that passusername/passwordtoMQTTAdapter.from_urlexplicitly are unaffected; anyone runningmari-edgeormari-cloudby hand against an authenticated broker must export the new names.Validation: marilib suite passes (75 tests, 15 new cases for the env parsing, the TLS contexts and an unreachable broker not raising, and a refused CONNACK);
ruff checkclean. Live against a broker with an expired certificate: without the variable the reason and hint are printed and nothing raises; withMARI_MQTT_INSECURE=1it connects and subscribes. Not yet run with a gateway attached.