From d794a32247ad1f48cd261b3af5863ecc39b446e7 Mon Sep 17 00:00:00 2001 From: Sthope Date: Sat, 23 Apr 2022 22:03:08 +0200 Subject: [PATCH] first commit --- docs/portainer-stacks/MQTT-Mosquitto.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/portainer-stacks/MQTT-Mosquitto.md b/docs/portainer-stacks/MQTT-Mosquitto.md index e57085e..dff6ffe 100644 --- a/docs/portainer-stacks/MQTT-Mosquitto.md +++ b/docs/portainer-stacks/MQTT-Mosquitto.md @@ -22,4 +22,26 @@ services: - 1883:1883 labels: - com.centurylinklabs.watchtower.enable=true -``` \ No newline at end of file +``` + +Mosquitto configuration file `/mosquitto/config/mosquitto.conf`: +``` +listener 1883 + +persistence true +persistence_location /mosquitto/data/ + +log_dest file /mosquitto/log/mosquitto.log +log_dest stdout +log_type all + +allow_anonymous false +password_file /mosquitto/config/passwd +``` + +Create empty file `/mosquitto/config/passwd` +And from the terminal create user sending: +```docker exec -it mqtt usr/bin/mosquitto_passwd -c /mosquitto/config/passwd USERNAME``` + +And if you want to add more users use: +```docker exec -it mqtt usr/bin/mosquitto_passwd -b /mosquitto/config/passwd NEW_USERNAME PASSWORD```