feat: オープンワールド実践ラボへ再構築 - #2
Conversation
868da6d to
7f4bba3
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 868da6d465
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const relativePath = | ||
| decodedPath === "/" ? "index.html" : decodedPath.replace(/^\/+/, ""); | ||
| let file = await findStaticFile(rootRealPath, relativePath); |
There was a problem hiding this comment.
Strip the
/lab prefix when serving fallback assets
When the documented Kali fallback is opened at http://127.0.0.1:8080/?local=1, the Vite build generated with base: "/lab/" requests scripts and styles under /lab/assets/*. This code resolves those requests as dist/client/lab/assets/*, while Vite emits them under dist/client/assets/*, so the entry script returns 404 and the offline guide never starts. Mount the static build at /lab or strip that prefix before resolving files.
AGENTS.md reference: apps/lab-guide/AGENTS.md:L17-L20
Useful? React with 👍 / 👎.
| const { decodedPath, url } = parseRequestUrl(request.url); | ||
| const isSessionApi = decodedPath.startsWith("/api/session/"); | ||
| const isAnyApi = decodedPath === "/api" || decodedPath.startsWith("/api/"); |
There was a problem hiding this comment.
Proxy the browser's
/api/lab routes in fallback mode
In the documented local fallback flow, ApiLabClient always calls /api/lab/session/*, but this predicate only accepts /api/session/*; the following generic API branch therefore returns 404 instead of forwarding state, events, hints, or flag submissions to telemetry. Recognize /api/lab/session/* and rewrite it to the target's /api/session/* contract before proxying.
AGENTS.md reference: apps/lab-guide/AGENTS.md:L17-L20
Useful? React with 👍 / 👎.
概要
旧単一路線ラボを白紙から置き換え、Debianデュアルブート標的とKali Bridgeを使う初心者向けオープンワールド実践ラボを追加します。
主な変更
/lab、ライブAPIを/api/labに統一検証
npm run check: PASS未完了ゲート