Skip to content

Commit ef220ac

Browse files
committed
fix(mosquitto): Fix healthcheck
1 parent bf01df1 commit ef220ac

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

.env.example

-2
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,3 @@ HOMEPAGE_VAR_WEATHER_UNIT=metric
4747
IMMICH_DB_PASSWORD=postgres
4848
CALIBRE_USERNAME=admin
4949
CALIBRE_PASSWORD=admin123
50-
MOSQUITTO_USERNAME=
51-
MOSQUITTO_PASSWORD=

homeassistant/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ Set the `HOMEASSISTANT_ACCESS_TOKEN` for homepage support.
2525

2626
If you need to use MQTT, you can enable it by setting `COMPOSE_PROFILES=homeassistant,mqtt`.
2727

28-
In the root `.env`, fill `MOSQUITTO_USERNAME` and `MOSQUITTO_PASSWORD` with the credentials you want to use.
29-
3028
Start the container, create a user in mosquitto with the following command and the credentials defined previously:
3129

3230
`docker compose exec mosquitto mosquitto_passwd -b /mosquitto/config/pwfile <username> <password>`

homeassistant/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ services:
4949
ports:
5050
- "1883:1883"
5151
healthcheck:
52-
test: [ "CMD", "mosquitto_sub", "-u", "$${MOSQUITTO_USERNAME}", "-P", "$${MOSQUITTO_PASSWORD}", "-h", "localhost", "-t", "$$SYS/broker/uptime", "-i", "docker_health_check", "-C", "1" ]
52+
test: [ "CMD", "mosquitto_sub", "-p", "1880", "-t", "$$SYS/#", "-C", "1", "-i", "healthcheck", "-W", "3" ]
5353
interval: 1m
5454
timeout: 10s
5555
retries: 3

homeassistant/mosquitto/config/mosquitto.conf

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ allow_anonymous false
66

77
log_dest file /mosquitto/log/mosquitto.log
88

9-
listener 1883
9+
listener 1883
10+
11+
listener 1880 127.0.0.1
12+
allow_anonymous true

0 commit comments

Comments
 (0)