Commit Graph
3163 Commits
Author SHA1 Message Date
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
Alex Osborne ee7f2c694c Soft404Detector: also remove echoes without a trailing slash
A canonical link to /a/b on the page /a/b/ prevented a match.
2026-11-17 14:36:52 +09:00
Alex Osborne c3d062bee2 Soft404Detector: only probe servers reached by seeds or links
Servers reached by a redirect or speculative link, such as other sites a
crawled site redirects to, got a probe too.
2026-11-17 14:36:46 +09:00
Alex Osborne 82e1c5ad59 Soft404Detector: drop the content length check
It compared raw lengths, but echoes of the probe path and the page's own
path make those differ, so pages that repeat their path often were
missed even with matching fingerprints.
2026-11-17 14:36:38 +09:00
Alex Osborne e1c61d3fe8 Soft404Detector: only collapse URL-like tokens containing digits
Tokens were runs of anything but whitespace, quotes and angle brackets,
so a meta refresh's "0;url=..." or a paragraph of CJK text containing
a digit collapsed to "0", making unrelated pages match.
2026-11-17 14:36:32 +09:00
Leslie Bellony 13c6572ad6 Merge pull request #821 from bnfleb/statisticstracker
ToeThread dies on `http://0.0.0.0/` (IllegalStateException "got suspicious value 0.0.0.0"), job stuck in EMPTY forever
2026-11-15 07:48:03 +09:00
Alex Osborne da6489beee Merge pull request #820 from internetarchive/browser-docs
Document browser-based crawling
2026-11-14 01:17:03 +09:00
Alex Osborne e4d4fe0cfd Merge pull request #819 from internetarchive/browser-ssh
BrowserProcessor: launch browsers on other machines over SSH
2026-11-13 22:03:24 +09:00
Alex Osborne db156f3427 Write browser behaviors inline in the Groovy profile and docs 2026-11-13 16:08:42 +09:00
Alex Osborne fb3452a6af Behaviors: log unparseable links through the Page instead of a constructor argument
ExtractLinksBehavior and PaginationBehavior took the UriErrorLoggerModule as a
constructor argument, so they had to be Spring beans to get it. That meant the
Groovy config couldn't create them inline in the behaviors list, as Spring's
Groovy reader doesn't turn inner beans in a list into beans, and had to declare
each one as a named bean and refer to it. BrowserProcessor already has the
logger module, so it now passes it to behaviors through the page and they can
be plain objects.
2026-11-13 16:08:36 +09:00
Alex Osborne 14011df45d docs: document browser-based crawling 2026-11-13 16:01:35 +09:00
Alex Osborne 27ba6ba850 Add a commented-out BrowserProcessor bean to the Groovy default profile 2026-11-13 16:01:35 +09:00
Alex Osborne 336d0d6c52 BrowserProcessor: turn off Firefox site isolation 2026-11-13 10:12:38 +09:00
Alex Osborne 7b2a485091 BrowserProcessor: don't mistake a crashed Firefox tab for a download 2026-11-13 10:12:38 +09:00
Alex Osborne 486dffbedf BrowserProcessor: allow per-browser concurrency, executable and options 2026-11-13 10:12:38 +09:00
Alex Osborne d7c9a5581e BrowserProcessor: launch browsers on other machines over ssh 2026-11-13 10:12:38 +09:00