minor change in mosquitto config
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
name: Visquitto
|
||||
version: "0.5.2"
|
||||
version: "0.5.3"
|
||||
slug: visquitto
|
||||
description: Second private Mosquitto broker for bitopa nodes
|
||||
url: "https://gitea.viratak.com/bitopa/virarepo/src/branch/main/visquitto"
|
||||
|
||||
+7
-5
@@ -34,9 +34,6 @@ chmod 600 "$CERTDIR/key.pem"
|
||||
|
||||
# ---- Defaults in /config (regenerated at every start) ----
|
||||
cat > "$CONFIG/mosquitto.conf" <<EOF
|
||||
protocol mqtt
|
||||
allow_anonymous false
|
||||
|
||||
log_dest stdout
|
||||
log_type error
|
||||
log_type warning
|
||||
@@ -55,6 +52,7 @@ include_dir $SHARE
|
||||
# Plain listener (host port 1993): password users only
|
||||
listener 1883
|
||||
protocol mqtt
|
||||
allow_anonymous false
|
||||
plugin_use password_file
|
||||
plugin_opt_password_file $PASSWD
|
||||
plugin_use acl_file
|
||||
@@ -63,6 +61,7 @@ plugin_opt_acl_file $DATA/acl_plain
|
||||
# TLS listener (host port 9993): client certificate required
|
||||
listener 8883
|
||||
protocol mqtt
|
||||
allow_anonymous false
|
||||
cafile $CERTDIR/ca.pem
|
||||
certfile $CERTDIR/cert.pem
|
||||
keyfile $CERTDIR/key.pem
|
||||
@@ -76,7 +75,6 @@ plugin_opt_acl_file $DATA/acl_tls
|
||||
EOF
|
||||
|
||||
# plain ACL
|
||||
echo "# Default ACL for the plain listener: no rules, all access denied" > "$CONFIG/acl_plain"
|
||||
cat > "$CONFIG/acl_plain" <<EOF
|
||||
# ============================================================
|
||||
# Not certified devices
|
||||
@@ -100,13 +98,17 @@ topic read cert/enroll/+/renew
|
||||
EOF
|
||||
|
||||
# TLS ACL
|
||||
echo "# Default ACL for the TLS listener: no rules, all access denied" > "$CONFIG/acl_tls"
|
||||
cat > "$CONFIG/acl_tls" <<EOF
|
||||
# Default rule for every certificate client. %u is the certificate CN.
|
||||
pattern readwrite clients/%u/#
|
||||
EOF
|
||||
|
||||
# ---- User customization in /share (created once, never overwritten) ----
|
||||
if grep -qE '^\s*(listener|port|bind_address)\b' "$SHARE/mosquitto.conf"; then
|
||||
echo "ERROR: $SHARE/mosquitto.conf must not define listeners (listener/port/bind_address)." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$SHARE/mosquitto.conf" ]; then
|
||||
echo "# Extra global Mosquitto options (loaded with include_dir, before the listeners)" > "$SHARE/mosquitto.conf"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user