Setup of Eclipse Mosquitto (MQTT) on Synology is very easy but in order to get credentials for users working, we need a bit different approach by using OpenSSL version of Eclipse MQTT.
In this video I'll go through basic installation of MQTT in Docker (works for Synology but also other systems) and I'll show you have to add user credentials to secure your setup.
In order to better enhance security of your system, check this link here:
⏵ https://github.com/zeridon/homeassist...
Eclipse Mosquitto 2.0 release notes:
⏵ https://mosquitto.org/blog/2020/12/ve...
00:00 Intro
00:28 Thank you to channel members
00:41 Why new MQTT video
02:07 Connect using terminal
02:45 Create folders for MQTT
03:31 Creating initial config file
07:34 Docker run command (also in video description)
10:44 Verify everything is working
11:03 Configuring username and password for MQTT access
11:34 Use Synology Docker UI to configure
12:13 Use Portainer to configure
12:53 Creating file with credentials
14:33 Killed! error when using mosquitto_passwd
14:56 Adding via mosquitto_passwd command
15:49 Adding new users via CLI
17:01 Activating credentials
17:30 Wrapping up the video
Code:
⏵ Docker install command
__________
sudo docker run --name=mqtt -itd --restart=always --net=host -v /volume1/docker/mqtt/config:/mosquitto/config -v /volume1/docker/mqtt/data:/mosquitto/data -v /volume1/docker/mqtt/log:/mosquitto/log -v /volume1/docker/mqtt/config/mosquitto.conf:/mosquitto/config/mosquitto.conf eclipse-mosquitto:openssl
__________
⏵ sample mosquitto.conf
__________
persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log
#password_file /mosquitto/config/pwfile
allow_anonymous true
listener 1883 192.168.1.202
__________
Commands for credentials:
⏵ mosquitto_passwd -U FILENAME - to parse file with credentials
⏵ mosquitto_passwd -c FILENAME USERNAME - to create file (filename) and add user (username) to it
⏵ mosquitto_passwd -b FILENAME USERNAME PASSWORD - to add to existing file (filename) new user (username) with password.
Please, give me a thumb up if you liked this video, subscribe if you still haven't and I'll see you next time!
Have fun!
BeardedTinker
P.S. If you would like to support me and this channel, you can JOIN and become member!
https://www.youtube.com/BeardedTinker...
Twitter: @BeardedTinker
Discord: / discord
#howto #HomeAssistant #mqtt