minor bug fix

This commit is contained in:
2026-10-05 14:35:24 +03:30
parent 2bfe130d3b
commit 25f3a40402
3 changed files with 17 additions and 1 deletions
+12
View File
@@ -13,10 +13,20 @@ CAFILE=$(jq -r '.cafile' /data/options.json)
CERTFILE=$(jq -r '.certfile' /data/options.json)
KEYFILE=$(jq -r '.keyfile' /data/options.json)
CERTDIR=/data/certs
mkdir -p "$CERTDIR"
for f in "$CAFILE" "$CERTFILE" "$KEYFILE"; do
[ -f "/ssl/$f" ] || { echo "Missing /ssl/$f" >&2; exit 1; }
done
cp "/ssl/$CAFILE" "$CERTDIR/ca.pem"
cp "/ssl/$CERTFILE" "$CERTDIR/cert.pem"
cp "/ssl/$KEYFILE" "$CERTDIR/key.pem"
chown -R mosquitto:mosquitto "$CERTDIR"
chmod 644 "$CERTDIR/ca.pem" "$CERTDIR/cert.pem"
chmod 600 "$CERTDIR/key.pem"
# ---- Defaults in /config (regenerated at every start) ----
cat > "$CONFIG/mosquitto.conf" <<EOF
@@ -68,6 +78,8 @@ fi
chown mosquitto:mosquitto "$SHARE/mosquitto.conf" "$SHARE/acl" "$SHARE/accesscontrollist"
chown mosquitto:mosquitto "$CONFIG/acl" "$CONFIG/accesscontrollist"
chmod 600 "$SHARE/accesscontrollist" "$SHARE/acl" "$CONFIG/accesscontrollist" "$CONFIG/acl"
chmod 644 "$SHARE/mosquitto.conf"
# ---- Users from the panel ----