From fec97c2fc926f327c6a285bd5d9ac5e028bdb2bb Mon Sep 17 00:00:00 2001 From: "Christian M. Todie" Date: Wed, 11 Nov 2026 09:50:10 -0500 Subject: [PATCH 1/5] fix(docker): locate Playwright chrome-linux64 and fail build if missing Playwright >=1.5x installs chromium under chrome-linux64, so the find on chrome-linux matched nothing and left dangling google-chrome symlinks; the supervisor then failed to spawn chrome (#14). Also add libatomic1 (needed by Playwright's bundled node) and stop swallowing playwright install errors. --- Dockerfile | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 693738b..605f644 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,16 +60,23 @@ RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ # Layer 4: Playwright + Scrapling + websockify ENV PLAYWRIGHT_BROWSERS_PATH=/opt/ms-playwright +RUN apt-get update && apt-get install -y --no-install-recommends libatomic1 \ + && rm -rf /var/lib/apt/lists/* RUN pip install --break-system-packages \ playwright \ "scrapling[fetchers]" \ websockify \ - && playwright install chromium \ - && scrapling install \ - || true - -RUN ln -sf $(find /opt/ms-playwright/chromium-*/chrome-linux -name chrome -type f | head -n 1) /usr/bin/google-chrome-stable \ - && ln -sf $(find /opt/ms-playwright/chromium-*/chrome-linux -name chrome -type f | head -n 1) /usr/bin/google-chrome + && playwright install chromium +RUN scrapling install || true + +# Playwright's layout changed (chrome-linux -> chrome-linux64), so locate the +# binary by name and fail the build if it is missing, instead of leaving a +# dangling symlink that only surfaces as a supervisor spawn error at runtime. +RUN CHROME="$(find /opt/ms-playwright -path '*/chromium-*/chrome-linux*/chrome' -type f | head -n 1)" \ + && test -x "$CHROME" \ + && ln -sf "$CHROME" /usr/bin/google-chrome-stable \ + && ln -sf "$CHROME" /usr/bin/google-chrome \ + && test -x /usr/bin/google-chrome # Layer 5: noVNC RUN git_url="https://github.com/novnc/noVNC.git" && \ From 750cdf36d0445067a3980803b042f1015d3d0975 Mon Sep 17 00:00:00 2001 From: "Christian M. Todie" Date: Wed, 11 Nov 2026 09:55:55 -0500 Subject: [PATCH 2/5] fix(deps): bump rusqlite to 0.41 for RUSTSEC-2026-0459 libsqlite3-sys 0.30.1 bundles SQLite < 3.54.0 (uninitialised page-cache read with mismatched WAL). rusqlite 0.41 pulls libsqlite3-sys 0.39.1 (SQLite 3.54.1). --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c578e61..86cd63f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,4 +24,4 @@ tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] } anyhow = "1" reqwest = { version = "0.12", features = ["json"] } -rusqlite = { version = "0.32", features = ["bundled"] } +rusqlite = { version = "0.41", features = ["bundled"] } From a1d1d2405d5ffeca9a631163f12742cb70785ab7 Mon Sep 17 00:00:00 2001 From: "Christian M. Todie" Date: Wed, 11 Nov 2026 09:57:08 -0500 Subject: [PATCH 3/5] fix(docker): use mirrors.edge.kernel.org for apt archive.ubuntu.com and security.ubuntu.com return SERVFAIL from the default resolvers on GitHub runners and a WSL2 host, failing every apt-get in the image build. The kernel.org mirror carries the same signed archive. --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index 605f644..a16f95b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,13 @@ ENV DEBIAN_FRONTEND=noninteractive ENV DISPLAY=:99 ENV HOME=/home/sandbox +# apt mirror: the default resolvers on GitHub runners and on a WSL2 dev host +# return SERVFAIL for *.ubuntu.com (verified 2026-11-11), which breaks every +# apt-get below. mirrors.edge.kernel.org serves the same signed archive, and +# apt still verifies it against the Ubuntu keyring. +RUN sed -i 's#http://archive.ubuntu.com/ubuntu#http://mirrors.edge.kernel.org/ubuntu#g; s#http://security.ubuntu.com/ubuntu#http://mirrors.edge.kernel.org/ubuntu#g' \ + /etc/apt/sources.list.d/ubuntu.sources + # Layer 1: System deps — display, VNC, window manager, X11 tools, network # debug tooling. The network tools (iproute2, net-tools, dnsutils, jq) are # load-bearing for any agent that needs to introspect ports, sockets, or From 0ba4aa60d1cc86e819f82b3c54427cb204902c34 Mon Sep 17 00:00:00 2001 From: "Christian M. Todie" Date: Wed, 11 Nov 2026 10:30:12 -0500 Subject: [PATCH 4/5] test: update e2e and CI checks for current example.com and supervisor example.com no longer has an

(title/first

only, no static ), and the supervisor now runs six processes. Assert on and the paragraph text, and require at least the four desktop processes. --- .github/workflows/ci.yml | 4 ++-- crates/reach-cli/tests/e2e_container.rs | 28 +++++++++++++++---------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27132c0..87531fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -206,8 +206,8 @@ jobs: docker exec reach-ci python3 -c " from scrapling import Fetcher r = Fetcher().get('https://example.com') - h1 = r.css('h1')[0].text - assert h1 == 'Example Domain', f'got: {h1}' + title = r.css('title')[0].text + assert title == 'Example Domain', f'got: {title}' print('Scrapling OK') " diff --git a/crates/reach-cli/tests/e2e_container.rs b/crates/reach-cli/tests/e2e_container.rs index d622963..bb3926b 100644 --- a/crates/reach-cli/tests/e2e_container.rs +++ b/crates/reach-cli/tests/e2e_container.rs @@ -121,7 +121,8 @@ fn t02_four_processes_running() { ensure_container(); let h = curl_json(HEALTH_URL); let procs = h["processes"].as_array().unwrap(); - assert_eq!(procs.len(), 4); + // The supervisor also runs chrome and reach-browserd; the desktop four must be present. + assert!(procs.len() >= 4, "expected at least 4 processes: {procs:?}"); for name in ["xvfb", "openbox", "x11vnc", "novnc"] { let p = procs .iter() @@ -354,7 +355,7 @@ fn t21_playwright_title() { fn t22_playwright_selectors() { ensure_container(); let out = sh_ok( - "python3 << 'PY'\nfrom playwright.sync_api import sync_playwright\nwith sync_playwright() as p:\n b=p.chromium.launch(headless=True)\n pg=b.new_page(); pg.goto('https://example.com')\n h1=pg.query_selector('h1').inner_text()\n n=len(pg.query_selector_all('a'))\n print(f'{h1}|{n}'); b.close()\nPY", + "python3 << 'PY'\nfrom playwright.sync_api import sync_playwright\nwith sync_playwright() as p:\n b=p.chromium.launch(headless=True)\n pg=b.new_page(); pg.goto('https://example.com')\n h1=pg.title()\n n=len(pg.query_selector_all('a'))\n print(f'{h1}|{n}'); b.close()\nPY", ); let parts: Vec<&str> = out.split('|').collect(); assert_eq!(parts[0], "Example Domain"); @@ -388,7 +389,7 @@ fn t25_scrapling_h1() { ensure_container(); assert_eq!( sh_ok( - "python3 -c \"from scrapling import Fetcher; r=Fetcher().get('https://example.com'); print(r.css('h1')[0].text)\"" + "python3 -c \"from scrapling import Fetcher; r=Fetcher().get('https://example.com'); print(r.css('title')[0].text)\"" ), "Example Domain" ); @@ -399,12 +400,13 @@ fn t25_scrapling_h1() { fn t26_scrapling_multi_selector() { ensure_container(); let out = sh_ok( - "python3 << 'PY'\nfrom scrapling import Fetcher\nr=Fetcher().get('https://example.com')\nprint(f\"{r.css('h1')[0].text}|{len(r.css('p'))}|{len(r.css('a'))}\")\nPY", + "python3 << 'PY'\nfrom scrapling import Fetcher\nr=Fetcher().get('https://example.com')\nprint(f\"{r.css('title')[0].text}|{len(r.css('p'))}|{len(r.css('a'))}\")\nPY", ); let p: Vec<&str> = out.split('|').collect(); assert_eq!(p[0], "Example Domain"); assert!(p[1].parse::<usize>().unwrap() > 0); - assert!(p[2].parse::<usize>().unwrap() > 0); + // example.com's static HTML no longer contains any <a>; only require a valid count. + p[2].parse::<usize>().expect("anchor count is a number"); } // ═══════════════════════════════════════════════════════════ @@ -470,7 +472,7 @@ fn t33_workflow_scrape_then_visual() { // Scrape assert_eq!( sh_ok( - "python3 -c \"from scrapling import Fetcher; print(Fetcher().get('https://example.com').css('h1')[0].text)\"" + "python3 -c \"from scrapling import Fetcher; print(Fetcher().get('https://example.com').css('title')[0].text)\"" ), "Example Domain" ); @@ -517,7 +519,7 @@ fn t35_workflow_headed_and_headless_coexist() { sleep_ms(1000); // Headless playwright while headed chrome is running let h1 = sh_ok( - "python3 << 'PY'\nfrom playwright.sync_api import sync_playwright\nwith sync_playwright() as p:\n b=p.chromium.launch(headless=True)\n pg=b.new_page(); pg.goto('https://example.com')\n print(pg.query_selector('h1').inner_text()); b.close()\nPY", + "python3 << 'PY'\nfrom playwright.sync_api import sync_playwright\nwith sync_playwright() as p:\n b=p.chromium.launch(headless=True)\n pg=b.new_page(); pg.goto('https://example.com')\n print(pg.title()); b.close()\nPY", ); assert_eq!(h1, "Example Domain"); // Headed chrome still alive @@ -608,8 +610,8 @@ fn t37_page_text_basic() { assert_eq!(parsed["status"], "ok", "page_text not ok: {stdout}"); let text = parsed["text"].as_str().unwrap_or_default(); assert!( - text.contains("Example Domain"), - "expected text to contain 'Example Domain', got: {text}" + text.contains("documentation examples"), + "expected text to contain 'documentation examples', got: {text}" ); } @@ -621,7 +623,7 @@ fn t38_page_text_selector() { sleep_ms(500); let payload = serde_json::json!({ "url": "https://example.com", - "selector": "h1", + "selector": "p", "timeout_ms": 30000, }); let stdout = run_embedded_python( @@ -635,7 +637,11 @@ fn t38_page_text_selector() { "page_text selector not ok: {stdout}" ); let text = parsed["text"].as_str().unwrap_or_default(); - assert_eq!(text.trim(), "Example Domain"); + assert!( + text.trim() + .starts_with("This domain is for use in documentation examples"), + "unexpected selector text: {text}" + ); } #[test] From a3a1acbe92eab843d22da05cac8a03f7aa7e8016 Mon Sep 17 00:00:00 2001 From: "Christian M. Todie" <chris@todie.io> Date: Wed, 11 Nov 2026 10:13:16 -0500 Subject: [PATCH 5/5] fix(security): clear Trivy HIGH findings and cargo-audit protobuf advisory (#15) Update npm and sharp in the image (13 HIGH Node findings -> 0) and ignore RUSTSEC-2024-0437 in cargo audit with the same rationale as deny.toml. --- .github/workflows/security.yml | 4 +++- Dockerfile | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index 64c6b87..0ff260e 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -16,7 +16,9 @@ jobs: - name: Install cargo-audit run: cargo install cargo-audit --locked - name: Audit - run: cargo audit + # RUSTSEC-2024-0437 (protobuf 2.28 via prometheus): same justification as deny.toml, + # reach-supervisor only exports metrics and never parses protobuf input. + run: cargo audit --ignore RUSTSEC-2024-0437 deny: name: Cargo Deny Advisories diff --git a/Dockerfile b/Dockerfile index a16f95b..4222b08 100644 --- a/Dockerfile +++ b/Dockerfile @@ -62,7 +62,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Layer 3: Node.js + computer-use-mcp RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ && apt-get install -y --no-install-recommends nodejs \ - && npm install -g computer-use-mcp \ + && npm install -g npm@latest computer-use-mcp \ + && npm --prefix /usr/lib/node_modules/computer-use-mcp install --no-save sharp@latest \ + && npm cache clean --force \ && rm -rf /var/lib/apt/lists/* # Layer 4: Playwright + Scrapling + websockify