feat(cli): 支持安全的单文件上传 / support safe single-file upload - #486
Open
Jinghao-coding wants to merge 2 commits into
Open
feat(cli): 支持安全的单文件上传 / support safe single-file upload#486Jinghao-coding wants to merge 2 commits into
Jinghao-coding wants to merge 2 commits into
Conversation
Jinghao-coding
force-pushed
the
codex/issue-480-file-upload
branch
from
July 28, 2026 14:44
ef64f1d to
e6e3f86
Compare
Jinghao-coding
force-pushed
the
codex/issue-480-file-upload
branch
from
July 30, 2026 07:27
e6e3f86 to
051bfd7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
中文
变更内容
crater file upload <local-file> <remote-path>,支持文本和二进制文件流式上传,不把完整文件读入内存。--overwrite才允许替换已有普通文件。POST /api/ss/upload/*path安全端点:完整写入、chmod、sync和关闭后再原子发布;上传失败不会暴露半文件或截断旧文件。os.Root与目录 FD 相对的linkat/renameat限制存储边界,并覆盖符号链接逃逸、父目录重命名和暂存目录替换竞态。--json元数据、中英文 i18n、帮助/本地与远端路径补全、文档、CLI Skill、单元测试和快照。验证
201、未授权覆盖409/40901、显式覆盖200,以及最终内容和0644权限。说明:CLI 不会回退到旧 WebDAV
PUT;旧 storage service 会安全返回 404。后续修复提交还清理了全量 lint 报告的重复路径段常量,make lint现已完整通过。Closes #480
English
Changes
crater file upload <local-file> <remote-path>with streaming text and binary uploads and no whole-file buffering.--overwritefor an existing regular file.POST /api/ss/upload/*pathendpoint. The server fully writes, chmods, syncs, and closes a staged file before atomic publication, so failures neither expose partial files nor truncate the old target.os.Rootand directory-FD-relativelinkat/renameat, with regressions for symlink escape, parent rename, and staging-name replacement races.Verification
201, unauthorized replacement409/40901, explicit overwrite200, final bytes, and0644mode.Note: the CLI never falls back to legacy WebDAV
PUT; an older storage service fails closed with 404. The follow-up fix also removes the repeated path-segment literal reported by full lint, andmake lintnow passes completely.Closes #480