Session/agent 5ee51bcf 331f 494c b320 fb172fd1c1a9 - #2951
Conversation
This commit addresses several issues related to unsafe type assertions, unhandled errors, and potential nil pointer dereferences across multiple modules. Key changes include: - **Drivers**: Added robust error checking for PEM decoding, RSA key parsing, and type assertions in `189`, `189pc`, `cloudreve_v4`, `google_drive`, `halalcloud`, `netease_music`, and `thunder` related drivers. - **Internal**: Updated `WebAuthnCredentials` to return an error instead of silently failing or printing to stdout, and updated callers to handle this error. - **FTP Server**: Implemented safe type assertions for `model.User` from context and added permission checks to prevent nil pointer dereferences. Added a timeout to the error channel wait in `FileUploadProxy`. - **WebDAV Server**: Added safe context value retrieval for `model.User` and improved error handling for storage retrieval and path joining. - **Utils**: Improved error propagation in `CopyDir`. Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Add configuration files and documentation for deploying to Railway, including a dedicated Dockerfile, ignore files, and a setup guide. Update entrypoint.sh to handle dynamic PORT mapping provided by Railway and ensure the data directory is initialized. Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Add documentation for using `GITHUB_TOKEN` to prevent API rate limits during frontend downloads and increase the healthcheck timeout in `railway.toml` to allow more time for service readiness. Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
|
如果跨多个组件,请使用主要组件作为前缀,并在标题中枚举、描述中说明。 如果是破坏性变更,请在类型后添加 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a5a8d409b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -0,0 +1,16 @@ | |||
| .git/ | |||
There was a problem hiding this comment.
Keep Git metadata available to the Docker build
Removing .git from the build context makes both Dockerfile and Dockerfile.railway fail at RUN bash build.sh release docker: build.sh runs under set -e and line 5 unconditionally executes gitCommit=$(git log ... -1), which exits 128 when the copied source has no .git directory. Preserve the metadata or make the build script tolerate its absence.
Useful? React with 👍 / 👎.
| if f.trunc { | ||
| _ = fs.Remove(f.ctx, f.path) | ||
| if err := fs.Remove(f.ctx, f.path); err != nil { | ||
| return err |
There was a problem hiding this comment.
Release the upload stage when target deletion fails
For an unknown-length FTP upload opened with O_TRUNC, this error path occurs after MakeStage has inserted the path and returned a borrowed temp file. If removing an existing target fails, returning here leaves that stage and file open, so subsequent uploads to the same path are rejected as an already-uploading file until restart. Delete before creating the stage or explicitly close/drop the borrowed stage on this path.
Useful? React with 👍 / 👎.
| RUN addgroup -g ${GID} ${USER} && \ | ||
| adduser -D -u ${UID} -G ${USER} ${USER} && \ | ||
| mkdir -p /opt/openlist/data && \ |
There was a problem hiding this comment.
Grant the runtime user ownership of the data directory
The directory is created by root with the default 0755 ownership and is never chowned before the image switches to USER openlist. On startup, entrypoint.sh explicitly checks that ./data is writable and exits with status 1 when it is not, so the Railway image cannot start without an externally mounted volume that happens to supply compatible ownership. Create or chown the directory as ${UID}:${GID}.
Useful? React with 👍 / 👎.
Summary / 摘要
/ 此 PR 包含破坏性变更。
/ 此 PR 修改了公开 API、配置、存储格式或迁移行为。
/ 此 PR 需要关联仓库同步修改。
Related repository PRs / 关联仓库 PR:
Related Issues / 关联 Issue
Testing / 测试
go test ./...Checklist / 检查清单
/ 我已阅读 CONTRIBUTING。
/ 我确认此贡献符合仓库许可证、贡献规范和行为准则。
gofmt,go fmt, orprettierwhere applicable./ 我已按适用情况使用
gofmt、go fmt或prettier格式化变更代码。/ 我已在适用情况下请求相关维护者或代码所有者审查。
AI Disclosure / AI 使用声明
/ 此 PR 包含 AI 辅助内容。
Tools used / 使用工具:
Usage scope / 使用范围:
Code generation / 代码生成
Refactoring / 重构
Documentation / 文档
Tests / 测试
Translation / 翻译
Review assistance / 审查辅助
I have reviewed and validated all AI-assisted content included in this PR.
/ 我已审核并验证此 PR 中的所有 AI 辅助内容。
I have ensured that all AI-assisted commits include
Co-Authored-Byattribution./ 我已确保所有 AI 辅助提交都包含
Co-Authored-By归属信息。I can reproduce all AI-assisted content included in this PR without any AI tools.
/ 我可以在没有任何 AI 工具的情况下重现此 PR 中包含的所有 AI 辅助内容。