adjusted to support self-signed certificates on mqtt

This commit is contained in:
Ryan Holt
2018-08-17 12:15:44 -04:00
parent 7dd1c75be0
commit 9ee0049248
3 changed files with 26 additions and 0 deletions
+20
View File
@@ -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"]
+1
View File
@@ -13,6 +13,7 @@ mqtt:
# MQTT server authentication, uncomment if required:
# user: my_user
# password: my_password
# selfsigned: false
# Serial settings
serial:
+5
View File
@@ -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);