mosquitto: Collection of small improvements (#910)

* mosquitto: Prettier YAML & JSON files

* mosquitto: Sort build.json

* mosquitto: Update add-on URL

* mosquitto: Code styling on Dockerfile

* mosquitto: Tweaks documentation
This commit is contained in:
Franck Nijhof
2019-12-19 13:17:35 +01:00
committed by Pascal Vizeli
parent bf051c1b2d
commit e1ad9ae2ac
5 changed files with 49 additions and 39 deletions

View File

@@ -5,15 +5,27 @@ FROM $BUILD_FROM
WORKDIR /usr/src
ARG MOSQUITTO_AUTH_VERSION
RUN apk add --no-cache \
mosquitto curl openssl musl socat pwgen \
curl \
mosquitto \
musl \
openssl \
pwgen \
socat \
&& apk add --no-cache --virtual .build-dependencies \
build-base git mosquitto-dev curl-dev openssl-dev \
&& git clone --depth 1 -b ${MOSQUITTO_AUTH_VERSION} https://github.com/pvizeli/mosquitto-auth-plug \
build-base \
curl-dev \
git \
mosquitto-dev \
openssl-dev \
\
&& git clone --depth 1 -b "${MOSQUITTO_AUTH_VERSION}" \
https://github.com/pvizeli/mosquitto-auth-plug \
&& cd mosquitto-auth-plug \
&& cp config.mk.in config.mk \
&& make \
&& mkdir -p /usr/share/mosquitto \
&& cp -f auth-plug.so /usr/share/mosquitto \
\
&& apk del .build-dependencies \
&& rm -fr /usr/src/mosquitto-auth-plug

View File

@@ -10,7 +10,7 @@ You can use this add-on to install Eclipse Mosquitto, which is an open-source (E
## Installation
The installation of this add-on is straightforward and easy to do.
Follow these steps to get the add-on installed on your system:
1. Navigate in your Home Assistant frontend to **Hass.io** -> **Add-on Store**.
2. Find the "Mosquitto broker" add-on and click it.
@@ -24,7 +24,8 @@ The add-on has a couple of options available. To get the add-on running:
2. Have some patience and wait a couple of minutes.
3. Check the add-on log output to see the result.
Create a new user for MQTT via the **Configuration** -> **Users (manage users)**. (Note: This name cannot be "homeassistant" or "addon")
Create a new user for MQTT via the **Configuration** -> **Users (manage users)**.
Note: This name cannot be `homeassistant` or `addon`, those are reserved usernames.
To use the Mosquitto as a broker, go to the integration page and install the configuration with one click:
@@ -102,38 +103,38 @@ It is possible to restrict access to topics based upon the user logged in to Mos
See the following links for more information:
* [Mosquitto topic restrictions](http://www.steves-internet-guide.com/topic-restriction-mosquitto-configuration/)
* [Mosquitto.conf man page](https://mosquitto.org/man/mosquitto-conf-5.html)
- [Mosquitto topic restrictions](http://www.steves-internet-guide.com/topic-restriction-mosquitto-configuration/)
- [Mosquitto.conf man page](https://mosquitto.org/man/mosquitto-conf-5.html)
Add the following configuration to enable **unrestricted** access to all topics.
1. Enable the customize flag
```json
"customize": {
"active": true,
"folder": "mosquitto"
},
```
```json
"customize": {
"active": true,
"folder": "mosquitto"
},
```
2. Create `/share/mosquitto/acl.conf` with the contents:
```text
acl_file /share/mosquitto/accesscontrollist
```
```text
acl_file /share/mosquitto/accesscontrollist
```
3. Create `/share/mosquitto/accesscontrollist` with the contents:
```text
user [YOUR_MQTT_USER]
topic readwrite #
```
```text
user [YOUR_MQTT_USER]
topic readwrite #
```
The `/share` folder can be accessed via SMB, or on the host filesystem under `/usr/share/hassio/share`.
## Known issues and limitations
* Since version 4.1 of the add-on, an explicit ACL definition is now required if you plan to use legacy logins and `"anonymous": true` [see these instructions](#access-control-lists-acls).
- Since version 4.1 of the add-on, an explicit ACL definition is now required if you plan to use legacy logins and `"anonymous": true` [see these instructions](#access-control-lists-acls).
## Support
@@ -141,9 +142,9 @@ Got questions?
You have several options to get them answered:
* The [Home Assistant Discord Chat Server][discord].
* The Home Assistant [Community Forum][forum].
* Join the [Reddit subreddit][reddit] in [/r/homeassistant][reddit]
- The [Home Assistant Discord Chat Server][discord].
- The Home Assistant [Community Forum][forum].
- Join the [Reddit subreddit][reddit] in [/r/homeassistant][reddit]
In case you've found a bug, please [open an issue on our GitHub][issue].

View File

@@ -3,20 +3,19 @@
trigger:
branches:
include:
- master
- master
paths:
include:
- mosquitto/*
- mosquitto/*
pr: none
variables:
- name: versionBuilder
value: '2.0'
value: "2.0"
- group: docker
jobs:
- template: /.azure/azp-template-addon.yml
parameters:
addon: 'mosquitto'
arch: '--all'
- template: /.azure/azp-template-addon.yml
parameters:
addon: "mosquitto"
arch: "--all"

View File

@@ -1,10 +1,10 @@
{
"build_from": {
"aarch64": "homeassistant/aarch64-base:3.10",
"amd64": "homeassistant/amd64-base:3.10",
"i386": "homeassistant/i386-base:3.10",
"armhf": "homeassistant/armhf-base:3.10",
"armv7": "homeassistant/armv7-base:3.10",
"aarch64": "homeassistant/aarch64-base:3.10"
"i386": "homeassistant/i386-base:3.10"
},
"args": {
"MOSQUITTO_AUTH_VERSION": "0.1.4"

View File

@@ -3,7 +3,7 @@
"version": "5.1",
"slug": "mosquitto",
"description": "An Open Source MQTT broker",
"url": "https://home-assistant.io/addons/mosquitto/",
"url": "https://github.com/home-assistant/hassio-addons/tree/master/mosquitto",
"arch": ["armhf", "armv7", "aarch64", "amd64", "i386"],
"startup": "system",
"boot": "auto",
@@ -16,7 +16,7 @@
"1884/tcp": 1884,
"8883/tcp": 8883,
"8884/tcp": 8884
},
},
"options": {
"logins": [],
"anonymous": false,
@@ -29,9 +29,7 @@
"require_certificate": false
},
"schema": {
"logins": [
{"username": "str", "password": "str"}
],
"logins": [{ "username": "str", "password": "str" }],
"anonymous": "bool",
"customize": {
"active": "bool",