Commit Graph
3178 Commits
Author SHA1 Message Date
Alex Osborne dbb779f899 Add a commented-out CaptureIndex to the default profiles
BrowserProcessor and the WARC writer pick up a CaptureIndex only if the
job declares one. Show how to declare it in both default profiles.
2026-11-26 17:39:10 +09:00
Alex Osborne 12a02b883b BrowserProcessor: replay subresources from a CaptureIndex
When a GET subresource was captured within replayMaxAgeSeconds, serve it
from the WARC file instead of fetching it again, so that pages sharing
resources don't refetch them once the browser has evicted them from its
cache or the page loads in another browser. Redirects back to the same
canonical URL aren't replayed as they would loop. Part of #831.
2026-11-26 17:39:10 +09:00
Alex Osborne bbbd52f637 Read a capture's HTTP response back from its WARC file
Revisits take the body from the record they refer to. Files are tried
under both their closed and .open names, as a file may be closed between
lookup and read.
2026-11-26 17:39:10 +09:00
Alex Osborne 7bd9a676b6 MitmProxy: allow sending repeated response headers
Replaying a recorded response needs headers like Set-Cookie to keep all
their values.
2026-11-26 17:39:10 +09:00
Alex Osborne 6228b3096e Index written records when WARCWriter has a CaptureIndex
The test reads the indexed records back from the still-open WARC file,
since replay will need to do the same.
2026-11-26 17:39:10 +09:00
Alex Osborne 54f5daabe9 Add CaptureIndex of WARC records written during the crawl
Keys captures by the CrawlURI's canonical string and fetch time, newest
first, so later lookups find the latest capture of a resource the same
way the frontier identifies it. Revisits store the location of the
record they refer to. Part of #831.
2026-11-26 17:39:10 +09:00
Alex Osborne b10e1302ad Bump webarchive-commons from 3.0.6 to 3.1.0
For the WARC path and record length recorded in WARCRecordInfo
(iipc/webarchive-commons#186), the HeaderedArchiveRecord read fix
(iipc/webarchive-commons#187) and the flushing of uncompressed records
after each write (iipc/webarchive-commons#188).
2026-11-26 17:32:00 +09:00
Alex Osborne f452526868 Add AGENTS.md 2026-11-26 16:18:27 +09:00
Alex Osborne f08fdb2cee Merge pull request #830 from internetarchive/soft404-probe-any-hop
Soft404Detector: probe more servers and catch soft 404s that appear mid-crawl
2026-11-26 15:59:55 +09:00
Alex Osborne 7b2279cba5 Soft404Detector: skip hashing when there's nothing to match or probe 2026-11-24 14:35:01 +09:00
Alex Osborne 4660d6ed7f Soft404Detector: re-probe when the same page repeats
What a server returns for missing URLs can change during a crawl, for
example once it has set a session cookie. When a page has the same
content as another recent page from the server and doesn't match any
probe, probe the server again, up to maxProbes probes in all (default
2). Pages matching any probe fingerprint are treated as soft 404s.
2026-11-24 14:02:17 +09:00
Alex Osborne f9363ca0ae Soft404Detector: keep per-server state in a State class
Move the soft 404 fields and methods from CrawlServer into
Soft404Detector.State, which CrawlServer holds and creates when first
requested. This keeps the detector's logic in one place and leaves
servers the detector never looks at without the state.
2026-11-24 13:11:56 +09:00
Alex Osborne 2e80500747 Soft404Detector: match pages reached by their own relative links
An app shell served for every path links to e.g. assets/css/app.css.
Fetched at /assets/css/app.css, that link looked like an echo of the
page's own URL and was removed before fingerprinting, so the page no
longer matched the probe, which got the same shell with the link
intact. That missed the first level of a relative-link trap.

Also compare the content without echoes removed.
2026-11-24 13:02:26 +09:00
Alex Osborne c2341ba9e2 Soft404Detector: probe servers reached by any hop
Limiting probes to servers reached as seeds or by navlinks missed
soft 404 traps that grow through embeds and redirects. For example, an
in-scope host that serves its app shell for unknown paths: the shell's
relative embed links resolve one directory deeper each time, and every
response is the shell again.

Probe any server that returns an HTML page instead. Servers that only
serve non-HTML content, such as image CDNs, still aren't probed.
2026-11-24 12:42:28 +09:00
Alex Osborne 3ed49d29fb Merge pull request #829 from internetarchive/browser-grid
BrowserProcessor: Selenium Grid support
2026-11-23 21:05:00 +09:00
Alex Osborne 1f1460b3d5 MitmProxyTest: pick an address on an interface that's up
On GitHub's runners the first non-loopback address can be that of an
idle Docker bridge, and Docker's NAT rule rewrites the source of a
request from it to another address, which the proxy then refuses.
2026-11-20 19:06:33 +09:00
Alex Osborne 5b99d7e426 docs: document opening browsers on a Selenium Grid 2026-11-20 18:42:15 +09:00
Alex Osborne 2fbf9d19fe GridBrowser: let browserName choose between Chrome, Firefox and Edge
By default the Grid picks Chrome or Firefox, whichever it has a free
slot for, which on a node that detects every browser on its machine
could be either.
2026-11-20 18:42:15 +09:00
Alex Osborne 1fde99a24d BrowserProcessor: check that a launched browser can reach the recording proxy
A browser that can't reach the proxy, through a firewall, a wrong
proxyHost or an allowlist missing its address, would otherwise count as
up and fail every page. As the last step of a launch, load an https page
through the proxy with a page ID, which the proxy answers itself, so that
CONNECT and its TLS interception are checked too. A browser that fails
to load it, or doesn't reach the proxy within 10 seconds, fails to
launch.
2026-11-20 18:42:15 +09:00
Alex Osborne 1993d05566 RemoteWebDriverBiDi: keep the session alive while it's open
Selenium Grid ends a session after 300 seconds without traffic by
default, which is no longer than BrowserProcessor's default idle time
before closing a browser, so a page given to an idle browser could find
its session gone. BiDi commands count as traffic, so send a cheap one
every minute until the driver is closed.
2026-11-20 18:42:15 +09:00
Alex Osborne 44ee73c301 BrowserProcessor: open browser sessions on a Selenium Grid
http:// and https:// entries in browsers, or GridBrowser beans with
credentials, each create one session on a Grid. Grid nodes reach the
recording proxy at proxyHost, which defaults to loopback for a Grid
that shares this machine's loopback; otherwise the proxy needs to listen
off loopback and allow the nodes' addresses.
2026-11-20 18:42:15 +09:00
Alex Osborne 8c34f4723a BrowserProcessor: separate launching a browser from setting up its session
So that a browser can come from somewhere other than a launch.
2026-11-20 18:42:15 +09:00
Alex Osborne 6ff26a0743 BrowserProcessor: make the proxy's address, port and allowed sources configurable 2026-11-20 18:42:15 +09:00
Alex Osborne 17c5dac361 BrowserProcessor: keep the Firefox prefs as a map and generate user.js from it
So they can also be sent as capabilities to browsers we don't launch.
2026-11-20 18:42:15 +09:00
Alex Osborne c009c92be2 MitmProxy: make the listen address configurable and allow only listed sources
Remote browsers need the proxy to listen on an address they can reach.
It keeps listening on loopback too, for browsers on this machine.
Requests from addresses other than loopback and the allowed ones get
403, so opening the proxy to the network doesn't make it an open proxy.
2026-11-20 18:42:15 +09:00
Alex Osborne 1f3896d316 RemoteWebDriverBiDi: attach to a session created over WebDriver HTTP
Creates the session with POST {endpoint}/session and webSocketUrl: true,
connects to the reported WebSocket and deletes the session on close.
Selenium Grid reports its WebSocket URL with an internal address, such
as the container's IP and port, so only its path is kept and the scheme,
host and port come from the endpoint. Supports HTTP Basic authentication.

Waits up to ten minutes for the session, as Grid queues the request
while it has no free slot, but gives up when interrupted. Deleting the
session doesn't wait for the response, so stopping isn't held up by an
unreachable Grid.
2026-11-20 15:35:55 +09:00
Alex Osborne c8f06b8438 AbstractWebDriverBiDi: close the WebSocket on close
A driver whose subclass doesn't end the connection by ending the
browser, such as one attached to a session on a remote endpoint, would
otherwise leave it open.
2026-11-20 15:20:51 +09:00
Alex Osborne bc034c8eea LocalWebDriverBiDi: move the BiDi connection into AbstractWebDriverBiDi
Separates the WebSocket, command and event handling from owning the
browser process, so that another subclass can attach to a session that
already exists.
2026-11-20 15:19:58 +09:00
Alex Osborne 0ae16db624 Merge pull request #828 from internetarchive/chromedriver-launch-race
Launch local ChromeDrivers one at a time
2026-11-19 22:29:01 +09:00
Alex Osborne e3c051e36e BrowserProcess: launch local ChromeDrivers one at a time
ChromeDriver with --port=0 picks a free port before binding it, so two
launched at the same moment can pick the same port and one exits with
"IPv4 port not available". BrowserProcessor launches all its browsers
concurrently, which made testSeveralBrowsers flaky and could stop a crawl
with several local ChromeDrivers from starting.
2026-11-19 21:47:14 +09:00
Alex Osborne 9aa8b0bc64 Merge pull request #827 from internetarchive/docker-update
Build docker images regularly using github actions
2026-11-19 21:09:35 +09:00
Alex Osborne 7ab27cd89c docker: build and push images from a GitHub Actions workflow
Runs when a release is published, on demand, and daily to rebuild the
latest release when the eclipse-temurin base image digest has changed.
The base digest is recorded in the org.opencontainers.image.base.name
label so the daily check can compare against the published image.

Requires the DOCKERHUB_TOKEN secret and DOCKERHUB_USERNAME variable.
2026-11-19 21:01:57 +09:00
Alex Osborne 4bea7b891c docker: upgrade contrib builds and combine into one Dockerfile 2026-11-19 21:01:56 +09:00
Alex Osborne 208d62b79c [maven-release-plugin] prepare for next development iteration 2026-11-19 14:15:42 +09:00
Alex Osborne a0107e3895 [maven-release-plugin] prepare release 3.19.0 3.19.0 2026-11-19 14:15:34 +09:00
Alex Osborne adc2a10569 Update CHANGELOG.md for 3.19.0 release 2026-11-19 09:45:41 +09:00
Alex Osborne 7eedafddc7 Merge pull request #825 from internetarchive/link-rel-preload
Fix navlink/embed classification of link rel types and duplicate outlinks
2026-11-18 17:46:35 +09:00
Alex Osborne 42daf19037 Merge pull request #823 from internetarchive/fix-codemirror-streamparser
Fix CodeMirror editors failing to load
2026-11-18 17:36:01 +09:00
Alex Osborne aa746df854 Schedule outlinks as embeds when a page also embeds them
When a page links to the same URL both as an embed and via another hop
type, only schedule the embed. Previously whichever came first in the page
was scheduled and the rest dropped as duplicates by the frontier, so e.g. in

    <a href=image.jpg><img src=image.jpg></a>

the image was queued as a navlink. Likewise, until rel=preload was treated
as an embed, the stylesheet in

    <link rel=preload href=style.css as=style>
    <link rel=stylesheet href=style.css>

was queued as a navlink (#824).
2026-11-18 17:32:40 +09:00
Alex Osborne c05bf8194f Treat link rel=prefetch and rel=prerender as navlinks
These are generally used for likely navigation targets rather than resources the current page needs.
2026-11-18 17:21:25 +09:00
Alex Osborne 48a3a6cb20 Treat link rel=preload as an embed
Fixes #824
2026-11-18 17:19:56 +09:00
Alex Osborne 30b88543e8 Add @codemirror/streamparser to import maps
@codemirror/language 6.13 and @codemirror/legacy-modes 6.5.5 now import
@codemirror/streamparser, so the editors failed to load with an
unmapped bare specifier error.
2026-11-18 17:02:28 +09:00
Alex Osborne 9928e1397c Override snappy-java to 1.1.10.12 for security fixes 2026-11-18 16:57:27 +09:00
Alex Osborne 6f199b57dc Add org.json:json 20260814 to managed dependencies for CVE-2026-59171 2026-11-18 16:49:33 +09:00
Alex Osborne aa4dd213df Merge pull request #814 from internetarchive/soft404-detector
Soft404Detector: detect soft 404s and optionally skip extraction
2026-11-18 16:35:14 +09:00
Alex Osborne b7ce8f9782 Fix ExtractorJSTest for commons-lang3 3.22.0
The webarchive-commons 3.0.6 bump pulls in commons-lang3 3.22.0, whose
UnicodeUnescaper no longer throws on malformed \u escapes. Only test
the invalid code points ExtractorJS rejects itself.
2026-11-17 15:32:33 +09:00
Alex Osborne d7a02be00b Bump webarchive-commons from 3.0.5 to 3.0.6 2026-11-17 15:23:11 +09:00
dependabot[bot] e4660006ca Bump the minor-and-patch group with 18 updates (#822)
Bumps the minor-and-patch group with 18 updates:

| Package | From | To |
| --- | --- | --- |
| [com.fasterxml.jackson:jackson-bom](https://github.com/FasterXML/jackson-bom) | `2.22.4` | `2.23.0` |
| [org.eclipse.jetty:jetty-bom](https://github.com/jetty/jetty.project) | `12.0.40` | `12.0.41` |
| [org.eclipse.jetty.ee10:jetty-ee10-bom](https://github.com/jetty/jetty.project) | `12.0.40` | `12.0.41` |
| [org.codehaus.mojo:versions-maven-plugin](https://github.com/mojohaus/versions) | `2.23.0` | `2.25.1` |
| [dnsjava:dnsjava](https://github.com/dnsjava/dnsjava) | `3.7.0` | `3.7.1` |
| org.webjars.npm:codemirror__autocomplete | `6.20.3` | `6.20.4` |
| org.webjars.npm:codemirror__commands | `6.11.0` | `6.11.1` |
| org.webjars.npm:codemirror__language | `6.12.4` | `6.13.1` |
| org.webjars.npm:codemirror__legacy-modes | `6.5.1` | `6.5.5` |
| org.webjars.npm:codemirror__search | `6.5.11` | `6.7.2` |
| org.webjars.npm:codemirror__state | `6.7.4` | `6.7.6` |
| org.webjars.npm:codemirror__view | `6.43.11` | `6.43.15` |
| org.webjars.npm:lezer__common | `1.5.2` | `1.5.5` |
| org.webjars.npm:lezer__lr | `1.4.10` | `1.4.12` |
| org.webjars.npm:lezer__highlight | `1.2.3` | `1.2.5` |
| org.webjars.npm:style-mod | `4.1.3` | `4.1.4` |
| [com.rabbitmq:amqp-client](https://github.com/rabbitmq/rabbitmq-java-client) | `5.37.0` | `5.37.1` |
| [at.yawk.lz4:lz4-java](https://github.com/yawkat/lz4-java) | `1.12.1` | `1.14.0` |


Updates `com.fasterxml.jackson:jackson-bom` from 2.22.4 to 2.23.0
- [Commits](https://github.com/FasterXML/jackson-bom/compare/jackson-bom-2.22.4...jackson-bom-2.23.0)

Updates `org.eclipse.jetty:jetty-bom` from 12.0.40 to 12.0.41
- [Release notes](https://github.com/jetty/jetty.project/releases)
- [Commits](https://github.com/jetty/jetty.project/compare/jetty-12.0.40...jetty-12.0.41)

Updates `org.eclipse.jetty.ee10:jetty-ee10-bom` from 12.0.40 to 12.0.41
- [Release notes](https://github.com/jetty/jetty.project/releases)
- [Commits](https://github.com/jetty/jetty.project/compare/jetty-12.0.40...jetty-12.0.41)

Updates `org.eclipse.jetty.ee10:jetty-ee10-bom` from 12.0.40 to 12.0.41
- [Release notes](https://github.com/jetty/jetty.project/releases)
- [Commits](https://github.com/jetty/jetty.project/compare/jetty-12.0.40...jetty-12.0.41)

Updates `org.codehaus.mojo:versions-maven-plugin` from 2.23.0 to 2.25.1
- [Release notes](https://github.com/mojohaus/versions/releases)
- [Changelog](https://github.com/mojohaus/versions/blob/master/ReleaseNotes.md)
- [Commits](https://github.com/mojohaus/versions/compare/2.23.0...2.25.1)

Updates `dnsjava:dnsjava` from 3.7.0 to 3.7.1
- [Release notes](https://github.com/dnsjava/dnsjava/releases)
- [Changelog](https://github.com/dnsjava/dnsjava/blob/master/Changelog)
- [Commits](https://github.com/dnsjava/dnsjava/compare/v3.7.0...v3.7.1)

Updates `org.webjars.npm:codemirror__autocomplete` from 6.20.3 to 6.20.4

Updates `org.webjars.npm:codemirror__commands` from 6.11.0 to 6.11.1

Updates `org.webjars.npm:codemirror__language` from 6.12.4 to 6.13.1

Updates `org.webjars.npm:codemirror__legacy-modes` from 6.5.1 to 6.5.5

Updates `org.webjars.npm:codemirror__search` from 6.5.11 to 6.7.2

Updates `org.webjars.npm:codemirror__state` from 6.7.4 to 6.7.6

Updates `org.webjars.npm:codemirror__view` from 6.43.11 to 6.43.15

Updates `org.webjars.npm:lezer__common` from 1.5.2 to 1.5.5

Updates `org.webjars.npm:lezer__lr` from 1.4.10 to 1.4.12

Updates `org.webjars.npm:lezer__highlight` from 1.2.3 to 1.2.5

Updates `org.webjars.npm:style-mod` from 4.1.3 to 4.1.4

Updates `com.rabbitmq:amqp-client` from 5.37.0 to 5.37.1
- [Release notes](https://github.com/rabbitmq/rabbitmq-java-client/releases)
- [Commits](https://github.com/rabbitmq/rabbitmq-java-client/compare/v5.37.0...v5.37.1)

Updates `at.yawk.lz4:lz4-java` from 1.12.1 to 1.14.0
- [Release notes](https://github.com/yawkat/lz4-java/releases)
- [Changelog](https://github.com/yawkat/lz4-java/blob/main/CHANGES.md)
- [Commits](https://github.com/yawkat/lz4-java/compare/v1.12.1...v1.14.0)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson:jackson-bom
  dependency-version: 2.23.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: org.eclipse.jetty:jetty-bom
  dependency-version: 12.0.41
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: org.eclipse.jetty.ee10:jetty-ee10-bom
  dependency-version: 12.0.41
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: org.eclipse.jetty.ee10:jetty-ee10-bom
  dependency-version: 12.0.41
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: org.codehaus.mojo:versions-maven-plugin
  dependency-version: 2.25.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: dnsjava:dnsjava
  dependency-version: 3.7.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: org.webjars.npm:codemirror__autocomplete
  dependency-version: 6.20.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: org.webjars.npm:codemirror__commands
  dependency-version: 6.11.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: org.webjars.npm:codemirror__language
  dependency-version: 6.13.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: org.webjars.npm:codemirror__legacy-modes
  dependency-version: 6.5.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: org.webjars.npm:codemirror__search
  dependency-version: 6.7.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: org.webjars.npm:codemirror__state
  dependency-version: 6.7.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: org.webjars.npm:codemirror__view
  dependency-version: 6.43.15
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: org.webjars.npm:lezer__common
  dependency-version: 1.5.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: org.webjars.npm:lezer__lr
  dependency-version: 1.4.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: org.webjars.npm:lezer__highlight
  dependency-version: 1.2.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: org.webjars.npm:style-mod
  dependency-version: 4.1.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: com.rabbitmq:amqp-client
  dependency-version: 5.37.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: at.yawk.lz4:lz4-java
  dependency-version: 1.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-17 15:22:08 +09:00
Alex Osborne 6f8201cc60 Comment out Soft404Detector in the default profiles
It's still new, so leave it opt-in until it has seen more real-world use.
2026-11-17 15:03:33 +09:00
Alex Osborne a8cd8190ea Soft404Detector: count a redirected probe as its target's probe
Otherwise the target server scheduled the same probe again.
2026-11-17 14:36:59 +09:00