mosquitto-with-auth/mosquitto.conf-sample

31 lines
796 B
Plaintext
Raw Normal View History

2019-06-13 12:47:38 +02:00
log_dest stdout
2019-06-13 17:21:40 +02:00
persistence true
persistence_location /opt/data/
2019-06-13 12:47:38 +02:00
listener 1883
protocol mqtt
#allow_anonymous true
allow_anonymous false
2022-09-14 12:30:02 +02:00
listener 8883
protocol mqtt
#allow_anonymous true
allow_anonymous false
2022-09-14 13:25:11 +02:00
certfile /opt/etc/mosquitto/server.crt
keyfile /opt/etc/mosquitto/server.key
2022-09-14 12:30:02 +02:00
dhparamfile /opt/etc/mosquitto/dh.pem
tls_version tlsv1.2
2019-06-13 12:47:38 +02:00
auth_plugin /opt/lib/go-auth.so
auth_opt_log_dest stdout
auth_opt_log_level debug
auth_opt_backends mysql
auth_opt_mysql_host mariadb
auth_opt_mysql_port 3306
auth_opt_mysql_dbname mosquittoauth
auth_opt_mysql_user mosquittoauth
auth_opt_mysql_password xxx
auth_opt_mysql_allow_native_passwords true
auth_opt_mysql_userquery SELECT pw FROM users WHERE username = ?
auth_opt_mysql_aclquery SELECT topic FROM acls WHERE username = ? AND (rw & ?) != 0