Commit Graph

839 Commits

Author SHA1 Message Date
morokosi 13ba0b2b67 optimize imports 2020-04-30 22:40:00 +09:00
morokosi 18bee39a4c fix discarded future value 2020-04-30 22:39:51 +09:00
Alex Osborne 7764f9265f Merge pull request #320 from bnfleb/sftp
Add support for the SFTP protocol
2020-04-24 08:13:39 +09:00
Leslie Bellony aad54c3cb3 rename variable + javadoc 2020-04-23 15:43:30 +02:00
Clara Wiatrowski 5e948883fa Add overrides in JerichoExtractorHTMLTest 2020-04-22 15:33:23 +02:00
Clara Wiatrowski 0d1f4ea84f Add parsing case data-* 2020-04-22 11:48:05 +02:00
Clara Wiatrowski cc29bb97d1 Revert ExtractorHTML 2020-04-22 11:33:24 +02:00
Clara Wiatrowski 6710c8dba3 Add parsing for HTML tags (data-src, data-srcset, data-original and data-original-set) 2020-04-10 15:59:50 +02:00
Leslie Bellony 40725372d6 Add support for the SFTP protocol 2020-04-01 14:47:34 +02:00
Andrew Jackson ff05de44b6 [maven-release-plugin] prepare for next development iteration 2020-03-04 23:05:41 +00:00
Andrew Jackson a1bdcb1be7 [maven-release-plugin] prepare release 3.4.0-20200304 2020-03-04 23:05:33 +00:00
Andy Jackson 7f80b4fd98 Merge pull request #281 from ukwa/upgrade-bdb-je
WIP: Upgrade BDB JE to version 7.5.11
2020-03-04 13:36:03 +00:00
Alex Osborne 977f608c74 Merge pull request #290 from netarchivesuite/crawltrap-regex-timeout
Crawltrap regex timeout
2020-03-03 19:27:42 +09:00
Colin Rosenthal e54258756a Fixed regex timeout handling following suggestion https://github.com/internetarchive/heritrix3/pull/290#discussion_r366711640 2020-03-03 09:02:07 +01:00
Colin Rosenthal 60e4053180 Commented this test back in to make Travis happy 2020-03-03 08:52:09 +01:00
Alex Osborne 3528c990df Merge pull request #303 from hennekey/refactor-history
Replace constant with accessor methods
2020-01-28 14:49:00 +09:00
Tim Hennekey 3003a8e751 Replace constant with accessor methods
CrawlURI already had the accessor method, and the use of the constant
was a bit inconsistent. This change adds the corresponding mutator
method to make working with the CrawlURI history a bit simpler.
2020-01-24 12:28:11 -05:00
Alex Osborne 8e875bb17f Merge pull request #288 from netarchivesuite/inline-image-filter
Attempt to filter out embedded images.
2020-01-15 12:48:54 +09:00
jkafader 3a8b58998c Merge pull request #285 from nlevitt/warc-writer-chain
Warc writer chain
2020-01-13 16:39:42 -08:00
Noah Levitt 31b9960503 basic level of documentation 2019-12-30 16:02:10 -08:00
Colin Rosenthal 204491c357 Attempt to filter out embedded images.
(cherry picked from commit aa5ff1dbdaefd04652a9c66506d20f1a6ae01dc3)
2019-11-19 15:04:50 +01:00
Colin Rosenthal 718cc5ae32 Updated manually to new SNAPSHOT version 2019-11-15 14:34:03 +01:00
Andrew Jackson 73db3ac628 Merge branch 'master' into upgrade-bdb-je 2019-10-17 14:10:22 +01:00
Noah Levitt 1b95453748 be consistent and null-safe with concurrentTo 2019-10-15 10:50:26 -07:00
Alex Osborne 2a5bd87e51 Remove testConcurrentLoad
Noah wrote in #280:

> Maybe we should just drop the test. The assumption when we wrote the
> test was that a race condition would not be so frequent in practice.
> We've seen that under the contrived conditions created by the test
> case, it is frequent. But that's ok
2019-08-16 22:11:26 +09:00
Alex Osborne a5c03d9b73 Mitigate random CookieStore.testConcurrentLoad test failures
The arbitary value `25` was used but in prace it's quite possible
for more than 25 writing threads to have checked the cookie count
limit before adding their cookie. In practice we see Travis failing
on this test quite often, every few builds in fact.

I think using `threads.length` (i.e. 200) should cover the worst
case possibility where every thread reads a stale count and tries
to add their cookie.

Fixes #274
2019-08-12 18:08:43 +09:00
Andrew Jackson 7dab6ec275 Avoid using Thread.interrupt as this freaks BDB-JE. 2019-08-11 22:03:55 +01:00
Noah Levitt cefad96036 Merge pull request #276 from internetarchive/jdk11-upgrade-jetty
JDK11 support: upgrade to Jetty 9.4.19, Restlet 2.4.0 and drop JDK 7 support
2019-08-07 10:48:51 -07:00
Alex Osborne 0782fb0481 JDK11: upgrade engine to jetty 9.4.19 and restlet 2.4.0
Jetty 9.4.12+ is required for TLS to work correctly under JDK11
(due to SSL handshake failures). In order to upgrade
Jetty we also need to upgrade Restlet.

There is one intentional change in behaviour to simplify
upgrading. We remove a workaround for an old [webkit bug]
where the browser claimed to prefer application/xml. The
bug was fixed in 2011.

[webkit bug]: https://bugs.webkit.org/show_bug.cgi?id=27267

Summary of Jetty API changes:
- package names changed such as org.mortbay -> org.eclipse
- SocketConnector and SslSocketConnector merged to ServerConnector
- HashUserRealm split into UserStore and HashLoginService
- SecurityHandler -> ConstraintSecurityHandler

Summary of Restlet API changes:
- some classes have moved package (Request, Response, Router etc)
- ServerResource replaces Resource
- represent(), acceptRepresentation() renamed to get(), post()
- constructors were replaced by an init() method
- setModifiable() was removed
- getRequest().getEntityAsForm() -> new Form(entity)
- Guard -> ChallengeAuthenticator

Fixes #275
2019-08-06 15:16:37 +09:00
Alex Osborne 9d1341c731 JDK11 support: upgrade jetty to 9.4.19 in modules tests
Fixes #268 ssl handshake_failure. Support for jdk11 was added in jetty
9.4.14 but we may as well bump to the latest stable version.

In Jetty 9 it appears the request is logged after the response is sent.
Thus it was racing with the assertions that check the client IP. So to
fix this rather stashing the 'lastRequest' we just make the server
echo the client's IP in a response header.

Some other minor tweaks were needed due to changes in Jetty behaviour:

- We stop checking the length of the raw response. It doesn't tell us
  anything and easily varies.

- Jetty now generates Set-Cookie with a space after the ;

- Jetty now lowercases the word "basic" in WWW-Authenticate header

- testLaxUrlEncoding(): Jetty now rejects bad paths with a 400 error so
  we disable the response checks. The actual request line is
  still checked which is the important thing.

Note: This patch does not affect the version of jetty used by the
Heritrix admin console. That will be tackled separately.
2019-08-05 14:35:09 +09:00
Alex Osborne d3d19e2248 Prevent newer surefire from invoking FetchHTTPTests directly
It seems older versions only matched *Test.java but the new version
is now incorrectly including it.
2019-08-02 17:57:09 +09:00
Alex Osborne 412885fd7d JDK11 support: upgrade maven-surefire-plugin to 2.22.2
Under JDK11 our old version of it throws ClassNotFoundExceptions when
tests load some builtin classes like javax.transaction.xa.Xid.

Fixes #266
2019-08-02 16:43:20 +09:00
Noah Levitt bff33e00e6 write youtube-dl json to the warc
ExtractorYoutubeDL implements WARCRecordBuilder
2019-06-12 17:40:57 -07:00
Noah Levitt 5177b2b6da rename method so as not to conflict with Processor 2019-06-12 15:17:33 -07:00
Noah Levitt 9ddd281ef2 make WARCRecordBuilder an interface
this way other classes that extend other classes can also implement
WARCRecordBuilder
2019-06-12 15:04:39 -07:00
Noah Levitt 9e67a8dab4 revisits only for http and ftp
fixes NPE trying to write a dns revisit record
2019-06-12 14:58:11 -07:00
Noah Levitt 7c31b0752a use WARCWriterChainProcessor for these tests 2019-06-12 12:56:49 -07:00
Noah Levitt 8c4c443a88 default chain in code 2019-06-12 12:54:00 -07:00
Noah Levitt ece435874e oops, handle https too 2019-06-12 12:53:27 -07:00
Noah Levitt 870d84740a same test as for WARCWriterProcessor
doesn't test that much though
2019-06-12 11:04:02 -07:00
Noah Levitt 9435f761a6 configurable warc writer chain
exercised only lightly at this point
2019-06-11 13:45:51 -07:00
Noah Levitt 37fb6f6b7b do not drop any CrawlURI.data between processing
Without this change (or other measures), we sometimes get nulls in the
ExtractorYoutubeDL log for containing page information. We'll run this
on QA for a while and see if it causes any problems.

nlevitt [1:59 PM]
https://github.com/internetarchive/heritrix3/blob/master/modules/src/main/java/org/archive/modules/CrawlURI.java#L878
drops some stuff from `CrawlURI.data` after processing a uri, even if it needs to be processed again
there is a list of keys that shouldn’t be dropped (`persistentKeys`), but it is final and private
so if you’re writing your own heritrix module and you want to keep some information in CrawlURI.data, it usually works, except when the url is processed more than once (like when it needs a prereq like robots.txt the first time)
in practice it seems that most data is persisted, that is, most commonly used keys are in `persistentKeys`
in a crawl with pretty standard configuration i’m mostly seeing `prerequisite-uri` dropped and occasionally `fetch-completed-time` and `fetch-began-time` being dropped
i’m highly skeptical of the value of dropping keys at all and i’m tempted to get rid of this entirely, make all the keys persistent in other words
soliciting feedback (edited)

anjackson [2:39 PM]
My immediate reaction is HARD AGREE. It looks like Really Old Code though (https://github.com/internetarchive/heritrix3/blame/7d3eff5269142c77fa4b988396153f4c29d16caa/modules/src/main/java/org/archive/modules/CrawlURI.java#L878)
so the reasons for doing so may have been lost in time.
Hm, looking at usage: https://github.com/internetarchive/heritrix3/blob/a60b2ef3875ad47f57b0c6b3c0b19f86c40a12f7/engine/src/main/java/org/archive/crawler/frontier/WorkQueueFrontier.java#L954-L955
engine/src/main/java/org/archive/crawler/frontier/WorkQueueFrontier.java:954-955

                curi.processingCleanup(); // lose state that shouldn't burden
                                          // retry

I guess there's a concern that there may be state in there that is set during a fetch and may cause problems if the same CrawlURI is deferred?
But I'm not aware of anything in the fetch chain that behaves like that.

nlevitt [3:02 PM]
oh, i missed `CrawlURI.addDataPersistentMember(String)` et al. still...
2019-04-30 16:20:53 -07:00
Noah Levitt 1bd8b713c6 quiet org.mortbay.log (jetty?) logging
There is already a clause for this in logging.properties, but it's using
log4j. It was dumping stack traces every time the client was dubious of
heritrix's self-signed certificate.

Why do we have so many identical log4j.xml's? 🤷‍♂️
2019-04-30 16:17:35 -07:00
Andrew Jackson b3961a2f96 [maven-release-plugin] prepare for next development iteration 2019-04-18 15:36:28 +01:00
Andrew Jackson c7c6141ee1 [maven-release-plugin] prepare release 3.4.0-20190418 2019-04-18 15:36:20 +01:00
Alex Osborne dd37598470 Revert "Upgrade httpclient to 4.5.7 and handle cookies more compliantly" 2019-03-28 10:14:42 +09:00
Andrew Jackson 03da8c06cf Merge branch 'master' into upgrade-httpclient 2019-03-21 00:06:10 +00:00
Andrew Jackson 044f068d1b Removing outdated test. 2019-03-21 00:06:05 +00:00
Andrew Jackson 629a7adcb6 Disable questionalbe test. 2019-03-20 22:02:58 +00:00
Andrew Jackson 2fbe603878 Avoid deprecated flag. 2019-03-20 22:02:35 +00:00