test: add mosquitto ACL file and mount it; grant testuser readwrite on lambdaiot topic
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
# ACL for testuser — allow publish and subscribe on 'lambdaiot' topic
|
||||||
|
user testuser
|
||||||
|
topic readwrite lambdaiot
|
||||||
|
topic readwrite lambdaiot/#
|
||||||
@@ -30,6 +30,7 @@ services:
|
|||||||
- mosquitto_data:/mosquitto/data
|
- mosquitto_data:/mosquitto/data
|
||||||
- mosquitto_log:/mosquitto/log
|
- mosquitto_log:/mosquitto/log
|
||||||
- ./mosquitto.conf:/mosquitto/config/mosquitto.conf
|
- ./mosquitto.conf:/mosquitto/config/mosquitto.conf
|
||||||
|
- ./aclfile:/mosquitto/data/aclfile:ro
|
||||||
environment:
|
environment:
|
||||||
- MOSQ_USER=testuser
|
- MOSQ_USER=testuser
|
||||||
- MOSQ_PASS=testpass
|
- MOSQ_PASS=testpass
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ listener 1883 0.0.0.0
|
|||||||
allow_anonymous false
|
allow_anonymous false
|
||||||
# place password file in the data volume (writable)
|
# place password file in the data volume (writable)
|
||||||
password_file /mosquitto/data/passwordfile
|
password_file /mosquitto/data/passwordfile
|
||||||
|
# ACL file controls topic permissions
|
||||||
|
acl_file /mosquitto/data/aclfile
|
||||||
# Increase persistence location so container can map volume if needed
|
# Increase persistence location so container can map volume if needed
|
||||||
persistence true
|
persistence true
|
||||||
persistence_location /mosquitto/data/
|
persistence_location /mosquitto/data/
|
||||||
|
|||||||
Reference in New Issue
Block a user