fix(download): 文件版加固(路径白名单/tokio 写盘/缩略图预热/临时清理/开关保留)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m8s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m8s
This commit is contained in:
1 parent
df3e99b0ee
commit
9f8fb273d1
11 files changed
+84
-16
No files matched your search
@@ -36,6 +36,9 @@ ok(read('src/image-display-thumb.js').indexOf('^https?:') >= 0 && read('src/imag
|
||||
ok(/async function wRustFetchBlob \(url\)/.test(app), '宿主提供统一 Rust 取字节入口 wRustFetchBlob')
|
||||
ok(/wRustFetchBlob\(fkEarly\)/.test(app) && /wRustFetchBlob\(su\)/.test(app), 'storeOutputThumb / downloadUrl 走系统网络栈兜底')
|
||||
ok(/desktopFetch: async \(u\) => \{ const b = await wRustFetchBlob/.test(app), 'gallery-sync desktopFetch 走 Rust(不再用白名单 http.fetch)')
|
||||
ok(/path-outside-base/.test(read('src-tauri/src/lib.rs')) && /tokio::fs/.test(read('src-tauri/src/lib.rs')), 'fetch_image_to 限制在资料目录内 + tokio 异步写盘')
|
||||
ok(/displayThumbDataUrlOfRef/.test(read('src/storage-file.js')) && /cleanupCacheTmp/.test(read('src/storage-file.js')), '文件接管后有缩略图预热,临时目录有清理')
|
||||
ok(/rustFileDownload: draft\.canvas\.rustFileDownload === true/.test(read('src/ui-settings-sections.js')), '设置保存保留 rustFileDownload 开关')
|
||||
ok(/fetch_image_to/.test(read('src-tauri/src/lib.rs')), 'Rust 提供 fetch_image_to(流式写文件)')
|
||||
ok(/putFileFrom/.test(read('src/storage-file.js')), '存储层支持接管已下载文件(不经过 base64)')
|
||||
ok(/fetchFile\s*:/.test(app) && /writeFileRef\s*:/.test(app), 'ingest 接线文件版通道(默认关闭)')
|
||||
|
||||
@@ -175,7 +175,7 @@ const MAX_SRC_GLOBALS = 124 // 2026-12-03 +1(123→124):新增 IWBPlugin
|
||||
// · 图标解析统一(右键菜单 + 设置页走同一解析器,2 行) +2
|
||||
// 通用件(pick/grant/stat/readDataUrl/readBlob/参数校验)全部在 src/image-file-ref.js
|
||||
// 与 src/plugin-api-images.js,app.js 只做装配。
|
||||
const MAX_APP_JS_LINES = 9490 // +37(9,453→9,490)2026-12-04:文件版下载(默认关)接线 + 支持 cfg.canvas.rustFileDownload 开关。之前 +36 文件版接线;+6 缓存闭包;+4 mime;+56 原生审计;+19 缩略图兜底;+11 预览;+3 并发;+9 命名;+199 队列装配。之后只减不增。
|
||||
const MAX_APP_JS_LINES = 9495 // +42(9,453→9,495)2026-12-04:文件版下载接线 + cfg 开关 + 路径 base 校验参数 + 接管后缩略图预热。之前 +36 文件版;+6 缓存闭包;+4 mime;+56 原生审计;+19 缩略图兜底;+11 预览;+3 并发;+9 命名;+199 队列装配。之后只减不增。
|
||||
const MAX_APP_JS_SHARE = 0.40
|
||||
|
||||
// ── 历史记账(供回溯,逐条保留)──────────────────────────────────────────────
|
||||
|
||||
Reference in new issue
Block a user