Self-hosted dashboard stays blank in Chrome: CSP script-src 'self' blocks WebAssembly compilation (v0.3.0)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
Hướng nghiên cứu
Đọc apps/cli/src/server/serve.ts và apps/local-ui/src/worker-entry.ts, nơi issue xác định các định nghĩa CSP cần cập nhật. Kiểm tra quá trình khởi động dashboard trong Chrome và xác nhận CSP riêng của trang đăng nhập vẫn không thay đổi. Công việc hoàn tất khi WebAssembly biên dịch thành công và dashboard tải mà không có lỗi CSP đã nêu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The self-hosted image (ghcr.io/mapletechlabs/maple:v0.3.0) serves the dashboard with Content-Security-Policy: ... script-src 'self' ..., but the UI compiles a WebAssembly module at start-up. Chrome blocks it, the app never initialises and the page stays blank (dark background, empty <div id="app">) after signing in. No error is shown to the user.
Environment
- Image
ghcr.io/mapletechlabs/maple:v0.3.0(linux/amd64), default entrypoint (start --offline), behind an HTTPS reverse proxy (ingress-nginx) withMAPLE_LOCAL_INGEST_KEY/MAPLE_LOCAL_ACCESS_TOKENset. - Chrome 156 on Linux (also reproduced with headless Chrome driven by Puppeteer).
Steps to reproduce
- Run the self-hosted image and open the dashboard through an HTTPS origin.
- Sign in with the access token.
- The page stays blank.
What I observed
GET /,/theme-init.js,/assets/index-*.js,/assets/index-*.cssand the font all return 200.- The browser then sends no request to
/local/statusor/local/query: the app crashes before its first API call. - Console /
pageerror:
CompileError: WebAssembly.Module(): Compiling or instantiating WebAssembly module violates the following
Content Security policy directive because 'unsafe-eval' is not an allowed source of script in the following
Content Security Policy directive: "script-src 'self'".
at <anonymous> (/assets/index-DfUivVRN.js:145:261244)
- Response header sent by the binary:
content-security-policy: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:; connect-src 'self' http://127.0.0.1:* http://localhost:*; object-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'
Cause and suggested fix
UI_CONTENT_SECURITY_POLICY in apps/cli/src/server/serve.ts (and CONTENT_SECURITY_POLICY in apps/local-ui/src/worker-entry.ts, which it mirrors) has script-src 'self' without 'wasm-unsafe-eval'. Chrome requires 'wasm-unsafe-eval' (or 'unsafe-eval') to compile WebAssembly under a CSP. Both files on main (f676476) still lack it.
Adding 'wasm-unsafe-eval' to script-src should be enough; it only allows WebAssembly compilation and does not enable JavaScript eval.
Workaround
Rewrite the header at the reverse proxy, adding only 'wasm-unsafe-eval' to script-src. After doing that the app starts and queries the API normally (verified with headless Chrome: sign-in, then /local/status and /local/query return 200 and the dashboard renders). The sign-in page uses its own, stricter CSP (form-action 'self') and should be left as is.
Not tested
I did not test maple start --offline on loopback or other browsers, so I cannot say whether the problem also appears there.
- Ngôn ngữ chính
- TypeScript
- Star
- 1.8k
- Fork
- 120
- Merge trung bình
- 8 giờ 11 phút
- Pull request đã merge (30 ngày)
- 667
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MapleTechLabs/maple
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
MapleTechLabs/maple#1888 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Alerting: Linear as a destination type, opening one issue per incidentCó thể đã có người làm @Makisuo đã nhận hôm nay. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
MapleTechLabs/maple#1896 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
@maple-dev/alchemy: typed dashboard props, a managed refresh interval, and adopting a dashboard built in the UICó thể đã có người làm @jasonkuhrt đã nhận 2 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
MapleTechLabs/maple#1891 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
MapleTechLabs/maple#1874 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
MapleTechLabs/maple#1873 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của MapleTechLabs/maple
Issue tương tự
-
Parallel reticle_verify opens per-flow leases without the source lease's ignoreHTTPSErrorsCó thể đã có người làm @as992949791 đã nhận hôm nay. Đang mởgood first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
reticlehq/reticle#2033 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:quality p3-medium ready-for-agent type:docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
fderuiter/deruiter.dev#3589 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
manfredsteyer/angular-oauth2-oidc#1514 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
marmelab/react-admin#11431 ·
Maintainer thường phản hồi trong vòng 1 ngày