# 2026-06-02 Windows/Ubuntu 字符与换行审计 ## 日期 2026-06-02 ## 变更摘要 完成 Windows 开发机 ↔ Ubuntu 生产部署的字符/换行/路径审计;修复工作区内 14 个 CRLF `.sh`;新增部署前 LF 门控。 ## 动机 项目在 Windows 上开发、部署到 Ubuntu。CRLF 脚本会导致 `\r: command not found`;反斜杠路径与错误编码会破坏 SSH/文件 API。需可重复检查,避免再次泄漏 CRLF。 ## 涉及文件 - `docs/audit/2026-06-02-windows-ubuntu-encoding-audit.md` — 审计报告(Closure + DoD) - `deploy/check_shell_eol.sh` — 检查 git 跟踪的 `*.sh` 是否含 CR - `deploy/pre_deploy_check.sh` — Pre-flight 调用 EOL 检查 - 14 个 `deploy/*.sh`、`scripts/wsl_*.sh`、`web/agent/agent.sh` — CRLF→LF ## 迁移 / 重启 - 无数据库迁移 - 仅当服务器上的脚本曾被 Windows 直接编辑并带 CRLF 时,需在服务器 `git pull` 后无需额外步骤(随仓库更新) ## 验证方式 ```bash bash deploy/check_shell_eol.sh # 预期: check_shell_eol: OK bash deploy/pre_deploy_check.sh # Pre-flight: Shell EOL (LF) ... PASS ``` 开发机建议:`git config core.autocrlf false`