Repository navigation
Conversation
|
感谢本 PR 在插件安装事务性、回滚、路径穿越修复、下载预算和前端错误有界读取方面的改进,方向很好。合入前有两个回归需要修复。 基于提交: 阻塞 1:reload 接口丢失逐插件错误隔离
阻塞 2:服务重启的错误分类失效
建议合入前处理 3:zip 解压大小限制可被伪造
建议合入前处理 4:
|
…ll-failure-experience # Conflicts: # src/octop/api/routers/plugins.py
|
当前 CI 虽然全绿,但代码审查发现: 插件依赖安装可能在服务环境失败 requirements.txt 绕过了新增的参数校验 前端 404 / 503 判断出现回归 dashboard/src/utils/apiError.ts:59-64:部分 404 不再被识别为 Not Found。 requestUpload 超过 16 KiB 时直接抛普通 Error,丢失 request ID 和结构化错误:dashboard/src/api/request.ts:661-665。 |
|
PR 2176 最新修改把之前的问题基本修好了,但仍有一个 P2 回滚问题,建议修复后再合并。 强制更新已有插件时,如果旧目录因权限或文件占用而重命名失败,这里的操作尚未成功,异常回滚却会执行 建议区分「原本没有插件」与「旧插件尚未成功移动」,未发生修改时不要清理数据库;补一个挂载真实 |
Summary
Improve plugin installation error reporting and update reliability. Standard requests, uploads, and installation SSE preserve Octop's structured errors and translations. HTML and other non-JSON error responses show a concise HTTP status and request ID instead of the response body. Error reads are bounded to 16 KiB and 2 seconds, including the 503 setup probe.
Prepare downloads, extraction, and pip installation in background workers; keep plugin registration and runtime refresh on the event loop. Downloads have a 15-second socket timeout, a 120-second total budget, a 64 MiB archive limit, and a 256 MiB extraction limit. Serialize installation of the same plugin, reject conflicts before running pip, and wait for worker cleanup on cancellation. Failed forced updates restore the previous directory, modules, and registration. Disabled plugins remain disabled, and a failed directory rename preserves the existing registration.
Changes made by pip to the shared Python environment cannot be rolled back transactionally. Recovery in this PR covers plugin files, modules, and registration.
Target branch
Type of change
Test plan
developbaseline; no additional lint findings were introduced.Checklist
Before
After
The earlier workspace loss has now been reproduced safely: CLI cleanup tests replace Path.home() but inherit OCTOP_HOME, so clean --all --yes targets the real Octop data directory. A local audit guard blocked recursive deletion and captured its stack. Development, disposable test checkout, and source archives are kept separately. No deployment or production configuration changes were made.
CI repair: marketplace configuration persistence
Marketplace installs now persist the effective enabled state inside the existing installation transaction. Forced updates preserve disabled state. If configuration persistence fails, the old directory and plugin registration are restored. Added regressions cover preservation of unrelated settings and corrupt-config rollback for fresh installs and updates.
Current repair validation: