Repository navigation
feat(broker): car-only MQTT user on a login-only listener (#1962) - #1963
Merged
Merged
Conversation
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.
Refs #1962
A car-only MQTT user, checked by the broker, on a new login-only listener.
What changes
config/mosquitto/broker.conf:per_listener_settings true. Port 1883 stays anonymous. New port 1884 needs a login and usesconfig/mosquitto/car.acl.config/mosquitto/car.acl: userioniqmay read and write onlyioniq/parsed/#,ioniq/raw/#,ioniq/log,ioniq/status, and only readhomy/ioniq/journeys,homy/ioniq/road_check,homy/ioniq/home. Nothing else.docker/mosquitto/entrypoint.sh: copies the deployed password file to a place the broker owns. If the file is missing, it makes an empty one, so the broker still starts.docker-compose.yml: publishes 1884, mountscar.acland the folder${SECRETS_PATH}/mosquitto(read-only)..github/scripts/test-mqtt-car-user/run.sh+ workflowtest-mqtt-car-user.yml.docs/mqtt-car-user.md(password file, how to add the user).Choices and why
ioniq/..., nothomy/ioniq/.... The car app publishesioniq/parsed/<group>,ioniq/raw/<group>,ioniq/log, and its will/status topicioniq/status. It subscribes to nothing today. Its user name is alreadyioniq. So the ACL gives write on exactly those four (notioniq/#:ioniq/derived/#comes from the automations, and the car must not fake it). Where the issue says "underhomy/ioniq/" and "nothing outsidehomy/ioniq/", read: the car's real topics above, plus read-only on ev-journal's. ev-journal's topics underhomy/ioniq/are read-only for the car, and everything else is closed.use_username_as_clientid trueon 1884: client ids are shared by both listeners, so a 1884 user could otherwise take a 1883 client's id and push it off.Progress
homy/ioniq/journeysandhomy/ioniq/road_check, cannot publish tohomy/ioniq/journeys, cannot read or write outside its topics; a client without a login cannot use 1884. Also: the broker starts without a password file.