Skip to content

Make the topic configurable #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM grafana/promtail:2.5.0

RUN apt-get update && apt-get install -y dumb-init mosquitto-clients vim
RUN echo "deb [allow-insecure=yes] http://ppa.launchpad.net/mosquitto-dev/mosquitto-ppa/ubuntu focal main" > /etc/apt/sources.list.d/mosquitto-dev-ubuntu-mosquitto-ppa-focal.list
RUN apt-get update && apt-get install --allow-unauthenticated --no-install-recommends -y dumb-init mosquitto-clients vim

RUN mkdir /mqtt-logger

Expand Down
10 changes: 9 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
mosquitto_sub -h $MQTT_LOGGER_MQTT_HOSTNAME -p $MQTT_LOGGER_MQTT_PORT -u $MQTT_LOGGER_MQTT_USERNAME -P $MQTT_LOGGER_MQTT_PASSWORD -F %j -t '+/debug' -t 'homeassistant/#' | promtail --stdin --config.expand-env=true --config.file=/mqtt-logger/config.yaml
mosquitto_sub \
-h $MQTT_LOGGER_MQTT_HOSTNAME \
-p $MQTT_LOGGER_MQTT_PORT \
-u $MQTT_LOGGER_MQTT_USERNAME \
-P $MQTT_LOGGER_MQTT_PASSWORD \
--capath /etc/ssl/certs/ \
-F %j \
-t ${MQTT_LOGGER_MQTT_TOPIC:-homeassistant/#} \
| promtail --stdin --config.expand-env=true --config.file=/mqtt-logger/config.yaml