package/mosquitto: add options for password and ACL plugin

Until version 2.0.x, support for using static password or ACL files, was
builtin to the broker. With version 2.1.x, two new plugins have been
introduced to replace the builtin support, which is now deprecated and
will get removed in the next version.

Add two new configuration options for those plugins.

We decided to do a single commit, rather than one per option, because
they are relatively tied together (ACL needs passwords, at least).

We also choose to make those options enabled by default, because the
traditional way to configure mosquitto is to use static files for
authentication and authorization, and the builtin support if now
deprecated in favour for the plugins.

The usual ifeq-else-endif conditional block is a bit verbose when just
setting an option ON or OFF, when no additional dependency is needed.
Instead, use the not-unusual $(if)-inline one-liner. For consistency,
switch the existing dynamic-security plugin to use that one-liner too.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Titouan Christophe <titouan.christophe@mind.be>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
This commit is contained in:
Yann E. MORIN
2026-02-26 16:54:01 +01:00
committed by Romain Naour
parent 989214ae3d
commit ccc048c78f
2 changed files with 18 additions and 9 deletions

View File

@@ -88,6 +88,20 @@ config BR2_PACKAGE_MOSQUITTO_BROKER_HTTP_API
Add support for simple webserver as a listener to serve
some of the HTTP API.
config BR2_PACKAGE_MOSQUITTO_BROKER_PLUGIN_STATIC_PASSWD
bool "static password file plugin"
default y
help
Add support for authentication based on static files. using
a plugin rather than the legacy builtin support.
config BR2_PACKAGE_MOSQUITTO_BROKER_PLUGIN_STATIC_ACL
bool "static ACL file plugin"
default y
help
Add support for authorization (ACL) based on static files,
using a plugin rather than the legacy builtin support.
config BR2_PACKAGE_MOSQUITTO_BROKER_DYNAMIC_SECURITY_PLUGIN
bool "dynamic security plugin"
select BR2_PACKAGE_OPENSSL

View File

@@ -88,11 +88,12 @@ MOSQUITTO_CONF_OPTS += \
-DCMAKE_INSTALL_SYSCONFDIR=/etc \
-DWITH_BROKER=ON \
-DWITH_PLUGINS=ON \
-DWITH_PLUGIN_ACL_FILE=ON \
-DWITH_PLUGIN_PASSWORD_FILE=ON \
-DWITH_PLUGIN_EXAMPLES=OFF \
-DWITH_PLUGIN_PERSIST_SQLITE=OFF \
-DWITH_PLUGIN_SPARKPLUG_AWARE=OFF
-DWITH_PLUGIN_SPARKPLUG_AWARE=OFF \
-DWITH_PLUGIN_PASSWORD_FILE=$(if $(BR2_PACKAGE_MOSQUITTO_BROKER_PLUGIN_STATIC_PASSWD),ON,OFF) \
-DWITH_PLUGIN_ACL_FILE=$(if $(BR2_PACKAGE_MOSQUITTO_BROKER_PLUGIN_STATIC_ACL),ON,OFF) \
-DWITH_PLUGIN_DYNAMIC_SECURITY=$(if $(BR2_PACKAGE_MOSQUITTO_BROKER_DYNAMIC_SECURITY_PLUGIN),ON,OFF)
ifeq ($(BR2_PACKAGE_MOSQUITTO_BROKER_HTTP_API),y)
MOSQUITTO_DEPENDENCIES += libmicrohttpd
@@ -101,12 +102,6 @@ else
MOSQUITTO_CONF_OPTS += -DWITH_HTTP_API=OFF
endif
ifeq ($(BR2_PACKAGE_MOSQUITTO_BROKER_DYNAMIC_SECURITY_PLUGIN),y)
MOSQUITTO_CONF_OPTS += -DWITH_PLUGIN_DYNAMIC_SECURITY=ON
else
MOSQUITTO_CONF_OPTS += -DWITH_PLUGIN_DYNAMIC_SECURITY=OFF
endif
ifeq ($(BR2_PACKAGE_SYSTEMD),y)
MOSQUITTO_DEPENDENCIES += systemd
MOSQUITTO_CONF_OPTS += -DWITH_SYSTEMD=ON