mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-18 13:44:20 +01:00
Fix mqtt pw generator (#601)
* Fix mqtt pw generator * Update run.sh * Update config.json
This commit is contained in:
@@ -8,9 +8,9 @@ ENV LANG C.UTF-8
|
|||||||
WORKDIR /usr/src
|
WORKDIR /usr/src
|
||||||
ARG MOSQUITTO_AUTH_VERSION
|
ARG MOSQUITTO_AUTH_VERSION
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
mosquitto curl libressl musl socat \
|
mosquitto curl openssl musl socat pwgen \
|
||||||
&& apk add --no-cache --virtual .build-dependencies \
|
&& 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 \
|
&& git clone --depth 1 https://github.com/jpmens/mosquitto-auth-plug \
|
||||||
&& cd mosquitto-auth-plug \
|
&& cd mosquitto-auth-plug \
|
||||||
&& cp config.mk.in config.mk \
|
&& cp config.mk.in config.mk \
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Mosquitto broker",
|
"name": "Mosquitto broker",
|
||||||
"version": "4.2",
|
"version": "4.3",
|
||||||
"slug": "mosquitto",
|
"slug": "mosquitto",
|
||||||
"description": "An Open Source MQTT broker",
|
"description": "An Open Source MQTT broker",
|
||||||
"url": "https://home-assistant.io/addons/mosquitto/",
|
"url": "https://home-assistant.io/addons/mosquitto/",
|
||||||
|
|||||||
@@ -28,10 +28,6 @@ certfile /ssl/$CERTFILE
|
|||||||
keyfile /ssl/$KEYFILE
|
keyfile /ssl/$KEYFILE
|
||||||
"
|
"
|
||||||
|
|
||||||
function create_password() {
|
|
||||||
strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c32
|
|
||||||
}
|
|
||||||
|
|
||||||
function write_system_users() {
|
function write_system_users() {
|
||||||
(
|
(
|
||||||
echo "{\"homeassistant\": {\"password\": \"$HOMEASSISTANT_PW\"}, \"addons\": {\"password\": \"$ADDONS_PW\"}}"
|
echo "{\"homeassistant\": {\"password\": \"$HOMEASSISTANT_PW\"}, \"addons\": {\"password\": \"$ADDONS_PW\"}}"
|
||||||
@@ -111,8 +107,8 @@ fi
|
|||||||
|
|
||||||
# Prepare System Accounts
|
# Prepare System Accounts
|
||||||
if [ ! -e "${SYSTEM_USER}" ]; then
|
if [ ! -e "${SYSTEM_USER}" ]; then
|
||||||
HOMEASSISTANT_PW="$(create_password)"
|
HOMEASSISTANT_PW="$(pwgen 64 1)"
|
||||||
ADDONS_PW="$(create_password)"
|
ADDONS_PW="$(pwgen 64 1)"
|
||||||
|
|
||||||
echo "[INFO] Initialize system configuration."
|
echo "[INFO] Initialize system configuration."
|
||||||
write_system_users
|
write_system_users
|
||||||
|
|||||||
Reference in New Issue
Block a user