Skip to content

Commit f8b4175

Browse files
committed
Mosquitto 2.x incompatible with default IOTstack config file
References: * [Mosquitto doc](https://mosquitto.org/documentation/migrating-to-2-0/) * [Workaround](SensorsIot#265) * [IOTstack new menu breaks Mosquitto configs](SensorsIot#258 (comment)) * [Pull Request on gcgarner/IOTstack](gcgarner#228) Mosquitto 2.x has introduced a requirement for a `listener` in the config file. If this is absent, Mosquitto will bind to the loopback interface. When Mosquitto is running in a container, this implies no connectivity. Mosquitto 2.x has also changed the security defaults. Earlier versions permitted passwordless access out-of-the box. The new version assumes a password scheme will be implemented and requires passwordless access to be an explicit configuration choice. This PR maintains the IOTstack status quo by: 1. Adding `listener 1883`; and 2. Activating `allow_anonymous` with the value `true`. Anyone who has already set up a password scheme will need to import the `listener` line but, presumably, their `allow_anonymous` will already be active and set to `false`, and that will not need to change.
1 parent 63a54aa commit f8b4175

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.templates/mosquitto/mosquitto.conf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
# required by https://mosquitto.org/documentation/migrating-to-2-0/
2+
listener 1883
3+
14
persistence true
25
persistence_location /mosquitto/data/
36
#log_dest file /mosquitto/log/mosquitto.log
47
# To avoid flash wearing
58
log_dest stdout
69

7-
#Uncomment to enable passwords
10+
# To enable passwords:
11+
# 1. Uncomment "password_file"; and
12+
# 2. Change "allow_anonymous" to "false"
813
#password_file /mosquitto/pwfile/pwfile
9-
#allow_anonymous false
14+
allow_anonymous true
1015

1116
#Uncomment to enable filters
1217
#acl_file /mosquitto/config/filter.acl

0 commit comments

Comments
 (0)