766 Commits

Author SHA1 Message Date
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 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
Alex Osborne 1d37cbc237 StatisticsSelfTest: Update for new jetty version
Jetty error messages are included in the selftest crawl and now have
slightly different lengths.
2024-10-17 11:58:13 +09:00
Alex Osborne 891dbe7615 Re-add restlet repository with new URL
Turns out we do need this. Restlet isn't in central, the CI builds
were caching the artifacts.
2024-10-15 19:19:28 +09:00
Alex Osborne cb1143e438 Remove maven.restlet.com repository
It seems to have moved to maven.restlet.talend.com but the restlet artifacts are in Central anyway so we don't need it.
2024-10-09 12:29:06 +09:00
Alex Osborne 3c80dacabe CrawlJob: Replace joda-time with java.time (JSR-310) 2024-09-13 13:47:00 +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
Kristinn Sigurðsson 568db3cabc Added queue assignment variants that limit queue name length 2024-07-09 09:36:39 +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
fedor cdfcce8deb In case of a crashed job, the crawlsummaryreport says: "Finished - Abnormal exit from crawl while the ApplicationContext still reports running==true. So the console shows "Job is ACTIVE - Running", while the process crashed This change reports the exit status in this case. 2023-03-06 15:54:27 +01:00
Jonas Linde de5c419d8f Don't log authentication failures when header is missing
The digest authentication method requires an initial request to get a challenge to use for the subsequent authenmtication digest. This initial request is not an authentication attempt and should not be handled as a failed such.
2022-11-16 11:24:21 +01:00
Jonas Linde 4bad4713ba Set correct timestamp for lastFailureTime
The initial sleepMs value will be the negative of the current time minus 6 seconds. Using that value to calculate lastFailureTime will increase that large negative number with 6000 milliseconds for every failure which means that rate limiting won't occur until after millions of failed attempts.
2022-11-16 11:24:21 +01:00
Alex Osborne 3c79a0b2b1 Increase DiskSpaceMonitor default pause threshold to 8 GiB
When there's less than 5 GiB free BDB throws DiskLimitException which
Heritrix will likely be unable to handle gracefully and crawl job will
break in various ways. #499
2022-09-10 23:17:53 +09:00
Andy Jackson e83f4f9e02 Reset to SNAPSHOT 2022-07-28 10:56:59 +01:00
Andy Jackson 292d2998cb [maven-release-plugin] prepare release 3.4.0-20220727 2022-07-27 21:36:19 +01: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
Jamie Hoyle dd01689ace FetchHTTP: SOCKS5 proxy support
Closes #454
2022-03-28 10:24:07 +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 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
Kristinn Sigurdsson 69b023199d Add conf to not allow TLDs as seeds found via redirect from other seeds 2021-10-21 09:39:19 +00:00
Alex Osborne 17d760aa78 Remove obsolete Java < 1.6 version check
The parsing throws StringIndexOutOfBoundsException when the version
does not contain '.' such as version "17". This check could never
actually trigger as the class cannot even be loaded on 1.7 or earlier,
so there's no reason to keep it.

Fixes #439
2021-09-30 09:59:57 +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
Alex Osborne cd30fbcc3c Merge pull request #424 from internetarchive/ui-cleanup
UI: Refactor duplicate template rendering code
2021-08-09 14:41:28 +09: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 ed13a2b0c5 UI: Pull duplicate getEngine() methods up to BaseResource
Each direct subclass of BaseResource defines an identical getEngine()
method so let's pull it up to BaseResource. We can also don't need the
type cast anymore as BaseResource.getApplication() does it for us.
2021-08-01 17:19:35 +09:00
Alex Osborne 2719d022d5 UI: Refactor duplicated template code into a common render() helper
We remove the calls to setCharacterSet(UTF_8) since
WriterRepresentation's constructor does that anyway.
2021-08-01 17:19:35 +09:00
Alex Osborne 4233a930f0 UI: Use a single instance of Freemarker for the whole application
So we don't need to configure it separately in every resource class that
uses HTML templates.
2021-08-01 15:23:38 +09:00
Alex Osborne 721e89ca10 ToeThread: ensure currentCuri is finished before exiting
Thread interruption and certain other exceptions can cause a toe thread
to exit without informing the frontier that the current CrawlURI is
finished. This causes the job to get permanently stuck in the STOPPING
state.

This change adds a section to the finally block that will finish any
unfinished CrawlURI.

We also move the continueCheck() call after setCurrentCuri() to ensure
there's no window where InterruptedException can be thrown after the
frontier returns the next CrawlURI but before it gets assigned to
currentCuri.

Fixes #420
2021-07-26 15:26:09 +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 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 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 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 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
Andrew Jackson 0e93e22ba9 [maven-release-plugin] prepare for next development iteration 2021-06-21 15:42:52 +01:00
Andrew Jackson 846f2bc2cc [maven-release-plugin] prepare release 3.4.0-20210621 2021-06-21 15:42:46 +01:00
Kristinn Sigurdsson 37913cbb2e Graceful UI shutdown 2021-06-18 10:56:20 +00:00
Andrew Jackson a5beb7d6e9 [maven-release-plugin] prepare for next development iteration 2021-06-18 09:41:30 +01:00
Andrew Jackson 30598f8402 [maven-release-plugin] prepare release 3.4.0-20210618 2021-06-18 09:41:24 +01:00
Andrew Jackson 3423cab6a6 [maven-release-plugin] prepare for next development iteration 2021-06-17 14:39:00 +01:00