From bea370dca210dd28b5044df068526d87e0acba15 Mon Sep 17 00:00:00 2001 From: Saman Sajedi Date: Mon, 5 Oct 2026 17:02:00 +0330 Subject: [PATCH] port, acl - container listener port changed to 1883 and 8883 - acl file renamed to acl.conf --- visquitto/CHANGELOG.md | 4 ++++ visquitto/config.yaml | 2 +- visquitto/run.sh | 25 ++++++++++++++----------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/visquitto/CHANGELOG.md b/visquitto/CHANGELOG.md index 14817b4..0837474 100644 --- a/visquitto/CHANGELOG.md +++ b/visquitto/CHANGELOG.md @@ -24,3 +24,7 @@ ## 0.2.4 - Minor bug fix + +## 0.2.5 + +- Minor bug fix diff --git a/visquitto/config.yaml b/visquitto/config.yaml index 2798d39..d5cb4a9 100644 --- a/visquitto/config.yaml +++ b/visquitto/config.yaml @@ -1,5 +1,5 @@ name: Visquitto -version: "0.2.4" +version: "0.2.5" slug: visquitto description: Second private Mosquitto broker for bitopa nodes arch: diff --git a/visquitto/run.sh b/visquitto/run.sh index 66a7312..2e134e5 100644 --- a/visquitto/run.sh +++ b/visquitto/run.sh @@ -1,6 +1,9 @@ #!/bin/sh set -e +# every file the script creates is private from the start +umask 077 + CONFIG=/config SHARE=/share/visquitto PASSWD=/data/passwd @@ -33,16 +36,16 @@ password_file $PASSWD persistence true persistence_location /data/mosquitto/ -listener 1993 +listener 1883 -listener 9993 +listener 8883 cafile $CERTDIR/ca.pem certfile $CERTDIR/cert.pem keyfile $CERTDIR/key.pem tls_version tlsv1.2 EOF -cat > "$CONFIG/acl" < "$CONFIG/acl.conf" < "$SHARE/mosquitto.conf" fi -if [ ! -f "$SHARE/acl" ]; then - echo "acl_file /share/visquitto/accesscontrollist" > "$SHARE/acl" +if [ ! -f "$SHARE/acl.conf" ]; then + echo "acl_file /share/visquitto/accesscontrollist" > "$SHARE/acl.conf" fi if [ ! -f "$SHARE/accesscontrollist" ]; then @@ -67,9 +70,9 @@ if [ ! -f "$SHARE/accesscontrollist" ]; then EOF fi -chown mosquitto:mosquitto "$SHARE/mosquitto.conf" "$SHARE/acl" "$SHARE/accesscontrollist" \ - "$CONFIG/acl" "$CONFIG/accesscontrollist" -chmod 600 "$SHARE/acl" "$SHARE/accesscontrollist" "$CONFIG/acl" "$CONFIG/accesscontrollist" +chown mosquitto:mosquitto "$SHARE/mosquitto.conf" "$SHARE/acl.conf" "$SHARE/accesscontrollist" \ + "$CONFIG/acl.conf" "$CONFIG/accesscontrollist" +chmod 600 "$SHARE/acl.conf" "$SHARE/accesscontrollist" "$CONFIG/acl.conf" "$CONFIG/accesscontrollist" chmod 644 "$SHARE/mosquitto.conf" # ---- Users from the panel ---- @@ -89,10 +92,10 @@ cat "$CONFIG/mosquitto.conf" > "$FINAL" echo >> "$FINAL" cat "$SHARE/mosquitto.conf" >> "$FINAL" echo >> "$FINAL" -if grep -q '^[[:space:]]*acl_file' "$SHARE/acl"; then - cat "$SHARE/acl" >> "$FINAL" +if grep -q '^[[:space:]]*acl_file' "$SHARE/acl.conf"; then + cat "$SHARE/acl.conf" >> "$FINAL" else - cat "$CONFIG/acl" >> "$FINAL" + cat "$CONFIG/acl.conf" >> "$FINAL" fi exec mosquitto -c "$FINAL" \ No newline at end of file