-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Complete v2.3.0 roadmap - S3 storage, dashboard enhancements, documentation #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Copilot
wants to merge
5
commits into
main
Choose a base branch
from
copilot/add-s3-storage-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
de4c782
Initial plan
Copilot 5fbdaaa
Complete S3 storage implementation with express and recycleFiles methods
Copilot 5f0afb5
Improve dashboard with refresh button, better polling, error handling…
Copilot 032a52a
Restructure and enhance documentation with detailed setup and configu…
Copilot 3ae64b4
Fix async/await issues in S3 storage and adjust dashboard polling int…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,12 @@ | |
| "storage.error.s3.write_file.size_mismatch": "无法校验 S3 储存文件 ${file} 的大小。理论值:${file_size},实际值:${actual_file_size}。", | ||
| "storage.error.s3.write_file.retry": "在尝试写入 S3 储存文件 ${file} 时遇到错误:${e},将在 ${retry}s 后重试。", | ||
| "storage.error.s3.write_file.failed": "无法写入 S3 储存文件 ${file},已达到最高重试次数。", | ||
| "storage.error.s3.get_s3_files": "无法获取 S3 储存文件列表:${e}。", | ||
| "storage.error.s3.express": "无法从 S3 储存获取文件 ${hash}:${e}。", | ||
| "storage.error.s3.recycle.list": "无法列出 S3 储存文件进行回收:${e}。", | ||
| "storage.error.s3.recycle": "无法回收 S3 储存文件:${e}。", | ||
| "storage.success.s3.recycled": "成功回收了 ${size} 的 S3 储存文件。", | ||
| "storage.success.s3.no_need_to_recycle": "当前 S3 储存无需要回收的文件。", | ||
| "i18n.prompt.failed": "(i18n 字符串解析失败)", | ||
| "cluster.info.filelist.fetching": "正在获取文件列表……", | ||
| "cluster.success.filelist.fetched": "成功获取文件列表!", | ||
|
|
||
Oops, something went wrong.
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.
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Copilot Autofix
AI 3 months ago
In general, to fix information exposure via exceptions you should log detailed exception data on the server side and return only generic, non-sensitive error messages to clients. Avoid including
str(e), stack traces, or other internal state directly in responses.For this concrete case in
core/storages/s3.py, the best fix is to replaceweb.HTTPError(text=str(e))with generic error responses. We can keep the existing logging calls (logger.terror(...)) so that developers still have full diagnostic information, but change what is returned to the client:ClientErrorwhere the code is not"404", we can respond with a 502 or 500-level error with a generic message such as"Failed to access storage backend"or a localized equivalent.Exceptionhandler, respond with a generic 500 error (e.g.,web.HTTPInternalServerError) and a minimal message.We already import
localefromcore.i18n; following existing patterns in the project, we can use it to obtain a localized generic error message key like"storage.error.s3.express". The only lines that need modification are 145 and 148 (the tworeturn web.HTTPError(text=str(e))statements). No new imports or helper methods are required.