Warren c2bfca3a1b Archive Module Phase 2: Core Formats Full Implementation
Phase 2完成(核心处理器652行 + 测试280行):

 ZIP Processor完整实现:
  - open(): ZIP文件打开 + 元数据提取
  - list_entries(): 文件列表获取
  - extract_file(): 单文件解压(随机访问)
  - extract_all(): 批量解压 + Zip Slip防护
  - Zip Bomb检测:压缩比率验证

 TAR Processor完整实现:
  - open(): TAR文件打开 + entries迭代
  - list_entries(): entries列表缓存
  - extract_all(): tar库完整解压
  - Zip Slip防护:路径验证
  - TAR特性:无压缩(ratio=1.0)

 GZIP Processor完整实现:
  - open(): flate2 GzDecoder解压
  - 单文件格式处理
  - extract_file(): 单文件解压
  - extract_all(): 输出文件命名(去除.gz扩展名)
  - Zip Bomb检测:比率验证

 TAR.GZ组合处理器:
  - GZIP + TAR双重解压
  - 临时文件处理
  - 组合格式检测
  - 流式解压支持

 安全测试完整:
  - Zip Slip防护测试(4个攻击场景)
  - Zip Bomb检测测试(3个比率场景)
  - 路径遍历攻击验证

 核心格式测试套件(19个测试用例):
  - ZIP测试:5个(open, list, extract_all, extract_file, zip_bomb)
  - TAR测试:2个(open, extract_all)
  - GZIP测试:3个(open, extract_all, extract_file)
  - TAR.GZ测试:2个(open, extract_all)
  - 安全测试:3个(zip_slip, zip_bomb, zip_bomb_rejection)
  - 集成测试:2个(format_detection, processor_registry)
  - Helper函数:4个(create_test_zip/tar/gzip/tar_gz)

编译状态: 0 errors
测试框架:完整(tempfile测试文件生成)

下一步Phase 3:
  - 可选格式(RAR/XZ/7z)
  - 外部依赖检测
  - 法律警告系统
2026-06-10 17:43:15 +08:00
2026-05-30 14:08:55 +08:00
2026-05-16 15:37:37 +08:00
2026-05-30 14:08:55 +08:00
2026-05-16 15:37:37 +08:00
2026-05-16 15:37:37 +08:00
2026-05-16 15:37:37 +08:00
2026-05-16 15:37:37 +08:00
2026-05-16 15:37:37 +08:00
2026-05-16 15:37:37 +08:00
2026-05-16 15:37:37 +08:00

MarkBase

Momentry Display Engine - Markdown渲染與檔案樹管理系統

功能特色

  • Markdown渲染支援表格、footnote、tasklist -檔案樹管理SQLite持久化
  • REST API18+路由)
  • macOS音訊控制音訊裝置切換、音量控制 -多種顯示模式tree, list, grid_sm, grid_lg

##安裝

###必要條件

  • Rust 1.92+
  • macOS音訊功能需 macOS
  • SwitchAudioSource音訊裝置切換
#安裝 Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

#安裝 SwitchAudioSourcemacOS
brew install switchaudio-source

###建構

cargo build

##使用

###啟動伺服器

cargo run -- display                #預設 port 11438
cargo run -- display -p8080         #自訂 port
cargo run -- display README.md      #顯示指定檔案

###渲染 Markdown

cargo run -- render README.md       #輸出到 stdout
cargo run -- render README.md -o output.html

##測試

cargo test                          #執行所有測試
cargo test test_insert              #執行特定測試

File Tree功能

REST API

路由 方法 功能
/api/v2/tree/:user_id GET 取得檔案樹
/api/v2/tree/:user_id/node POST 建立節點
/api/v2/tree/:user_id/node/:node_id PUT/DELETE 更新/刪除節點
/api/v2/tree/:user_id/node/:node_id/move PUT 移動節點
/api/v2/tree/:user_id/node/:node_id/alias PATCH 更新別名

###顯示模式

  • tree - 樹狀顯示
  • list - 列表顯示
  • grid_sm - 小格狀顯示
  • grid_lg - 大格狀顯示

###範例

curl http://localhost:11438/api/v2/tree/demo?mode=tree
curl http://localhost:11438/api/v2/tree/demo?mode=list

Demo資料

  • data/users/demo.sqlite - 50節點範例資料
  • data/cache/ -範例檔案

##開發

AGENTS.md詳細開發指南。

CI/CD

使用 Gitea Actionshttps://gitea.momentry.ddns.net

License

MIT

Description
No description provided
Readme 179 MiB
Languages
C 43.6%
Rust 20.1%
D 15.6%
Assembly 8.9%
Swift 3.3%
Other 8.3%