feat(PR-05): pure static export and hardened Live boundary

- export.rs: marqdo view export PATH --out DIR through the same ReaderRenderer;
  index.html + pages/<relative>.html + hash-named assets + manifest.json
- export never calls Core run; refuses output inside project root and unrelated
  non-empty dirs; staging + atomic rename replaces only prior View exports
- offline by construction: embedded asset bytes, data-URI images, relative
  links, no remote subresources; --no-annotations hides anchors only
- HTTP hardening: max 32 concurrent requests (503), detail-free public error
  JSON/pages (no absolute paths/subprocess text), 30s page check budget
- tools/test-export.sh (manifest hashes + file:// Chromium offline check),
  tools/test-security.sh, adversarial security-project browser fixture
- tests/export.rs export contracts; ADR-0005; docs updated
This commit is contained in:
marqdo-view dev committed 2026-11-22 11:52:22 +08:00
1 parent 9a80272b5f
commit 1f34daffb0
20 files changed
+983 -19

No files matched your search

+9
View File
@@ -43,6 +43,13 @@ cargo test --locked
cargo build --release --locked
```
静态导出(纯只读、离线可打开,永不执行文档):
```bash
marqdo view export examples/welcome --out ./site
# 或:marqdo-view export examples/welcome --out ./site --marqdo-bin /path/to/marqdo
```
本机浏览(默认只绑定 127.0.0.1,不自动执行):
```bash
@@ -64,6 +71,8 @@ MARQDO_BIN=/absolute/path/to/marqdo
```bash
(cd tests/browser && npm install && PLAYWRIGHT_BROWSERS_PATH="$PWD/../.cache/pw-browsers" npx playwright install chromium)
MARQDO_BIN=/absolute/path/to/marqdo ./tools/test-browser.sh
MARQDO_BIN=/absolute/path/to/marqdo ./tools/test-export.sh
./tools/test-security.sh
```
完整安装/验收步骤见 RFC §18,脚本位于 `tools/`。