Add debug option to mosquitto (#2477)

* Add debug option to mosquitto for issues

* Pass debug option to tempio and add translation

* log_type not 'log type'
This commit is contained in:
Mike Degatano
2022-05-10 13:24:05 -04:00
committed by GitHub
parent 972edc7abe
commit d133b38bba
6 changed files with 20 additions and 2 deletions

View File

@@ -1,5 +1,9 @@
# Changelog # Changelog
## 6.1.2
- Add debug option to help with issues
## 6.1.1 ## 6.1.1
- Don't purge openssl in cleanup - Don't purge openssl in cleanup

View File

@@ -80,6 +80,10 @@ A file containing the private key. Place this file in the Home Assistant `ssl` f
If set to `true` encryption will be enabled using the cert- and keyfile options. If set to `true` encryption will be enabled using the cert- and keyfile options.
### Option: `debug`
If set to `true` turns on debug logging for mosquitto and its auth plugin. This an help when tracking down an issue however running with this long term is not recommended as sensitive information will be logged.
## Home Assistant user management ## Home Assistant user management
This add-on is attached to the Home Assistant user system, so MQTT clients can make use of these credentials. Local users may also still be set independently within the configuration options for the add-on. For the internal Home Assistant ecosystem, we register `homeassistant` and `addons`, so these may not be used as user names. This add-on is attached to the Home Assistant user system, so MQTT clients can make use of these credentials. Local users may also still be set independently within the configuration options for the add-on. For the internal Home Assistant ecosystem, we register `homeassistant` and `addons`, so these may not be used as user names.

View File

@@ -1,5 +1,5 @@
--- ---
version: 6.1.1 version: 6.1.2
slug: mosquitto slug: mosquitto
name: Mosquitto broker name: Mosquitto broker
description: An Open Source MQTT broker description: An Open Source MQTT broker
@@ -42,6 +42,7 @@ schema:
customize: customize:
active: bool active: bool
folder: str folder: str
debug: bool?
services: services:
- mqtt:provide - mqtt:provide
startup: system startup: system

View File

@@ -79,6 +79,7 @@ bashio::var.json \
keyfile "${keyfile}" \ keyfile "${keyfile}" \
require_certificate "^$(bashio::config 'require_certificate')" \ require_certificate "^$(bashio::config 'require_certificate')" \
ssl "^${ssl}" \ ssl "^${ssl}" \
debug "^$(bashio::config 'debug')" \
| tempio \ | tempio \
-template /usr/share/tempio/mosquitto.gtpl \ -template /usr/share/tempio/mosquitto.gtpl \
-out /etc/mosquitto/mosquitto.conf -out /etc/mosquitto/mosquitto.conf

View File

@@ -1,10 +1,14 @@
protocol mqtt protocol mqtt
user root user root
log_dest stdout log_dest stdout
{{ if .debug }}
log_type all
{{ else }}
log_type error log_type error
log_type warning log_type warning
log_type notice log_type notice
log_type information log_type information
{{ end }}
persistence true persistence true
persistence_location /data/ persistence_location /data/
@@ -17,7 +21,7 @@ auth_opt_auth_cache_seconds 300
auth_opt_auth_jitter_seconds 30 auth_opt_auth_jitter_seconds 30
auth_opt_acl_cache_seconds 300 auth_opt_acl_cache_seconds 300
auth_opt_acl_jitter_seconds 30 auth_opt_acl_jitter_seconds 30
auth_opt_log_level error auth_opt_log_level {{ if .debug }}debug{{ else }}error{{ end }}
# HTTP backend for the authentication plugin # HTTP backend for the authentication plugin
auth_opt_files_password_path /etc/mosquitto/pw auth_opt_files_password_path /etc/mosquitto/pw

View File

@@ -29,6 +29,10 @@ configuration:
name: Customize name: Customize
description: >- description: >-
See the Documentation tab for more information about these options. See the Documentation tab for more information about these options.
debug:
name: Debug
description: >-
If enabled will turn on debug logging for mosquitto and the auth plugin.
network: network:
1883/tcp: Normal MQTT 1883/tcp: Normal MQTT
1884/tcp: MQTT over WebSocket 1884/tcp: MQTT over WebSocket