Fix mqtt pw generator (#601)

* Fix mqtt pw generator

* Update run.sh

* Update config.json
This commit is contained in:
Pascal Vizeli
2019-06-04 08:38:31 +02:00
committed by GitHub
parent 0dfd9e075e
commit e998e6b6df
3 changed files with 5 additions and 9 deletions

View File

@@ -8,9 +8,9 @@ ENV LANG C.UTF-8
WORKDIR /usr/src
ARG MOSQUITTO_AUTH_VERSION
RUN apk add --no-cache \
mosquitto curl libressl musl socat \
mosquitto curl openssl musl socat pwgen \
&& apk add --no-cache --virtual .build-dependencies \
gcc make git mosquitto-dev curl-dev libressl-dev musl-dev \
build-base git mosquitto-dev curl-dev openssl-dev \
&& git clone --depth 1 https://github.com/jpmens/mosquitto-auth-plug \
&& cd mosquitto-auth-plug \
&& cp config.mk.in config.mk \

View File

@@ -1,6 +1,6 @@
{
"name": "Mosquitto broker",
"version": "4.2",
"version": "4.3",
"slug": "mosquitto",
"description": "An Open Source MQTT broker",
"url": "https://home-assistant.io/addons/mosquitto/",

View File

@@ -28,10 +28,6 @@ certfile /ssl/$CERTFILE
keyfile /ssl/$KEYFILE
"
function create_password() {
strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c32
}
function write_system_users() {
(
echo "{\"homeassistant\": {\"password\": \"$HOMEASSISTANT_PW\"}, \"addons\": {\"password\": \"$ADDONS_PW\"}}"
@@ -111,8 +107,8 @@ fi
# Prepare System Accounts
if [ ! -e "${SYSTEM_USER}" ]; then
HOMEASSISTANT_PW="$(create_password)"
ADDONS_PW="$(create_password)"
HOMEASSISTANT_PW="$(pwgen 64 1)"
ADDONS_PW="$(pwgen 64 1)"
echo "[INFO] Initialize system configuration."
write_system_users