Commit Graph
935 Commits
Author SHA1 Message Date
Andy Jackson 7c4453cf66 [maven-release-plugin] prepare for next development iteration 2022-07-27 21:41:58 +01:00
Andy Jackson b0505662d7 [maven-release-plugin] prepare release 3.4.0-20220727 2022-07-27 21:41:58 +01:00
dependabot[bot] 82dee7c89c Bump jsch from 0.1.52 to 0.1.54 in /modules
Bumps jsch from 0.1.52 to 0.1.54.

---
updated-dependencies:
- dependency-name: com.jcraft:jsch
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-07 23:27:52 +09:00
Alex Osborne 1209b2d42f Add robotsTxtOnly robots policy
This policy obeys robots.txt but ignores meta nofollow. We're
increasingly frequently encountering sites which fail to be archived
properly due to usage of this meta tag but where the robots.txt file
contains reasonable rules. In many cases it seems to be unintentional,
and we've even had questions from webmasters asking why archiving was
failing when they were explicitly allowing us in robots.txt.
2022-07-07 16:18:39 +09:00
csrster 702bfa5170 Removed a potential NPE in hashCode method to CrawlURI which was fatal for heritrix Browse Beans functionality.
(cherry picked from commit 96e47a2f695a3116d89f02e7cb529ca181d21444)
2022-06-07 17:48:29 +02:00
Alex Osborne 9644780a54 ExtractorHTML: Add --robots option to main()
Useful for testing link extraction on pages that use a robots meta tag.
2022-05-11 16:31:48 +09:00
Alex Osborne 914756f155 ExtractorHTML: Add a main() method to run the extractor standalone
This makes troubleshooting link extraction problems much easier.
2022-04-22 16:44:54 +09:00
Alex Osborne aac74411a1 ExtractorHTML: Fix srcset by normalizing elementContext() to lowercase
This ensures that when we later compare the context in processEmbed()
we don't need to deal with variants like srcSet or SRCSET. Note that
we're already sometimes lowercasing it later in HTMLLinkContext.get().

Fixes #477.
2022-04-22 16:44:53 +09:00
Clemens Klein-Robbenhaar ed332bcb9e Add support for DNS-over-HTTPS lookups
- scrap setter for "enableDnsOverHttpResolve", too
2022-04-09 23:26:07 +02:00
Clemens Klein-Robbenhaar fdde6d87a0 Add support for DNS-over-HTTPS lookups
- instead of "borrowing" the configured proxy from
  the fetchHttp bean, use proxy values defined via
  global options, to avoid interference with other
  jobs running in parallel (or at least make them
  explicit).
  The "fetchHttp" bean also uses these settings,
  if no bean specific settings are used.
- remove the "enableDnsOverHttpResolves", and rely
  on a non-empty "dnsOverHttpServer" value to signal
  that DoH should be used.
2022-04-09 23:04:37 +02:00
Clemens Klein-Robbenhaar 2144abb2cb Add support for DNS-over-HTTPS lookups
- use the "DohResolver" from the dnsjava library
  to make DoH lookups
- to enable and configure it, add two new
  properties
  * "enableDnsOverHttpResolves" (boolean)
  * "dnsOverHttpServer" URL to the DoH Server
- as one use case for DoH is being located
  behind a firewall, also support using a proxy
  to access the DoH server; the proxy from
  the FetchHTTP bean is reused in that case

Fixes #211
2022-04-08 11:48:52 +02:00
Alex Osborne c3f140b9b5 JDK18 support: Update Groovy to 3.0.10
Fixes #473 "Unsupported class file major version 62".
2022-04-01 11:34:11 +09:00
Alex Osborne 971f04dd23 TransclusionDecideRule: Don't treat sitemap links ('M') as transclusions
We should only crawl sitemaps and sitemap links if they are in the
primary SURT scope. Otherwise we'll start crawling the sitemaps of
every site an embedded resource is pulled in from even when they
should be out of scope.

Fixes #469
2022-03-28 13:47:49 +09:00
Alex Osborne d796491995 FetchHTTPTest: Fix SOCKS server startup race
testSocksProxy() is failing on the GitHub action CI runs but I can't
reproduce the issue locally. I'm just guessing this is what's causing it
but this should be fixed anyway to avoid future intermittent failures.
2022-03-28 13:26:53 +09:00
Alex Osborne 0dc05408da FetchHTTPTest: Don't test IP binding on macOS utun network interfaces
This avoids a test failure on macOS machines that are running Wireguard.
2022-03-28 11:40:48 +09:00
Alex Osborne 0d6c04fda5 FetchHTTPTest: Update to junit 4
By replacing the custom TestSuite with junit 4 @BeforeClass and
@AfterClass annotations running individual tests by themselves now works
correctly.

Since FetchHTTPTest now just contains the utility code for the test
servers we rename it to FetchHTTPTestServers. FetchHTTPTests (which
contains the actual tests) can now follow the standard naming
scheme as FetchHTTPTest.
2022-03-28 11:35:45 +09:00
Jamie Hoyle dd01689ace FetchHTTP: SOCKS5 proxy support
Closes #454
2022-03-28 10:24:07 +09:00
Alex Osborne 1c4831d6e9 JerichoExtractorHTML: Determine LINK tag type by parsing REL attribute
This commit extends ExtractorHTML's link[rel] parsing support added in
dcf9b040 to also cover JerichoExtractorHTML.
2022-01-27 12:07:07 +09:00
Alex Osborne dcf9b04007 ExtractorHTML: Determine LINK tag type by parsing REL attribute
Only treat icons, stylesheets and (tentatively) resource preloads as
embedded resources. Treat most other link types as navigation links.

Previously we were treating all link tags as embedded resources
including links like 'next', 'prev', 'canonical', 'author' which could
pull in resources that should normally be considered out of scope.

For example crawling a page containing an author link lke:

   <link href="http://twitter.com/example" rel="author">

Would end up transitively pulling 200+ MB of Twitter profile pages in
multiple languages into a crawl for which twitter.com is not even
supposed to be in scope at all.

Fixes #263
2022-01-25 17:57:54 +09:00
Alex Osborne d40a025692 Merge pull request #452 from internetarchive/handle-nulls-in-content-length-header
FetchHTTP: Handle null characters in the Content-Length header
2022-01-17 16:20:12 +09:00
Clemens Klein-Robbenhaar 261fa318b4 FetchHTTPRequest: handle HTTPS requests via proxy
- do not send the scheme/host/port part of the request
  even when using a proxy, if the scheme is https
- in case of a https request send over a proxy, do not
  wrap the first input/output streams (which only contain
  the data for the `CONNECT` request), but the ones after
  them, which contain the actual data

Fixes #191
2022-01-10 08:57:22 +01:00
Alex Osborne a3d651ba46 FetchHTTP: Handle null characters in the Content-Length header
If a null character appears in the Content-Length header Firefox and
Chrome seem to ignore the rest of the value so let's do the same.
Let's also handle the exception when parsing the content-length fails.

Fixes #449
2021-12-13 15:41:38 +09:00
Alex Osborne d63cb9af8b Merge pull request #444 from internetarchive/fix-dnsjava-selector-thread
FetchDNS: Keep dnsjava selector thread out of ToePool
2021-11-27 12:41:11 +09:00
Alex Osborne c46cfd1c31 Merge pull request #441 from netarchivesuite/iipc-master
Enabled configurable url-matching and extraction for sitemaps.
2021-11-02 10:34:26 +09:00
Alex Osborne 1832c5ef89 FetchDNS: Keep dnsjava selector thread out of ToePool
dnsjava will create its global selector thread on first DNS lookup.
Since the first lookup occurs on a toe thread then this will cause the
selector thead to join the job's toe thread group. This is a problem
because when the job is terminated ToePool sends an interrupt to all
threads in the thread group which the dnsjava selector thread is
not expected and never clears. The interrupted state then causes
select() to return immediately instead of sleeping so it consumes
100% CPU.

So workaround this by doing a dummy lookup when FetchDNS is loaded,
this ensures the first lookup happens on the web server thread that
handles the job build action instead of a toe thread.

Fixes: 045b2516da ("Update to latest version of dnsjava")
2021-11-01 16:15:27 +09:00
Alex Osborne 513c5fc487 FetchDNS: Move DNS cache init from CrawlController
Since the cache is global we only need to configure it once, not every
time we start a job. By moving it we keep the code that interfaces with
dnsjava centralized in FetchDNS.

Looks like dnsjava no longer uses a cleaner thread so remove the comment
referring to it.
2021-11-01 16:15:27 +09:00
Andrew Jackson 024a7772b5 [maven-release-plugin] prepare for next development iteration 2021-09-23 22:08:33 +01:00
Andrew Jackson fedff1e2c7 [maven-release-plugin] prepare release 3.4.0-20210923 2021-09-23 22:08:30 +01:00
Andy Jackson 3f4535a933 Add safer cookie iteration, as per #427. 2021-09-06 11:05:12 +01:00
Andrew Jackson ddb695abad [maven-release-plugin] prepare for next development iteration 2021-08-03 09:56:26 +01:00
Andrew Jackson ba44cce7f2 [maven-release-plugin] prepare release 3.4.0-20210803 2021-08-03 09:56:20 +01:00
Alex Osborne eb67cfb215 Merge pull request #423 from internetarchive/dont-extract-data-uris
Don't extract data URIs
2021-08-03 07:43:17 +09:00
Andy Jackson 4d5b2dc3fe Merge pull request #397 from ukwa/upgrade-httpclient-4-5
Upgrade httpclient to 4.5
2021-08-02 09:19:30 +01:00
Alex Osborne 33a5d70209 ExtractorSitemap: Use logUriError() helper like other extractors 2021-07-30 15:57:09 +09:00
Alex Osborne 1032c0ec40 ExtractorHTML: Avoid allocating strings for data: URIs when possible
Data URIs can be very large. ExtractorHTML mostly works with off-heap
CharSequences so by delaying the conversion of outlinks to strings
until after filtering out data URIs we can potentially avoid some
very large String allocations.
2021-07-30 15:57:09 +09:00
Alex Osborne e33e1ff398 Extractor: ignore data URIs when adding outlinks 2021-07-30 15:57:09 +09:00
Alex Osborne 91ef23eddf ExtractorPDFContext, ExtractorYoutubeDL: use addOutlink() helper method 2021-07-30 14:25:34 +09:00
Alex Osborne f4bd5d1015 Upgrade Groovy to latest stable version (3.0.8) for JDK 16 compatibility
Fixes #419
2021-07-25 14:11:13 +09:00
csrster 523200ada6 Enabled configurable url-matching and extraction for sitemaps. 2021-07-15 15:35:03 +02:00
Alex Osborne 09e3ff3568 Everywhere: Fix dangling JavaDoc comments
JavaDoc comments need to be directly above a class, method or field
declaration to be used by IDEs and generated documentation. We had some
doc comments that were attached to instance initialization blocks and
thus were being ignored. This invalid doc comment positioning was
presumably an accidental consequence of the conversion of fields to
KeyedProperties.

This change moves most of the dangling doc comments to setter methods
where it can be seen by tools. There were a couple of dangling doc
comments above package statements. These are moved above the class
declaration or removed entirely when empty.
2021-07-12 21:38:48 +09:00
Andrew Jackson 0640cae4a9 Enabled AuthCache but not for DigestScheme. 2021-07-05 21:29:16 +01:00
Adam Miller ca3397e346 Fixing race condition on totalBytesWritten 2021-07-03 12:10:21 +09:00
Adam Miller 111b77b4aa Add checkpoint store/load functionality for warc writer stats 2021-07-03 12:10:21 +09:00
Alex Osborne 200f1cf38f DNS: Use the new protocol-agnostic server IP attribute
Also fixes an issue where in some cases we would incorrectly output
WARC-IP-Address for DNS records as "/127.0.0.53:53" instead of
"127.0.0.53".
2021-06-25 16:39:59 +09:00
Alex Osborne c378c46e49 WHOIS: Replace A_WHOIS_SERVER_IP with the generic A_SERVER_IP one 2021-06-25 14:39:26 +09:00
Alex Osborne 6b42c608a5 BaseWARCRecordBuilder: remove now unused getHostAddress(curi) helper
We now save the server IP at fetch time and retrieve it with
CrawlURI.getServerIP()
2021-06-25 14:39:26 +09:00
Alex Osborne ef3b428061 FTP: Save server IP at fetch time and use in WARC-IP-Address 2021-06-25 14:39:26 +09:00
Alex Osborne 13c0f65294 FTP: Implement a basic fetch test 2021-06-25 14:09:38 +09:00
Alex Osborne 28ea9c4ba5 HTTP: Populate WARC-IP-Address with server's IP address
Fixes #396
2021-06-25 13:34:40 +09:00
Alex Osborne 5a6531b296 CrawlURI: Introduce a protocol-agnostic server-ip attribute
The vast majority of protocols we use will have a server IP address,
so rather than having a separate one for each protocol let's just use
a single common one.
2021-06-25 13:24:20 +09:00