party-lock: fix ACL file permissions (0700, owner 1883)
Mosquitto 2.1.2 silently skips ACL file if world-readable or wrong owner. Listener now sets proper permissions on ACL file writes. Add CYD lock flash feedback on blocked tap.
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
# ///
|
# ///
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import stat
|
||||||
|
|
||||||
import paho.mqtt.client as mqtt
|
import paho.mqtt.client as mqtt
|
||||||
|
|
||||||
@@ -22,6 +23,8 @@ def rebuild_acl():
|
|||||||
lines.append("topic readwrite #")
|
lines.append("topic readwrite #")
|
||||||
with open(ACL_PATH, "w") as f:
|
with open(ACL_PATH, "w") as f:
|
||||||
f.write("\n".join(lines) + "\n")
|
f.write("\n".join(lines) + "\n")
|
||||||
|
os.chmod(ACL_PATH, stat.S_IRWXU)
|
||||||
|
os.chown(ACL_PATH, 1883, 1883)
|
||||||
os.system("docker kill -s HUP mosquitto 2>/dev/null || true")
|
os.system("docker kill -s HUP mosquitto 2>/dev/null || true")
|
||||||
|
|
||||||
def on_message(client, userdata, msg):
|
def on_message(client, userdata, msg):
|
||||||
|
|||||||
Reference in New Issue
Block a user