port, acl

- container listener port changed to 1883 and 8883
- acl file renamed to acl.conf
This commit is contained in:
2026-10-05 17:02:00 +03:30
parent 7772e489e0
commit bea370dca2
3 changed files with 19 additions and 12 deletions
+4
View File
@@ -24,3 +24,7 @@
## 0.2.4 ## 0.2.4
- Minor bug fix - Minor bug fix
## 0.2.5
- Minor bug fix
+1 -1
View File
@@ -1,5 +1,5 @@
name: Visquitto name: Visquitto
version: "0.2.4" version: "0.2.5"
slug: visquitto slug: visquitto
description: Second private Mosquitto broker for bitopa nodes description: Second private Mosquitto broker for bitopa nodes
arch: arch:
+14 -11
View File
@@ -1,6 +1,9 @@
#!/bin/sh #!/bin/sh
set -e set -e
# every file the script creates is private from the start
umask 077
CONFIG=/config CONFIG=/config
SHARE=/share/visquitto SHARE=/share/visquitto
PASSWD=/data/passwd PASSWD=/data/passwd
@@ -33,16 +36,16 @@ password_file $PASSWD
persistence true persistence true
persistence_location /data/mosquitto/ persistence_location /data/mosquitto/
listener 1993 listener 1883
listener 9993 listener 8883
cafile $CERTDIR/ca.pem cafile $CERTDIR/ca.pem
certfile $CERTDIR/cert.pem certfile $CERTDIR/cert.pem
keyfile $CERTDIR/key.pem keyfile $CERTDIR/key.pem
tls_version tlsv1.2 tls_version tlsv1.2
EOF EOF
cat > "$CONFIG/acl" <<EOF cat > "$CONFIG/acl.conf" <<EOF
acl_file $CONFIG/accesscontrollist acl_file $CONFIG/accesscontrollist
EOF EOF
@@ -55,8 +58,8 @@ if [ ! -f "$SHARE/mosquitto.conf" ]; then
echo "# Extra Mosquitto options, appended to the default config" > "$SHARE/mosquitto.conf" echo "# Extra Mosquitto options, appended to the default config" > "$SHARE/mosquitto.conf"
fi fi
if [ ! -f "$SHARE/acl" ]; then if [ ! -f "$SHARE/acl.conf" ]; then
echo "acl_file /share/visquitto/accesscontrollist" > "$SHARE/acl" echo "acl_file /share/visquitto/accesscontrollist" > "$SHARE/acl.conf"
fi fi
if [ ! -f "$SHARE/accesscontrollist" ]; then if [ ! -f "$SHARE/accesscontrollist" ]; then
@@ -67,9 +70,9 @@ if [ ! -f "$SHARE/accesscontrollist" ]; then
EOF EOF
fi fi
chown mosquitto:mosquitto "$SHARE/mosquitto.conf" "$SHARE/acl" "$SHARE/accesscontrollist" \ chown mosquitto:mosquitto "$SHARE/mosquitto.conf" "$SHARE/acl.conf" "$SHARE/accesscontrollist" \
"$CONFIG/acl" "$CONFIG/accesscontrollist" "$CONFIG/acl.conf" "$CONFIG/accesscontrollist"
chmod 600 "$SHARE/acl" "$SHARE/accesscontrollist" "$CONFIG/acl" "$CONFIG/accesscontrollist" chmod 600 "$SHARE/acl.conf" "$SHARE/accesscontrollist" "$CONFIG/acl.conf" "$CONFIG/accesscontrollist"
chmod 644 "$SHARE/mosquitto.conf" chmod 644 "$SHARE/mosquitto.conf"
# ---- Users from the panel ---- # ---- Users from the panel ----
@@ -89,10 +92,10 @@ cat "$CONFIG/mosquitto.conf" > "$FINAL"
echo >> "$FINAL" echo >> "$FINAL"
cat "$SHARE/mosquitto.conf" >> "$FINAL" cat "$SHARE/mosquitto.conf" >> "$FINAL"
echo >> "$FINAL" echo >> "$FINAL"
if grep -q '^[[:space:]]*acl_file' "$SHARE/acl"; then if grep -q '^[[:space:]]*acl_file' "$SHARE/acl.conf"; then
cat "$SHARE/acl" >> "$FINAL" cat "$SHARE/acl.conf" >> "$FINAL"
else else
cat "$CONFIG/acl" >> "$FINAL" cat "$CONFIG/acl.conf" >> "$FINAL"
fi fi
exec mosquitto -c "$FINAL" exec mosquitto -c "$FINAL"