Skip to content

Commit

Permalink
authenticated users only on MQTT
Browse files Browse the repository at this point in the history
  • Loading branch information
Arizbeth Rojas committed May 9, 2023
1 parent 79ce36a commit 24eeabd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docker/Dockerfile.mqtt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ENTRYPOINT ["/usr/sbin/mosquitto", "-v", "-c", "/etc/mosquitto/mosquitto.conf"]
#ENTRYPOINT ["/bin/sh"]

FROM eclipse-mosquitto
FROM alpine:3.17
LABEL maintainer = "Arizbeth Rojas <[email protected]>"
RUN apk update && apk add --no-cache certbot curl
RUN apk add --update curl mosquitto && rm -rf /var/cache/apk/*
Expand All @@ -17,6 +17,6 @@ EXPOSE 8883 443
#ENTRYPOINT ["/bin/sh", "$(cat /login_info_MQTT)"]
#ENTRYPOINT ["/bin/sh"]
COPY mqtt.sh .
RUN chmod +x /mqtt.sh
RUN chmod +x ./mqtt.sh
ENTRYPOINT ["./mqtt.sh"]

8 changes: 1 addition & 7 deletions docker/mqtt.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
#add-apt-repository ppa:certbot/certbot
#apt install certbot mosquitto mosquitto-clients
#!/bin/sh

apk add certbot
apk add certbot mosquitto mosquitto-clients
apk add nano
#these Ubuntu but should be in Alpine 1 and 2 how to install certbot in alpine linux, get dockerfile to build with certbot

#ufw allow 80
#expose these ports in the docker file
certbot certonly --standalone --preferred-challenges http -d mqtt-skyscan
#mosquitto_passwd -c /etc/mosquitto/passwd user
# /b lets us pass the username and password in the command line, replacing -c
mosquitto_passwd "$(cat /run/secrets/login_info_MQTT)"
nano /etc/mosquitto/conf.d/default.conf

Expand Down

0 comments on commit 24eeabd

Please sign in to comment.