987 Commits

Author SHA1 Message Date
Alex Osborne 370f0480e5 [maven-release-plugin] prepare release 3.7.0 2025-02-03 14:11:18 +09:00
Alex Osborne 8cf3e476d1 Bump ftpserver-core from 1.2.0 to 1.2.1 2025-02-03 14:08:51 +09:00
Alex Osborne 4e8bda1a07 ExtractorHTML: Add obeyRelNofollow option
When enabled this option causes regular links annotated with rel=nofollow to not be extracted. This is useful for sites that use rel=nofollow to hint crawler traps.
2025-01-13 15:34:38 +09:00
Alex Osborne 4c4510a364 Merge pull request #632 from internetarchive/groovy-config
Add Groovy crawl configs
2024-12-24 12:11:41 +09:00
Alex Osborne d13acddfc4 Remove usages of fastutil
fastutil is our largest dependency, consuming about a third of the
total Heritrix distribution size but we only use a couple of trivial
classes from it.

FPMergeUriUniqFilter (which I'm not sure anyone uses anyway), uses
LongArrayList so this change replaces it with a basic version that does
just enough.

The unsynchronized FastBufferedOutputStream usages are likely
unnecessary these days thanks to the JVM's lock optimisations and for
the one in CrawlerJournal, the GZIPOutputStream is still going to
be synchronizing anyway.
2024-12-20 14:37:20 +09:00
Alex Osborne 19c24b9006 Add Groovy crawl configs
This enables crawl configuration files to use Spring's [Groovy Bean Definition DSL] as an optional alternative to Spring XML. It uses the same bean configuration model but the syntax is more terse and human-readable. No more need for `&` in seed URLs. :-)

```groovy
   checkpointService(CheckpointService) {
        checkpointIntervalMinutes = 15
        checkpointsDir = 'checkpoints'
        forgetAllButLatest = true
   }
```

It also enables some powerful scripting capabilities. For example, defining a custom DecideRule directly in the crawl scope:

```groovy
scope(DecideRuleSequence) {
    rules = [
        new RejectDecideRule(),
        // ACCEPT everything linked from a .pdf file
        new PredicatedDecideRule() {
             boolean evaluate(CrawlURI uri) {
                 return uri.via?.path?.endsWith(".pdf")
             }
        },
        // ...
    ]
}
```

The main downsides are defining nested inner beans can be a bit awkward, some of the errors can be cryptic, and you can't just manipulate the config files with an XML parser.

This commit includes a Groovy version of the default crawl profile for reference, but doesn't expose a way to use it in the UI yet. For now, you need to manually create a `crawler-beans.groovy` file in your job directory.

[Groovy Bean Definition DSL]: https://docs.spring.io/spring-framework/reference/core/beans/basics.html#beans-factory-groovy
2024-12-01 00:14:42 +09:00
Alex Osborne 2b2179d9c7 Update pom.xml for 3.6.1-SNAPSHOT 2024-11-29 21:06:57 +09:00
Alex Osborne be81b3a407 Update maven release plugins for Java compat 2024-11-29 20:57:01 +09:00
Alex Osborne c67ff98b2d [maven-release-plugin] prepare for next development iteration 2024-11-29 20:46:02 +09:00
Alex Osborne 2d903ae772 [maven-release-plugin] prepare release 3.6.0 2024-11-29 20:42:40 +09:00
Alex Osborne d5b4391cce Bump java-socks-proxy-server from 1.1.0 to 4.1.2 2024-11-29 17:12:43 +09:00
Alex Osborne 5778747527 Bump crawler-commons from 1.0 to 1.4 2024-11-29 17:12:43 +09:00
Alex Osborne faf26adbb5 Bump jsch from 0.1.54 (jcraft) to 0.2.21 (mwiede fork)
The original project has been unmaintained since 2018 and doesn't
support the algorithms to connect to current versions of openssh.
2024-11-29 17:12:43 +09:00
Alex Osborne 631620c92b Bump groovy from 4.0.21 to 4.0.24 2024-11-29 17:12:43 +09:00
Alex Osborne a93761d0d5 Bump pdfbox from 3.0.1 to 3.0.3 2024-11-29 13:40:27 +09:00
Alex Osborne b736bd6a24 Bump slf4j from 1.6.6 to 2.0.16 2024-11-28 21:05:12 +09:00
Alex Osborne 8ec614224e Merge pull request #625 from internetarchive/spring-6.1
Upgrade to Spring 6.1 (and Java 17 minimum)
2024-11-28 16:43:30 +09:00
Alex Osborne 13075ec444 Merge pull request #624 from kris-sigur/strict-if-url-matching
Force strict if URL matching regex.
2024-11-20 17:12:08 +09:00
Alex Osborne 29cc045c22 Merge pull request #623 from kris-sigur/manfest-links
Treat manifest hops same as navlink hops
2024-11-20 17:11:55 +09:00
Alex Osborne dd210c8e70 Replace Spring's removed @Required annotation with our own
Spring 6 removed @Required and they suggest using constructor injection instead. If we switched our beans to that we'd break existing Heritrix crawl configs. So this change implements our own basic version so we still get errors when a @Required property is null.
2024-11-20 16:30:15 +09:00
Kristinn Sigurðsson 4a49557b8b Force strict if URL matching regex.
Adds a list of regular expressions that URLs being processed by the
ConfigurableExtractorJS are evaluted against. If they match the
extraction is performed in strict mode, even if strict mode is not set.

This requires a minor modification to ExtractorJS so that the CrawlURI
is passed to the shouldAddUri method that ConfigurableExtractorJS
overrides.
2024-10-30 08:53:08 +00:00
Kristinn Sigurðsson 5ed6147c3e Treat manifest hops same as navlink hops
Links from manifests (e.g. sitemaps) should not receive the preferential
treatment sometimes accorded to "transitive" hops. Most commonly this is
about giving priority to discovered (probable) embeds.

Manifests should be regarded as more analogous with a directory page.
2024-10-29 08:53:15 +00:00
Alex Osborne 25c73da7e3 [maven-release-plugin] prepare for next development iteration 2024-10-29 15:18:54 +09:00
Alex Osborne 0aec63b70f [maven-release-plugin] prepare release 3.5.0 2024-10-29 15:01:16 +09:00
Alex Osborne c25e57a4a1 Bump version to 3.4.1-SNAPSHOT 2024-10-18 20:54:12 +09:00
Alex Osborne 7a3d29ad4d Bump ftpserver-core from 1.1.1 to 1.2.0 2024-10-18 20:38:49 +09:00
Alex Osborne 6157645545 Merge pull request #612 from internetarchive/config-extractor-js-default-strict
Set default value for ConfigurableExtractorJS strict property
2024-10-18 20:32:58 +09:00
Alex Osborne cbd7f37ed9 Replace littleproxy with jetty-proxy (to remove dependency on log4j)
littleproxy has not been updated since 2017 and has various out of date
dependencies. Since we're using jetty for HTTP server testing anyway, we
 may as well use it as the proxy too.
2024-10-18 17:28:03 +09:00
Alex Osborne 3d1b7e37ca Remove log4j 2024-10-17 19:25:53 +09:00
Kristinn Sigurðsson af280584f0 Set default value for strict. 2024-10-16 09:25:02 +00:00
manderson 3a447b5e61 ExtractorHTML: Treat 'cite' attribute as navlink instead of embed
The cite attribute is used to identify the source document of a blockquote. But ExtractorHTML was treating it as an embed which can cause out of scope pages to be included in a crawl incorrectly. Browsers don't use the cite attribute currently so there might be an argument for ignoring it entirely but let's at least not treat it as an embed.
2024-09-10 12:42:15 +09:00
Alex Osborne c7c492b507 [maven-release-plugin] prepare for next development iteration 2024-09-09 15:28:44 +09:00
Alex Osborne 11fcbe71f3 [maven-release-plugin] prepare release 3.4.0-20240909 2024-09-09 15:28:44 +09:00
Alex Osborne 2c9a5c97ab Merge pull request #586 from nla/kryo-5.6.0
Update to kryo 5.6.0
2024-09-06 11:10:17 +09:00
Leslie Bellony ca3508f55f Add new HTML tags and attributes for ExtractorHTML (#604) 2024-09-04 17:49:40 +02:00
Kristinn Sigurðsson 9ee8520604 ConfigurableExtractorJS (#602)
Adds ConfigurableExtractorJS

Minor modification to ExtractorJS to make subclassing easier
2024-09-03 12:24:08 +00:00
Adam Miller 2d862c3e28 Merge pull request #600 from internetarchive/adam/restore-has-prerequisite-behavior
Reset CrawlURI status for hasPrerequisite() so that it isn't preserved between attempts
2024-08-08 12:05:22 -07:00
Kristinn Sigurðsson cd3a424176 Merge pull request #597 from kris-sigur/extractorhttp-implicit
Add a more general support for inferred path discovery
2024-08-08 07:37:45 +00:00
Kristinn Sigurðsson 0faf338f91 Merge pull request #595 from internetarchive/meta-content-name
Apply speculativeFixup before evaluating meta content
2024-08-08 07:36:36 +00:00
Adam Miller ec164ec77f Reset CrawlURI status for hasPrerequisite() so that it isn't preserved between attempts 2024-08-07 10:30:35 -07:00
Adam Miller b22d6ce2e1 Merge pull request #593 from internetarchive/adam/add-crawl-log-logging-to-extractoryoutubedl
feat: Add logging to crawl.log for metadata records created by ExtractorYoutubeDL
2024-08-07 10:17:25 -07:00
Martin Czygan 3128ae5b84 fix: ScriptedProcessor function name in docs 2024-07-22 14:15:40 +02:00
Kristinn Sigurðsson 778a57b3b4 Add a more general support for inferred path discovery 2024-07-08 13:05:56 +00:00
Kristinn Sigurðsson 0dd3a2506d Apply speculativeFixup before evaluating meta content
This avoids treating meta conent values like "Example.com" as relative
urls as they are converted to absolute URLs. This is already done for
speculative JS extraction.

The example sited above is common in meta "sitename" elements where the
sitename is something dot com or similar.
2024-07-03 11:09:57 +00:00
Alex Osborne 74d6b37779 Update to kryo 5.6.0
This eliminates a few more very old dependencies that aren't in Maven Central.

Our direct usage of the unsupported sun.reflect.ReflectionFactory JDK API (which newer compilers complain about) is no longer needed as Kryo now has a SerializingInstantiatorStrategy that does roughly the same thing.
2024-06-18 10:05:56 +09:00
Adam Miller 55dc23daaf feat: Add unit tests for ExtractorYoutubeDL WARC record building 2024-06-07 17:03:37 -07:00
Adam Miller 3f764f7904 feat: Add logging to crawl.log for metadata records created by ExtractorYoutubeDL 2024-06-06 14:21:43 -07:00
Alex Osborne 0c251c7c34 Update groovy to 4.0.21 for JDK 22 support 2024-05-15 23:13:18 +09:00
Alex Osborne 3700628cb2 Switch PDFParser and ExtractorPDF to pdfbox 2024-02-21 14:48:54 +09:00
Alex Osborne c467065b79 Add PDFParserTest 2024-02-21 14:48:50 +09:00