安全加固:MQTT broker 新增可选连接认证(bcrypt 用户+匿名开关+按 IP 失败限速,配置明文密码首启自动转哈希,默认关闭零影响),py 迁移脚本数据库口令改环境变量(新增 db_config.example.py 模板),新增 doc/SECURITY_FIX_TODO.md 安全修复清单,后端 v1.3.0

This commit is contained in:
2026-08-20 16:51:33 +08:00
parent fbd105bd6c
commit fe0cf036cf
11 changed files with 925 additions and 18 deletions
+10
View File
@@ -69,6 +69,16 @@ if [[ ! -f "${CONFIG_DIR}/config.yaml" ]]; then
mqtt:
host: 0.0.0.0
port: 1883
# MQTT 连接认证:enabled 改为 true 后,客户端必须携带 users 中的账号连接
# (或 allow_anonymous: true 放行匿名)。生成哈希:
# htpasswd -bnBC 10 "" '你的密码' | tr -d ':\n'
auth:
enabled: false
allow_anonymous: false
users: []
# users:
# - username: mesh
# password_hash: "\$2y\$10\$..."
tls:
enabled: false
cert_file: ""