防止 root CLI 破坏共享缓存权限 #684

Merged
chenxi merged 1 commits from fix/chenxi-storage-acl-batch-owner into main 2026-10-27 13:38:53 +08:00
Collaborator

问题

后台或临时 root Artisan 命令在共享 storage 卷生成 root 所属缓存子目录,导致 www-data 无法创建限流缓存,钉钉登录入口返回 500。

改动

  • 运行镜像安装 acl
  • 容器启动时为缓存、会话、视图、日志和 bootstrap 缓存设置 www-data 默认 ACL
  • 非 Apache 命令若由 root 启动,自动降权为 www-data 执行
  • 健康可写检查补充 cache/sessions

验证

  • WebProcessOwnershipTest
  • DingTalkLoginTest:35 passed / 240 assertions
  • 生产已临时修复属主,/auth/dingtalk 从 500 恢复为 302

风险

  • 仅调整容器进程权限和 ACL,不改变登录业务逻辑
## 问题 后台或临时 root Artisan 命令在共享 storage 卷生成 root 所属缓存子目录,导致 www-data 无法创建限流缓存,钉钉登录入口返回 500。 ## 改动 - 运行镜像安装 `acl` - 容器启动时为缓存、会话、视图、日志和 bootstrap 缓存设置 www-data 默认 ACL - 非 Apache 命令若由 root 启动,自动降权为 www-data 执行 - 健康可写检查补充 cache/sessions ## 验证 - WebProcessOwnershipTest - DingTalkLoginTest:35 passed / 240 assertions - 生产已临时修复属主,`/auth/dingtalk` 从 500 恢复为 302 ## 风险 - 仅调整容器进程权限和 ACL,不改变登录业务逻辑
chenxi added 1 commit 2026-10-27 13:38:42 +08:00
chenxi merged commit 1dec86d1d9 into main 2026-10-27 13:38:53 +08:00
chenxi deleted branch fix/chenxi-storage-acl-batch-owner 2026-10-27 13:38:53 +08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: WuYongJie/CaiWuXiTong#684
No description provided.