Skip to content

Commit

Permalink
mosquitto local mount and docs for adding users
Browse files Browse the repository at this point in the history
  • Loading branch information
maaikelimper committed Jan 7, 2025
1 parent 55b180d commit 1d1eac6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ services:
env_file:
- wis2box.env
volumes:
- mosquitto-config:/mosquitto/config
- ${WIS2BOX_HOST_DATADIR}/mosquitto:/mosquitto/config

wis2box-management:
container_name: wis2box-management
Expand Down
27 changes: 26 additions & 1 deletion docs/source/user/public-services-setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,32 @@ The broker address for the Global Broker to subscribe to WIS2 notifications usin
- `ws://everyone:everyone@WIS2BOX_HOST/mqtt:80` - for MQTT over websockets without SSL
- `wss://everyone:everyone@WIS2BOX_HOST/mqtt:443` - for MQTT over websockets with SSL

Where ``WIS2BOX_HOST`` is the hostname or IP address of the host running wis2box.
Where ``WIS2BOX_HOST`` is the hostname or IP address of the host running wis2box.

.. note::

The Global Broker will use the ``everyone`` user to subscribe to the internal MQTT broker on wis2box.

If you want to create additional users for the internal MQTT broker, you can do so by logging into the mosquitto container and using the ``mosquitto_passwd`` command:

.. code-block:: bash
docker exec -it mosquitto /bin/sh
Then, to add a new user, use the following command:

.. code-block:: bash
mosquitto_passwd -b /mosquitto/config/password.txt <username> <password>
After adding a new user, you can edit the file ``/mosquitto/config/acl.conf`` to add or change access rights for mosquitto users.

For example to allow a user to publish to the topic ``wis2box/cap/publication``, you would add the following line to the ``acl.conf`` file:

.. code-block:: bash
user <username>
topic readwrite wis2box/cap/publication
External broker
---------------
Expand Down

0 comments on commit 1d1eac6

Please sign in to comment.