Commit Graph
2433 Commits
Author SHA1 Message Date
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
Alex Osborne 09f75e389a docs/glossary: Add manifest (M) to discovery path 2022-06-22 15:44:44 +09:00
Alex Osborne 1d490c779b Merge pull request #488 from netarchivesuite/crawluri-npe
Removed a potential NPE in hashCode method to CrawlURI which was fata…
2022-06-08 13:35:23 +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
dependabot[bot] e8be86f7cf Bump gson from 2.8.6 to 2.8.9 in /contrib
Bumps [gson](https://github.com/google/gson) from 2.8.6 to 2.8.9.
- [Release notes](https://github.com/google/gson/releases)
- [Changelog](https://github.com/google/gson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/gson/compare/gson-parent-2.8.6...gson-parent-2.8.9)

---
updated-dependencies:
- dependency-name: com.google.code.gson:gson
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-24 12:32:27 +09:00
Alex Osborne a35cd44a73 Docs: Add section to config guide about http and form credentials
Based on https://github.com/internetarchive/heritrix3/wiki/Credentials
2022-05-24 12:01:56 +09: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
dependabot[bot] e1e7adf088 Bump spring-core from 5.3.18 to 5.3.19 in /commons
Bumps [spring-core](https://github.com/spring-projects/spring-framework) from 5.3.18 to 5.3.19.
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.18...v5.3.19)

---
updated-dependencies:
- dependency-name: org.springframework:spring-core
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-27 15:09:33 +09:00
Alex Osborne 9fe64a6f0c ExtractorChrome: If disabled only connect the browser process on demand
This avoids creating browser processes for jobs that have it disabled.
If a job has it disabled by default but enables it with a sheet we'll
start it when needed.

We still connect on start when enabled to provide early error feedback.
2022-04-27 14:17:00 +09:00
Alex Osborne 207adec12c Merge pull request #478 from internetarchive/srcset-fix 2022-04-27 14:11:09 +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
Alex Osborne 55078c078d Merge pull request #476 from ClemensRobbenhaar/issue211-dns-over-https 2022-04-10 08:59:59 +09:00
Clemens Klein-Robbenhaar f5c83ce368 Add support for DNS-over-HTTPS lookups
- docs: lets see if we can set a link
  to another chapter
2022-04-09 23:32:55 +02: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 9648c98c77 [misc] rst formatting 2022-04-08 12:14:11 +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 8557533d11 ChromeWindow: Ignore WebsocketNotConnectedException in window.close()
This usually means the browser has exited and so there's no window left
to close.
2022-04-08 12:25:30 +09:00
Alex Osborne adc68583cc ChromeWindow: Ignore events once we've requested the window be closed 2022-04-08 12:25:30 +09:00
Alex Osborne e5d8d53993 ExtractorChrome: Only run on pages with 2xx status codes
Let's not waste time running the browser on error pages.
2022-04-08 12:25:30 +09:00
Alex Osborne 42ac612e1a ExtractorChrome: Add a counter to give each recorder a unique basename
We use a static (global) counter so that if a job uses multiple
instances of ExtractorChrome they don't clobber each other.
2022-04-08 12:25:30 +09:00
Alex Osborne f2b3722b0b ChromeProcess: Disable features that prompt or cause background traffic
Disables browser features like phishing protection, translation, crash
and metrics reporting, OS keychain integration and such that can cause
unnecessary network traffic or that can cause the browser to get stuck
in a prompt. Some of these options may be unnecessary in headless mode,
but we may as well keep them in case in future we want to support headed
mode for debugging.
2022-04-08 12:25:30 +09:00
Alex Osborne e5bff6a06a ExtractorChrome: Add commandLineOptions property
Allows for custom browser configuration such as using a proxy server or
increasing log verbosity.
2022-04-08 12:25:30 +09:00
Alex Osborne 0378e0d123 ChromeProcess: Use the --disable-crash-reporter command-line option
This avoids an ownership conflict over /tmp/Crashpad.
2022-04-08 12:25:30 +09:00
Alex Osborne f2af65122c ChromeProcess: Add macOS default install path to DEFAULT_EXECUTABLES 2022-04-08 12:25:30 +09:00
dependabot[bot] ce0b5e3a24 Bump spring-beans from 5.3.14 to 5.3.18 in /commons
Bumps [spring-beans](https://github.com/spring-projects/spring-framework) from 5.3.14 to 5.3.18.
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.14...v5.3.18)

---
updated-dependencies:
- dependency-name: org.springframework:spring-beans
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-06 10:21:56 +09:00
Alex Osborne 0698545eec JDK18 support: Run GitHub CI tests on JDK 18 2022-04-01 11:34:11 +09: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 69f231b8ab Merge pull request #468 from internetarchive/remove-jna 2022-03-03 17:16:34 +09:00
Alex Osborne c6d4251e4f Merge pull request #459 from internetarchive/parse-link-rel 2022-03-03 17:16:22 +09:00
Alex Osborne 98f42de863 Merge pull request #460 from internetarchive/dependabot/maven/commons/org.springframework-spring-core-5.3.14 2022-03-03 17:14:46 +09:00
Alex Osborne 71b40cf882 Use Files.createLink() and Files.createSymbolicLink() instead of JNA
We don't need to support Java < 7 anymore. This simplifies the
code and should improve portability to platforms our old version of
JNA doesn't support like Apple Silicon.

Fixes #467
2022-03-02 21:37:27 +09:00
Alex Osborne 568d5cedfe Merge pull request #461 from kris-sigur/seed-redirect-tld
Add conf to not allow TLDs as seeds found via redirect from other seeds
2022-02-14 07:46:09 +09:00
Alex Osborne 4a75fe1fea Merge pull request #465 from ClemensRobbenhaar/issue464
Fix name of parameter in setMaxLogFileSize
2022-02-14 07:45:15 +09:00
Clemens Klein-Robbenhaar fae2ccb88d Fix name of parameter in setMaxLogFileSize
Fixes #464
2022-02-13 13:01:58 +01: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
dependabot[bot] ab27a48e26 Bump spring-core from 5.3.3 to 5.3.14 in /commons
Bumps [spring-core](https://github.com/spring-projects/spring-framework) from 5.3.3 to 5.3.14.
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.3...v5.3.14)

---
updated-dependencies:
- dependency-name: org.springframework:spring-core
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-27 03:03:08 +00: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
Alex Osborne aa4f0f9933 Merge pull request #457 from ClemensRobbenhaar/issues191-https-over-proxy
Fix issue#191: "RIS already open for ToeThread..." exception during https pages crawl over proxy
2022-01-17 16:18:13 +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
Oliver Schihin c4edadf1a8 Configuration guide: clarify usage of ContentTypeMatchesRegexDecideRule 2021-12-21 19:10:22 +09: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 140211e8c2 Link to the structured documentation in the README 2021-12-13 14:20:33 +09:00