File tree Expand file tree Collapse file tree 3 files changed +31
-10
lines changed Expand file tree Collapse file tree 3 files changed +31
-10
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ # should not run as root
4
+ [ " $EUID " -eq 0 ] && echo " This script should NOT be run using sudo" && exit -1
5
+
6
+ # expects to run from IOTstack
7
+ [ $( basename " $PWD " ) = " IOTstack" ] || echo -e \
8
+ " Warning: This script expects to be run from ~/IOTstack.\n" \
9
+ " The script will continue but may produce unexpected results."
10
+
3
11
[ -d ./volumes/mosquitto ] || sudo mkdir -p ./volumes/mosquitto
4
12
5
13
# check user 1883
Original file line number Diff line number Diff line change 1
1
# required by https://mosquitto.org/documentation/migrating-to-2-0/
2
+ #
2
3
listener 1883
3
4
5
+ # persistence enabled for remembering retain flag across restarts
6
+ #
4
7
persistence true
5
- persistence_location /mosquitto/data/
8
+ persistence_location /mosquitto/data
9
+
10
+ # logging options:
11
+ # enable one of the following (stdout = less wear on SD cards but
12
+ # logs do not persist across restarts)
6
13
#log_dest file /mosquitto/log/mosquitto.log
7
- # To avoid flash wearing
8
14
log_dest stdout
15
+ log_timestamp_format %Y-%m-%dT%H:%M:%S
9
16
10
- # To enable passwords:
11
- # 1. Uncomment "password_file"; and
12
- # 2. Change "allow_anonymous" to "false"
17
+ # password handling:
18
+ # password_file commented-out allow_anonymous true =
19
+ # open access
20
+ # password_file commented-out allow_anonymous false =
21
+ # no access
22
+ # password_file activated allow_anonymous true =
23
+ # passwords omitted is permitted but
24
+ # passwords provided must match pwfile
25
+ # password_file activated allow_anonymous false =
26
+ # no access without passwords
27
+ # passwords provided must match pwfile
28
+ #
13
29
#password_file /mosquitto/pwfile/pwfile
14
30
allow_anonymous true
15
31
16
- #Uncomment to enable filters
32
+ # Uncomment to enable filters
17
33
#acl_file /mosquitto/config/filter.acl
18
-
19
- log_timestamp_format %Y-%m-%dT%H:%M:%S
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ mosquitto:
9
9
- ./volumes/mosquitto/data:/mosquitto/data
10
10
- ./volumes/mosquitto/log:/mosquitto/log
11
11
- ./volumes/mosquitto/pwfile:/mosquitto/pwfile
12
- - ./services/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf
13
- - ./services/mosquitto/filter.acl:/mosquitto/config/filter.acl
12
+ - ./services/mosquitto:/mosquitto/config:ro
14
13
networks :
15
14
- iotstack_nw
You can’t perform that action at this time.
0 commit comments