Files
Nexus/docs/changelog/2026-06-01-files-phase5-hardening.md
T

1.1 KiB
Raw Blame History

Changelog — 文件管理 Phase 5 加固

内容
日期 2026-06-01
类型 加固 / 测试

摘要

完成设计文档 Phase 5ls -la 解析抽到 unix_ls.py 并补单测;browse 优先 --time-style=long-isoread-fileexec_ssh_command_with_fallbackremote_write_bytes 尊重 files_elevationoff 不 sudo、always 跳过 SFTP 直走 sudo tee)。

动机

统一可测的列表解析、可排序的 ISO 时间、只读文件在 root 属主下可读,并与服务器提权策略一致。

涉及文件

  • server/utils/unix_ls.py
  • server/api/sync_v2.pybrowse、read-file、write-file、upload
  • server/infrastructure/ssh/asyncssh_pool.py
  • tests/test_file_permissions.py(新建)
  • tests/test_unix_ls.py
  • docs/audit/2026-06-01-posix-path-batch-review.md

迁移 / 重启

  • 无 DB 变更;需重启后端;前端无必改项(时间列展示 ISO 字符串更易排序)。

验证

pytest tests/test_file_permissions.py tests/test_unix_ls.py tests/test_files_elevation.py -q
ruff check server/utils/unix_ls.py server/infrastructure/ssh/asyncssh_pool.py