Skip to content
Merged
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
8 changes: 8 additions & 0 deletions .templates/mosquitto/directoryfix.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/bin/bash

# should not run as root
[ "$EUID" -eq 0 ] && echo "This script should NOT be run using sudo" && exit -1

# expects to run from IOTstack
[ $(basename "$PWD") = "IOTstack" ] || echo -e \
"Warning: This script expects to be run from ~/IOTstack.\n" \
" The script will continue but may produce unexpected results."

[ -d ./volumes/mosquitto ] || sudo mkdir -p ./volumes/mosquitto

#check user 1883
Expand Down
30 changes: 22 additions & 8 deletions .templates/mosquitto/mosquitto.conf
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
# required by https://mosquitto.org/documentation/migrating-to-2-0/
#
listener 1883

# persistence enabled for remembering retain flag across restarts
#
persistence true
persistence_location /mosquitto/data/
persistence_location /mosquitto/data

# logging options:
# enable one of the following (stdout = less wear on SD cards but
# logs do not persist across restarts)
#log_dest file /mosquitto/log/mosquitto.log
# To avoid flash wearing
log_dest stdout
log_timestamp_format %Y-%m-%dT%H:%M:%S

# To enable passwords:
# 1. Uncomment "password_file"; and
# 2. Change "allow_anonymous" to "false"
# password handling:
# password_file commented-out allow_anonymous true =
# open access
# password_file commented-out allow_anonymous false =
# no access
# password_file activated allow_anonymous true =
# passwords omitted is permitted but
# passwords provided must match pwfile
# password_file activated allow_anonymous false =
# no access without passwords
# passwords provided must match pwfile
#
#password_file /mosquitto/pwfile/pwfile
allow_anonymous true

#Uncomment to enable filters
# Uncomment to enable filters
#acl_file /mosquitto/config/filter.acl

log_timestamp_format %Y-%m-%dT%H:%M:%S
3 changes: 1 addition & 2 deletions .templates/mosquitto/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ mosquitto:
- ./volumes/mosquitto/data:/mosquitto/data
- ./volumes/mosquitto/log:/mosquitto/log
- ./volumes/mosquitto/pwfile:/mosquitto/pwfile
- ./services/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf
- ./services/mosquitto/filter.acl:/mosquitto/config/filter.acl
- ./services/mosquitto:/mosquitto/config:ro
networks:
- iotstack_nw