Commit Graph
2305 Commits
Author SHA1 Message Date
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
Adam Miller d2d9d4f157 Adding configurable MaxLogFileSize option to BdbModule 2021-07-19 15:49:56 +09:00
Alex Osborne ea42630608 docs: Add decide rules to bean reference 2021-07-13 21:49:27 +09: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
Alex Osborne 2a027a4064 docs: Fallback to field javadoc comments when setter javadoc unavailable
This enables us to generate documentation for more bean properties,
although a number of beans have javadoc on initializer code blocks which
makes it hard to access. This affects javadoc and IDE contextual
documentation too so should probably be fixed in the source code itself.
2021-07-12 19:31:13 +09:00
Alex Osborne 812ea0f720 Merge pull request #411 from internetarchive/chrome-request-capturing
ExtractorChrome: Capture requests made by the browser
2021-07-12 17:49:31 +09:00
Alex Osborne c54f18e3ff docs: Add most of the default config beans to the bean reference
Notably Decide Rules are still to be done.
2021-07-12 11:39:06 +09:00
Alex Osborne 4dfe48b1a0 docs: Strip @link and @code javadoc directives from bean reference 2021-07-12 09:28:04 +09:00
Alex Osborne 4a5fdcfaf0 docs: Add remaining link extractor to the bean reference 2021-07-12 09:23:08 +09:00
Alex Osborne d10be35f0c docs: Remove duplicate word 'Documentation' from page titles
Also include '3' to distinguish from the Heritrix 1 manual which is
still prevalent in search results.
2021-07-12 09:10:57 +09:00
Alex Osborne 63bd15535d docs: Fix links accidentally using Markdown syntax 2021-07-12 09:09:17 +09:00
Alex Osborne b3be9d01fe docs: Start a 'Bean Reference' document generated from the source code
This is meant to complement the javadoc by providing a reference
more suitable for users trying to configure crawls rather than
developers writing new modules.

The doc generation could still do with some improving and some of the
source javadoc comments need fixing up but this is already useful so I'm
committing what I have so far.
2021-07-11 15:56:37 +09:00
Alex Osborne 3f20e736d5 docs: Fix incorrectly indented line causing rst warning 2021-07-10 21:11:03 +09:00
Alex Osborne 503e40cfce docs: Add sections on FTP, SFTP and WHOIS to config guide 2021-07-10 21:09:52 +09:00
Alex Osborne c2c2b244de docs: Add a plugin for basic auto-generation of bean examples 2021-07-10 21:09:17 +09:00
Alex Osborne 6fb699c780 docs: s/Most/More/ documentation lives on the wiki
A large amount of core documentation has now been migrated here. There's
still a lot to go but I don't think 'most' applies anymore.
2021-07-10 12:42:17 +09:00
Alex Osborne 9b1919dbd3 docs: Remove inaccurate 2018 date from documentation footer
Large portions of the docs were first published much earlier in other
places and some have been updated since then. Rather than trying to
keep a date range up to date let's just remove the date. We don't use
dates in the source code boilerplate and my understanding is copyright
notices are not mandatory in almost all countries due to the Berne
Convention anyway so it's really just informational.
2021-07-10 12:37:35 +09:00
Alex Osborne b680bb206b docs: Add subdirectory explanation from wiki install page 2021-07-10 12:13:26 +09:00
Alex Osborne a84e0bb792 docs: Add an operating guide based on the contents of the wiki 2021-07-07 21:30:36 +09:00
Alex Osborne 507d7d91a3 docs: add getting-started.rst, configuring-jobs.rst and glossary.rst
Compiled from the wiki with some restructuring, reformatting and
updating for the current version of Heritrix.
2021-07-06 22:44:11 +09:00
Alex Osborne aa265855ef ExtractorChrome: Capture requests made by the browser
This adds a `captureRequests` flag to ExtractorChrome which is enabled
by default and causes requests made by the browser to be captured via
the devtools Network domain. Captured browser requests are sent to the
disposition chain for WARC writing and also to statistics tracker and
crawl log.

Browser requests are given the annotation "browser" so they can be
easily distinguished in the log from normal requests.

There are a quite a few limitations that will be addressed in followup
work:

* The frontier is entirely unaware of browser requests. This means they
  bypass quotas, ignore scope rules, politeness and don't count towards
  the statistics tracked by the frontier itself.

* There's no replay of previously saved resources so duplicate requests
  for the same URL end up being made.

* Heritrix's extractors do not currently process browser requests.

* Various error and failure cases likely need improving.
2021-07-06 00:59:26 +09:00
Alex Osborne 8bbc8261e1 Merge pull request #410 from internetarchive/warc-writer-stats-fixes
Warc writer stats fixes
2021-07-05 15:05:09 +09: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 512acfc616 Merge pull request #403 from internetarchive/extractor-chrome
Add ExtractorChrome to contrib
2021-06-30 14:07:04 +09:00
Alex Osborne 17375bac26 Merge pull request #409 from internetarchive/server-ip-attribute
Fix WARC-IP-Address and use a common server-ip CrawlURI attribute for all protocols
2021-06-30 12:34:21 +09:00
Alex Osborne 671eca0e76 Merge pull request #408 from internetarchive/crawl-log-syntax
Add basic syntax highlighting to the crawl.log viewer
2021-06-30 12:33:23 +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
Alex Osborne c26307068f Merge pull request #406 from internetarchive/run-job-option
Fix and document the -r option which runs a named job on startup
2021-06-25 11:53:14 +09:00
Alex Osborne 6835d0940e Merge pull request #407 from internetarchive/fix-maven-warnings
Fix a couple of boring maven warnings
2021-06-25 11:52:53 +09:00
Alex Osborne 6f32d018be Merge pull request #405 from internetarchive/faster-tests
Speed up test suite
2021-06-25 11:52:40 +09:00
Alex Osborne 04f958e987 Merge pull request #404 from internetarchive/github-ci
Switch from Travis CI to Github Actions
2021-06-25 11:52:01 +09:00
Alex Osborne e9d5966c22 Add basic syntax highlighting to the crawl.log viewer
Colour-codes the fetch status codes and shows the corresponding
status message when you hover over them. No more referring to the
glossary. :-)
2021-06-22 23:06:53 +09:00
Alex Osborne 039634cee0 Update relocated dependencies
Fixes the Maven warnings:

    [WARNING] The artifact poi:poi:jar:2.5.1 has been relocated to
        poi:poi:jar:2.5.1-final-20040804
    [WARNING] The artifact itext:itext:jar:1.3 has been relocated to
        com.lowagie:itext:jar:1.3
2021-06-22 20:52:55 +09:00
Alex Osborne e47469b69c Remove obsolete prerequisites element from parent pom
Maven 2.0.9 was 13 years ago. I think we can safely assume everyone has
a newer maven now. ;-)

This stops Maven printing this warning:

    [WARNING] The project org.archive:heritrix:pom:3.4.0-SNAPSHOT uses
    prerequisites which is only intended for maven-plugin projects but
    not for non maven-plugin projects. For such purposes you should use
    the maven-enforcer-plugin.
2021-06-22 20:49:36 +09:00
Alex Osborne a38fda2b72 Fix and document the -r option which runs a named job on startup
I noticed there was a non-functional and undocumented -r command-line
option which automatically runs a given job when Heritrix starts. I
suspect this was never finished due to the bug that was fixed in commit
643f16d where launch() returns before the job has been launched.

This option seems like it would be very useful so you could run a job
from cron or another scheduling program without having to use the
REST API to start it. Therefore I've enabled it and extended it so it
also unpauses, waits for the crawl to finish and then exits.
2021-06-22 20:16:23 +09:00
Alex Osborne 643f16d20c Remove arbitrary 1.5 second sleep() when launching jobs
I think the sleep is supposed to make launch() not return until the job
has actually been launched but it doesn't work as launch()
and getCrawlController() are both synchronized therefore the
launcher thread can't actually call startContext() until launch()
returns after sleeping.

So let's replace the sleep call with join and unsynchronize launch()
so it doesn't deadlock. All the relevant methods it calls seem to be
synchronized so I think it's no worse to not synchronize it itself.
2021-06-22 19:43:38 +09:00
Alex Osborne c0cb68f754 Speed up the unit tests by changing some 1s polling sleeps to 250ms
Lots of 1 second sleeps add up fast. On my PC this reduces the runtime
of `mvn clean test` from about 3m 40s to about 1m 50s.

Ideally we'd probably re-architect some this to use a notification
mechanism instead of polling but that's easier said than done and this
is a pretty big improvement by itself.
2021-06-22 17:10:50 +09:00
Alex Osborne 16a49d3527 Remove arbitrary 1.5 second sleep() when launching jobs
I think the sleep is supposed to make launch() not return until the job
has actually been launched but it doesn't work as launch()
and getCrawlController() are both synchronized therefore the
launcher thread can't actually call startContext() until launch()
returns after sleeping.

So let's replace the sleep call with join and unsynchronize launch()
so it doesn't deadlock. All the relevant methods it calls seem to be
synchronized so I think it's no worse to not synchronize it itself.
2021-06-22 17:10:50 +09:00
Alex Osborne d643770a7c Put slowest unit tests behind a -DrunSlowTests=true option
Shaves about 2 minutes off the Heritrix build time.
2021-06-22 17:10:50 +09:00
Alex Osborne 175f2938d1 Workaround Maven connection timeout in Github Action 2021-06-22 13:13:18 +09:00
Alex Osborne a5c610f488 Switch from Travis CI to Github Actions
The CI builds are no longer working as travis-ci.org has been
discontinued so switch to using Github Actions instead.

We need to use a custom settings.xml for now as Maven now blocks
non-https repositories by default and builds.archive.org isn't
available via https.
2021-06-22 12:16:08 +09:00
Andrew Jackson c9369da6b8 Updated changelog. 2021-06-21 22:09:51 +01:00