Skip to content

fix(web): work over plain HTTP on a LAN address - #187

Merged
velixio merged 37 commits into
mainfrom
fix/web-insecure-context
Nov 19, 2026
Merged

velixio merged 37 commits into
mainfrom
fix/web-insecure-context

Conversation

@velixio

@velixio velixio commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Builds on #186.

Opening a self-hosted install at http://<lan-ip>:<port> crashed the Companies and People pages with crypto.randomUUID is not a function. crypto.randomUUID, crypto.subtle and navigator.clipboard exist only in a secure context (HTTPS or localhost). Record import, chat and every copy button had the same fault.

Changes:

  • src/lib/insecure-context.ts: randomId(), copyText() and sha256Hex() with fallbacks that work in any context. All 10 call sites use them.
  • A unit test fails if src calls the three APIs directly. The SHA-256 fallback is checked against the published vectors and against crypto.subtle across block boundaries.
  • A page that throws while rendering now shows a plain error page with reload and overview actions instead of the router's developer screen.

Tested: lint clean, 216 unit tests pass, build succeeds, accessibility suite 63 passed. Not tested: the copy fallback in a real browser over HTTP.

…eep the queue wait off the provider timeout

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…s, one shared policy for both write paths

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
… notes the failed attempt

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
… column graph and stores the verifier's answer

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
… cooling down, browser service

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…olumn, link Email Verify to Email

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…luding key-requiring columns as separate numbers

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…mbers, remaining causes

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
… (upstream, target site, local)

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…n; concurrent timeouts count as one event

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Drives the built app against a running stack (setup, Get started, sample run,
every route in light and dark, one action per area), records API statuses,
console output and error states, and writes screenshots and findings.json.
Separate config and script; not part of test:a11y and not run in CI.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…nalytics trend contrast

The mocked suite answered unmatched endpoints with [], so /overview, /analytics and
/settings rendered their error states (or a skeleton) and were never audited with
content. Add shapes captured from the real API, fail any page that shows an
error state, and wait for the query retry before auditing. The analytics page,
now rendered with data, exposed low-contrast trend text (emerald-500 and red-400
on white); use the 700/400 pair.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Loading the sample completes step 3, and done steps carry no actions, so
Open it from step 3 pointed at nothing. The workbook link is step 4's.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
The list search cast accepted_fields to text, so domain or name (or any
short term) matched every record. Search the values with jsonb_each_text.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
… and website_scraper walk a site once per run, not once per column

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…, needs_setup, error)

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Removed the GitHub star-count fetch from the login page (plain link stays),
replaced Google favicon requests with local icons or initials in the workbook,
legacy leads, lead detail and quick look, and made the lead-detail map
(Nominatim geocoding and OpenStreetMap tiles) load only after a click. The a11y
suite now fails any route, and /login, that requests another origin.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…d; cells are counted as filled, no_data, needs_setup or error

Provider failures that the cell used to hide as no_data (an HTTP 5xx, a missing key) now say so
(provider_error, provider_key_missing). Retry passes pick up error cells only. The receipt stores the
counts. Tests that encode the old status and count semantics are updated in the next commit.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…statuses

The wbexec parity vectors (testdata/wbexec_vectors.json) are unchanged. They record Python's row_result,
which counted every cell without a value as an error: provenance_error_cell (1), condition_skip_blocks_dependent
(2, one of them a skip) and email_verify_no_value_no_cascade (1). Go now splits those into no_data, needs_setup and
error, so the harness compares Python's count with their sum. The run_integration and receipt tests that asserted
errors=2 / status=failed for cells that found no data, and the exact receipt key set, now assert the new counts.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
… for real errors

The run label reads '86 filled · 89 no data · 25 need setup'. The Run needs attention banner shows only for failed or completed_with_errors workbooks. Cell icons: no data is neutral, needs setup links to Settings. A shared outcome table is checked by both the Go and the TS classifier.
Add internal/sqllike (Escape, Contains) and use it for the record search and
the workbook row query; the lead list and read queries (sqlc) get the same
escaping in SQL, as emaildata already had. A lone % used to match every row.
The two recorded lead vectors that relied on wildcard semantics (specialization
IT_Staffing and %) now expect literal matches. All other ILIKE/LIKE uses are
fixed patterns. Every query built from request input is parameterised; the few
concatenated identifiers (leads update columns, record table names) come from
allow-lists.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…message

The run-history result returns no_data and needs_setup when the receipt has them (older receipts keep their shape); the workbook_status message carries them too.
…ours the keyless backoff

ddgs builds a fresh engine set per query and swallows non-200 answers, so a backend that had just said 429 or 403 was asked again on the next query and a dead one cost a full timeout each time. The browser service now remembers each backend's last answer and skips it while it cools down; when all are cooling down the query fails at once as rate_limited. WebSearch now shares the Go keyless backoff. No change to how requests look or where they come from.
docs/operations/search-backends.md says the honest answer is your own search key or SearXNG.
… of NewDeps, so no probe was ever sent

NewDeps registered the SMTP verifier already bound to the Deps of that moment, before NewLive set NewSession, SMTPDisabled and the HELO identity. Every cascade verification therefore ended 'unknown / unreachable' without opening a connection (port 25 was open; a direct probe returns catch_all or invalid). The verifier is now registered unbound and the cascade binds it, and checks availability, against the Deps it runs with.

Also: the probe records where it stopped (Why), and a run of distinct mail servers that all fail to answer while none does marks port 25 as blocked (smtp_port_blocked). An unknown verdict is no longer stored as the cell value: it is no_data (email_inconclusive), needs_setup (blocked port 25, with the text to use a verification provider key; or nothing to ask), or an error (timeout, open breaker).
…st environment-limited columns

Email Verify 'unknown' is no fill. Columns whose cells say SMTP port 25 is blocked are reported as environment-limited, with their own rate (excluding_environment_limited) beside the other three.
…providers and spend

The analytics overview read legacy leads only, so a workspace with companies,
people and workbook runs saw zeros. The response now also carries records,
activity, providers, spend and legacy (added after the existing fields). The
page defaults to that view; the legacy-lead scope is a secondary filter shown
only when legacy rows exist.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…h installs

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…alth test (ruff)

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
… route throws

crypto.randomUUID, crypto.subtle and navigator.clipboard exist only in a
secure context (HTTPS or localhost). Opening a self-hosted install at
http://<lan-ip> crashed the Companies and People pages with
"crypto.randomUUID is not a function", and import, chat and every copy
button had the same fault. They now go through lib/insecure-context,
which falls back to getRandomValues, a selection-based copy and a pure
SHA-256. A unit test keeps direct calls out of src.

A page that throws while rendering now shows a plain error page with
reload and overview actions instead of the router's developer screen.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
@velixio
velixio requested a review from debpalash as a code owner November 19, 2026 08:03
@github-actions

Copy link
Copy Markdown

All contributors on this pull request have signed the OpenGTM CLA. Thank you!

Agreement: OpenGTM CLA 1.0

@github-actions github-actions Bot added the cla-signed All contributors signed the CLA label Nov 19, 2026
…rases

intOf parsed ids as 64-bit and callers narrowed them to int32, so an
out-of-range value wrapped instead of failing. A company or person name
containing a double quote ended the exact-phrase search early. Both were
reported by CodeQL on files this branch touches.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
@velixio
velixio merged commit 201b5d5 into main Nov 19, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed All contributors signed the CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant