webcake-landing-mcp 1.18.1 → 1.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,11 @@
1
1
  [
2
+ {
3
+ "v": "1.18.2",
4
+ "d": "01/12/2026",
5
+ "type": "Fixed",
6
+ "en": "render_preview's self-hosted Playwright screenshot route now launches Chromium with its sandbox enabled by default, instead of always passing…",
7
+ "vi": "Route screenshot Playwright tự host của render_preview nay mặc định bật sandbox cho Chromium thay vì luôn truyền --no-sandbox, nên một lỗ hổng…"
8
+ },
2
9
  {
3
10
  "v": "1.18.1",
4
11
  "d": "01/12/2026",
@@ -33,12 +40,5 @@
33
40
  "type": "Fixed",
34
41
  "en": "login and the OAuth connect flow now also capture the landing session id (wsid, the SPA's lwsid cookie) alongside the JWT and persistence calls send…",
35
42
  "vi": "login và luồng OAuth connect nay cũng lấy thêm session id landing (wsid, tức cookie lwsid của SPA) cùng với JWT, và các lượt gọi persistence gửi nó…"
36
- },
37
- {
38
- "v": "1.16.1",
39
- "d": "25/11/2026",
40
- "type": "Fixed",
41
- "en": "validate_page's text height estimate now matches the renderer's actual line-height: 1.5 default (previously assumed 1.4), so a text-block with no…",
42
- "vi": "Công thức ước lượng chiều cao chữ của validate_page nay khớp với giá trị line-height: 1.5 thật của renderer (trước đó giả định 1.4), nên một…"
43
43
  }
44
44
  ]
@@ -18,6 +18,12 @@
18
18
  */
19
19
  let pwModule = null;
20
20
  let triedLoad = false;
21
+ // Chromium renders caller-chosen URLs, so its sandbox stays ON (needs unprivileged user namespaces,
22
+ // or seccomp=deploy/vps/chrome-seccomp.json in Docker). CHROMIUM_NO_SANDBOX=1 is the opt-out for a
23
+ // host that can't provide one.
24
+ const NO_SANDBOX = process.env.CHROMIUM_NO_SANDBOX === "1";
25
+ if (NO_SANDBOX)
26
+ console.error("[render] WARNING: CHROMIUM_NO_SANDBOX=1 — Chromium runs WITHOUT its sandbox; a renderer exploit reaches this process's user.");
21
27
  let browserPromise = null;
22
28
  /** Lazy-load `playwright` (then `playwright-core`); cache the result (incl. the not-installed case). */
23
29
  async function loadPlaywright() {
@@ -47,13 +53,20 @@ async function getBrowser() {
47
53
  if (!pw)
48
54
  return null;
49
55
  if (!browserPromise) {
50
- const launchOpts = { headless: true, args: ["--no-sandbox", "--disable-dev-shm-usage"] };
56
+ // Playwright adds --no-sandbox itself unless chromiumSandbox is true.
57
+ const launchOpts = { headless: true, chromiumSandbox: !NO_SANDBOX, args: ["--disable-dev-shm-usage"] };
51
58
  const exe = process.env.PLAYWRIGHT_CHROMIUM_PATH || process.env.CHROME_BIN;
52
59
  if (exe)
53
60
  launchOpts.executablePath = exe;
54
61
  // No bundled Chromium and no CHROME_BIN (a dev machine): fall back to the installed Chrome.
55
- browserPromise = pw.chromium.launch(launchOpts).catch((e) => exe ? Promise.reject(e) : pw.chromium.launch({ ...launchOpts, channel: "chrome" })).catch((e) => {
62
+ let first;
63
+ browserPromise = pw.chromium.launch(launchOpts).catch((e) => {
64
+ first = e;
65
+ return exe ? Promise.reject(e) : pw.chromium.launch({ ...launchOpts, channel: "chrome" });
66
+ }).catch((e) => {
56
67
  browserPromise = null; // allow a later retry
68
+ // The route only says "failed to launch"; the real cause (e.g. "No usable sandbox!") goes to the log.
69
+ console.error("[render] chromium launch failed:", String(first?.message ?? e).split("\n").slice(0, 4).join(" | "));
57
70
  throw e;
58
71
  });
59
72
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webcake-landing-mcp",
3
- "version": "1.18.1",
3
+ "version": "1.18.2",
4
4
  "description": "MCP server exposing Webcake landing-page element schemas + AI usage hints, and persisting LLM-generated page sources to a Webcake backend.",
5
5
  "mcpName": "io.github.vuluu2k/webcake-landing-mcp",
6
6
  "type": "module",