feat(web): serve the SDK and custom pages from the local relay - #3566
feat(web): serve the SDK and custom pages from the local relay#3566paul-nechifor wants to merge 1 commit into
Conversation
- The relay serves the SDK bundle at /sdk.js and, with --serve-dir DIR, a custom page directory at / in place of the cockpit. /api/* and /sdk.js win. - examples/minimal/ is a zero-build page: one HTML file importing /sdk.js. Run it with: dimos run <bp> --local-relay --serve-dir web/examples/minimal. - Directory traversal and symlink escapes out of the served dir are rejected, with tests. - The local relay answers /api/info, /api/stats, /sdk.js and served JS modules with wildcard CORS so Vite dev servers and file: pages can bootstrap. - That is safe only on loopback, so startRelay refuses a non-loopback host unless --unsafe-non-loopback acknowledges it. - ensure_cockpit_dist becomes ensure_web_dist: cockpit and SDK build under one staleness stamp, and release wheels ship both prebuilt dists. - New browser e2e test_sdk_browser.py pins the zero-build, cross-origin, and file: page forms. --serve-dir is rejected with --relay-url.
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Greptile SummaryThis change enables the local relay to serve the browser SDK at The static-file sibling-prefix traversal concern was disproved against a real relay instance. A request for an in-root file returned No defects were found that require changes before merge. Confidence Score: 5/5The local static-serving path exercised by the focused probe prevents the tested attempt to read an adjacent directory outside the configured serve root. The review has no remaining findings. The focused executable check used the actual relay and raw HTTP requests to compare a known-good in-root response with the suspected out-of-root path, and the relay suite passed. Files Needing Attention: No files require follow-up changes. The focused behavior was exercised in web/relay/server.ts.
What T-Rex did
Reviews (1): Last reviewed commit: "feat(web): serve the SDK and custom page..." | Re-trigger Greptile |
No description provided.