Commit Graph

746 Commits

Author SHA1 Message Date
Alex Osborne e276d83f4b BrowserProcessor: avoid NPE when a WebDriverException has no message 2026-07-10 15:48:42 +09:00
Alex Osborne d3da2f9afe BrowserProcessor: handle result.isFailed() in SubresourceRecorder.onComplete() 2026-06-18 23:30:48 +09:00
Alex Osborne 2c9f167ae3 BrowserProcessor: handle recording truncation with length and timeout limits 2026-06-18 23:25:20 +09:00
Alex Osborne 4cb48ec5dc BrowserProcessor: fix content digest and recording limits for subresources 2026-06-18 23:18:23 +09:00
Alex Osborne ff6f98d38d BrowserProcessor: set User-Agent header
Ensures requests made by the browser use the user-agent string configured for the page in the job config.
2026-06-18 23:00:21 +09:00
Alex Osborne e156997dbd MitmProxy: Fix request recording
This fixes a bug where POST requests would get recorded with a doubled header and a bunch of nulls at the end.

It seems that the onRequestContent() listener doesn't pass us the right buffer when proxying. The buffer seems to contain client-to-server data and the buffer's limit isn't set. So instead this records the request content by overriding newProxyToServerRequestContent.
2026-06-17 16:56:24 +09:00
Alex Osborne 709ac00dd2 Add PaginationBehavior: repeatedly clicks next-page and extracts links 2026-06-11 13:34:55 +09:00
Alex Osborne 54b95f5e97 groovy profile: remove stray } 2026-06-10 18:23:12 +09:00
Alex Osborne bd34a7a0a9 Log the exception when creating new jobs fails 2026-06-10 17:43:57 +09:00
Alex Osborne d3defaacd2 Merge pull request #732 from internetarchive/remove-foundation-js
Remove obsolete JavaScript libraries
2026-05-12 16:44:16 +09:00
Alex Osborne 56a1fc2198 Remove Internet Explorer compatibility shims
There's no need for these anymore, IE has been sunset.
2026-05-04 08:45:41 +09:00
Alex Osborne 05f5243207 Remove Foundation JS libraries
Foundation 4 has been obsolete since 2013, and these libraries trigger security alerts. We're also not using them to do much, just the modal dialogs, alert close buttons and collapsing the top-bar on mobile. This replaces the modals with the native HTML dialog element and implements the trivial click event handlers needed for hiding and showing things.
2026-05-04 08:45:40 +09:00
Alex Osborne 71ae9a013b Merge pull request #728 from internetarchive/groovy-config-editor
Add Groovy mode to config editor
2026-05-03 12:06:26 +09:00
Alex Osborne 82181f3d9e Add Groovy mode to config editor
Includes bean and property name autocomplete, similar to the XML mode. Completion of short class names auto-inserts import statements as needed.
2026-04-28 09:08:23 +09:00
Alex Osborne 9e43fde053 Recognise Groovy profiles during job discovery 2026-04-27 17:56:23 +09:00
Alex Osborne b1e13c550b Add profile selector to job creation form
This means:

- Job profiles can be used without having to hunt for them among the regular jobs.
- The Groovy default profile can be selected as an alternative to Spring XML one.
- The default profiles can be customised by creating a job profile with the same name.
2026-04-27 17:40:37 +09:00
Alex Osborne 55c1c20295 Remove httpProxyHost and httpProxyPort from fetcher properties after test execution 2026-04-25 21:28:44 +09:00
Alex Osborne 7490998843 Merge pull request #721 from simons-hub/fix/warn-on-precedence-clipping
Log warning when URI precedence exceeds maximum 127
2026-04-06 16:54:56 +09:00
Simon 47632eb4c4 Log warning when URI precedence exceeds maximum 127
BdbMultipleWorkQueues.calculateInsertKey() silently clips precedence
values to 127 for queue ordering. This can cause unexpected behavior
for custom cost assignment policies that return values above 127.

Log a warning when clipping occurs and fix the misleading comment in
CrawlURI.holderCost that said "should not exceed 255" (the actual
limit is 127, not 255).

Fixes #502
2026-03-31 00:37:36 -07:00
Alex Osborne 96737799ed Enable XXE protection when parsing crawl job XML
Heritrix's Spring XML based job config format by design allows arbitrary code execution, so this doesn't realistically make things much safer, but I also don't see any reason we need external entity resolution enabled. I suppose there's a chance this could mitigate a generic automated attack that uses XXE but doesn't target Heritrix or Spring XML specifically.

Fixes #711
2026-03-02 10:11:38 +09:00
Erik Körner c1bedebef1 Add job deletion to API and UI 2026-01-05 14:19:17 +01:00
Erik Körner 107a249a5d Limit height of Exit Java joblist, set auto-scroll behaviour on overflow 2025-12-18 12:26:08 +01:00
Erik Körner 78b76345d0 Update other endpoints to use new JsonMarshaller, fix some edge cases 2025-12-17 23:25:37 +01:00
Erik Körner cf87b045b9 Add /beans endpoint JSON handling 2025-12-17 22:51:37 +01:00
Erik Körner 18b569736c Add org.restlet.ext.json dependency, add application/json REST API responses 2025-12-17 18:02:36 +01:00
Leslie Bellony 8a7db14a51 Add sizeOnDisk on job status (#699) 2025-12-09 15:59:03 +01:00
Manikya Rathore e4523d63ee fix 690 issue Consolidate and log on deleting URIs from BdB database 2025-11-22 18:42:36 +05:30
Alex Osborne c0e5018eef Config editor: implement autocompletion
This adds context-sensitive autocompletion for bean classes, bean ids, property names, basic Spring XML tags and attributes. The bean completions use a new `/engine/beandoc` endpoint that serves the combination of all the `/META-INF/heritrix-beans.json` files generated at compile-time by the heritrix-docgen annotation processor.
2025-10-30 09:53:16 +09:00
Adam Miller 558727ac37 fix handle more bdb shutdown interrupts 2025-10-03 17:17:46 -07:00
Adam Miller 38e7156ef6 fix: don't restore crawlEndTime when resuming from checkpoint. 2025-09-25 10:50:47 -07:00
Adam Miller fd2aed89fb feat: strip invalid chars from xml rest api output 2025-09-11 17:42:07 -07:00
Alex Osborne 2388db4229 Bump commons-lang from 2.6 to 3.18.0 2025-07-21 16:55:31 +09:00
Alex Osborne 85ceab905c BrowserProcessor: create scratchDir on start
This fixes an exception on first launch.
2025-07-21 11:55:37 +09:00
Alex Osborne db63c7ec85 Seeds report: record redirect URI for statuses 303, 307 and 308
These can also redirect, not just 301 and 302.

Fixes #564
2025-06-30 22:24:29 +09:00
Alex Osborne 9b5900b528 FetchHTTP2: Avoid silently decoding gzip
Fixes `Recorder getContentReplayInputStream
WARNING: gzip problem; using raw entity instead`.
2025-06-12 21:36:14 +09:00
Adam Miller 0494d63ea2 fix: Avoid a NullPointerException when terminate is called again during shutdown 2025-06-11 17:44:52 -07:00
Alex Osborne 61af1d83c4 MitmProxy: Handle URLs generated by browsers but disallowed by java.net.URI 2025-06-11 20:38:54 +09:00
Alex Osborne 8a15156fa1 BrowserProcessor: Catch WebDriver timeouts and exceptions 2025-06-11 17:17:02 +09:00
Alex Osborne c3f9afe64b BrowserProcessor: use FetchHTTP2's configured proxy as an upstream proxy 2025-06-10 09:01:02 +09:00
Alex Osborne e68e4975c9 Rename to BrowserProcessor and -Behavior
After I added them to the Bean reference they seemed out of place with the DecideRules and RecordBuilders.

We had two classes called 'Browser' which is potentially confusing. It's also probably good to more clearly differentiate the ExtractLinks browser behavior from the Extractor processors.
2025-06-09 15:35:25 +09:00
Alex Osborne cf447f3bd9 Add Browser processor and behaviors to bean reference 2025-06-09 15:19:09 +09:00
Alex Osborne 1161d87217 Browser: Add processor report 2025-06-05 10:48:15 +09:00
Alex Osborne 2210cb7262 Browser: Handle navigation abort from downloads starting 2025-06-04 17:44:42 +09:00
Alex Osborne 5131ea4a80 Browser: Disable downloads in Firefox and Chrome
This hopefully will stop us filling up ~/Downloads with random junk.
2025-06-04 17:44:42 +09:00
Alex Osborne 722552feef Add Browser processor using WebDriver BiDi
The Browser processor can load a fetched page in a local web browser, record any requests the browser makes and run behaviors that interact with the page such as scrolling down and extracting links.

This differs from my previous attempt (ExtractorChrome) in a few ways:

- Uses the new WebDriver BiDi standard instead of the Chrome Devtools Protocol. The new protocol is mostly browser-agnostic, more consistent and hopefully more stable.

- Uses a MITM proxy instead of CDP request interception for recording sub-resources. That's partly because BiDi is still missing some key interception APIs. Even so in practice I found the proxy method loads pages faster and more reliably, likely because responses can be streamed incrementally, which helps a lot for large resources or server-sent events.

- Even when HTTP/2 is unavailable, the new FetchHTTP2 module does connection pooling which makes loading browser requests a lot faster. The original FetchHTTP opened a new connection for every request.

- The Browser processor can be configured with a list of behavior beans making it more customizable and extensible.

Obvious areas for future development:

- More Behavior beans: take screenshots, saveg the rendered DOM, run Browsertrix-compatible behavior scripts

- Support for remote WebDrivers (e.g. Selenium Server or cloud services)
2025-06-04 17:44:42 +09:00
Alex Osborne eaf72b5ce2 Add --web-auth basic command-line option
This option enables HTTP Basic authentication for the web interface instead of the default Digest authentication. This is useful when running Heritrix behind a reverse proxy that adds external authentication as typically they don't support Digest auth for the upstream server.

#641
2025-05-25 00:29:14 +09:00
Alex Osborne 0f0db370ee UI: Disable Jetty graceful shutdown for faster restarts
Graceful shutdown would be useful if you could deploy the UI in a high-availability configuration and direct new requests to a different instance while the current instance finished its outstanding ones. But as you can't, it's just making restarting Heritrix slow for little benefit.
2025-05-24 22:46:42 +09:00
Alex Osborne 679fde42c6 SelfTestBase: Use a dynamic port (port 0) for Heritrix web port
This stops the tests from failing when you happen to be running Heritrix or something else on port 8443.
2025-05-22 15:38:45 +09:00
Alex Osborne 567e27181d Upgrade webarchive-commons from 1.3.0 to 2.0.1 (removes httpclient 3) 2025-05-21 17:39:21 +09:00
Alex Osborne 33446c7a2b Upgrade to CodeMirror 6
This resolves some browser incompatibilities, allowing CodeMirror’s own find function to be re-enabled for reliable text search of content far outside the viewport.
2025-05-16 18:34:30 +09:00