mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-09-01 16:48:31 +00:00
adjusted to support self-signed certificates on mqtt
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
FROM alpine:3.7
|
||||
|
||||
# Copy files
|
||||
ADD . /app
|
||||
RUN cp /app/data/configuration.yaml /app
|
||||
RUN cp /app/docker/run.sh /app
|
||||
RUN chmod +x /app/run.sh
|
||||
WORKDIR /app
|
||||
|
||||
# Write .hash.json
|
||||
ARG COMMIT
|
||||
RUN echo "{\"hash\": \"$COMMIT\"}" > .hash.json
|
||||
|
||||
# Install dependencies
|
||||
RUN apk add --update --no-cache make gcc g++ python linux-headers udev nodejs git && \
|
||||
npm install --unsafe-perm && \
|
||||
apk del make gcc g++ python linux-headers udev git
|
||||
|
||||
# Entrypoint
|
||||
ENTRYPOINT ["./run.sh"]
|
||||
@@ -13,6 +13,7 @@ mqtt:
|
||||
# MQTT server authentication, uncomment if required:
|
||||
# user: my_user
|
||||
# password: my_password
|
||||
# selfsigned: false
|
||||
|
||||
# Serial settings
|
||||
serial:
|
||||
|
||||
@@ -22,6 +22,11 @@ class MQTT {
|
||||
logger.debug(`Using MQTT client ID: '${mqttSettings.client_id}'`);
|
||||
options.clientId = mqttSettings.client_id;
|
||||
}
|
||||
|
||||
if (mqttSettings.selfsigned) {
|
||||
logger.debug(`Using Self Signed Cert. Ignoring warnings.`);
|
||||
options.rejectUnauthorized = false;
|
||||
}
|
||||
|
||||
this.client = mqtt.connect(mqttSettings.server, options);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user