Commit Graph

1207 Commits

Author SHA1 Message Date
luccioman
4b649b0a11 Fixed NPE case and API URL link on Solr HTML output for webgraph core. 2017-03-30 15:41:14 +02:00
luccioman
cde237b687 Enforced access controls on some administrative actions.
- ensure use of HTTP POST method : HTTP GET should only be used for
information retrieval and not to perform server side effect operations
(see HTTP standard https://tools.ietf.org/html/rfc7231#section-4.2.1)
 - a transaction token is now required for these administrative form
submissions to ensure the request can not be included in an external
site and performed silently/by mistake by the user browser
2017-03-26 11:48:00 +02:00
luccioman
df5970df6d Extended Apache HTTP Digest Auth. for use of YaCy encoded password
When programmatically requesting the local peer with Apache http client,
authentication credentials must be passed as clear-text values. 
This extension to the apache org.apache.http.impl.auth.DigestScheme
permits use of the YaCy encoded password stored in the
adminAccountBase64MD5 configuration property.
2017-03-26 11:32:44 +02:00
reger
f05976c017 Display the local search word statistic in alphabetic order 2017-03-19 07:12:35 +01:00
reger
56d0a87a83 remove double occuance of geo:lat in rss tokens 2017-03-13 03:08:44 +01:00
reger
b4fa1141b8 implement RequestHeader getRequestURI, getRequestURL for legacy request 2017-03-12 01:54:56 +01:00
reger
cd4d891ea4 use pre-defined "Connection" header key, replace depreceated 2017-03-04 19:41:31 +01:00
reger
275c0cddd1 Adjust DefaultServlet test case to recent change,
depreciate unused CONNECTION_PROP_PROTOCOL (also as it might be 
misleading with getProtocol vs getScheme)
2017-02-26 02:39:52 +01:00
reger
41e2ee0eca Fix call parameter for ConnectionInfo in MonitorHandler
(expected scheme e.g. http, was protocol version).
Depreceate obsolete custom X-...-Scheme header constant.
Use existing FORMAT_ANSIC Dateformatter in HeaderFramework.
Correct htmlParserTest (del one not intended println)
2017-02-25 23:55:17 +01:00
luccioman
2f191e0e1c Improved MultiprocotolURL non ASCII characters support.
After @sinkuu Pull Request #108 added JUnit tests, updated some JavaDoc
and also improved URL tokenization to support non ASCII characters.
2017-02-23 11:09:43 +01:00
luccioman
18e8b3a220 Merge branch 'escape' of https://github.com/sinkuu/yacy_search_server 2017-02-23 11:03:05 +01:00
reger
7419989de3 Correct dublincore title property text to lowercase in htmlresponsewriter,
remove unused (carry over) local variable
Do the same for other responsewriter.
2017-02-23 00:27:56 +01:00
luccioman
c68a8be2d9 Refactored and enforced Solr mandatory fields for proper operation
- Added a new method to check activation of mandatory fields on
Collection Configuration commit, consistently with checks previously
performed in Switchboard startup and with mandatory fields in the
default schema.
- Reorganized default schema and CollectionConfiguration enumeration :
moved no more mandatory fields in a specific section, and moved fields
enabled at startup to the mandatory section. 
- Marked mandatory fields as required and with stronger font in the
IndexSchema_p.html page
2017-02-20 10:48:07 +01:00
reger
7e53860fc7 fix NPE in HTMLResponseWriter on missing document title 2017-02-16 02:36:24 +01:00
luccioman
6e89d125f2 Added robots.txt support for heuristics federated search.
As noticed by @reger24, abusive use of OpenSearch systems should be
prevented, especially if allowing to parse and reuse HTML results.
robots.txt file is now checked before requesting an external OpenSearch
system to respect the host exclusions and eventual crawl-delay value.
The check is also performed when trying to add a new OpenSearch URL
template through the /ConfigHeuristics_p.html admin page.
2017-02-15 15:04:40 +01:00
sinkuu
a46b232bf1 Use java.net.URLDecoder 2017-02-14 16:55:38 +09:00
luccioman
bf16de29c1 Added support for HTML OpenSearch results.
Many OpenSearch systems do not provide results as standard RSS/Atom
feeds but only as HTML. 

This modification add some support for custom OpenSearch HTML results
through the use of mapping files (as already done for federated Solr
search) relying on CSS-like selectors to retrieve information from HTML
content.

An example mapping file is provided to map results from the
www.npmjs.com OpenSearch URL.
2017-02-13 19:11:17 +01:00
luccioman
1857651988 Added a new Debug/Analysis advanced settings subsection.
As discussed in PR #93 with @JeremyRand and @reger24 this new advanced
settings page includes:
 - a new setting to control remote Solr responses encoding
 - some existing debug settings which could not be set through the admin
user interface
2017-02-09 11:05:06 +01:00
luccioman
9a5a124bf2 Distinguished solr connectors thread names for easier monitoring. 2017-02-03 09:54:29 +01:00
luccioman
0da1e6ba16 Factored code re-implementing DigestURL.hosthash() method.
This ensure consistent implementation of the url host hash generation
and easier usage finding in source code.

Also added a unit test for this function.
2017-01-16 10:18:42 +01:00
luccioman
6a4d51d8f9 Cleaned up some Javadoc warnings. 2017-01-09 16:44:47 +01:00
luccioman
86dc198698 Fixed some JavaDocs broken links. 2017-01-09 09:57:53 +01:00
reger
16beb551ea fix DC.Elements namespace in DublinCore vocabulary class
delete redundant (unused) DCElements.
2017-01-07 18:24:29 +01:00
reger
68d4dc5cc5 Complete harmonization RequestHeader getCookie with std ServletRequest
to use javax.servlet.http.Cookie parameters.
Depreciate now obsolete getHeaderCookies.
Adjust setting of MaxAge to spec if >= 0 otherwise keep default.
2017-01-02 03:04:21 +01:00
reger
7bf2bcf504 fix and prevent exception on missing required cookie name
skip cookie creation if name is empty.
2016-12-22 19:52:38 +01:00
luccioman
3ca695390c FTP crawl start URLs : applied crawl profile depth control
Applied rules :
- when the FTP URL denotes a file resource, stack it as any start URL :
eventually embedded links can be followed applying the usual depth rules
- when the FTP URL denotes a directory, list files under this directory
and stack them for crawl, and repeat the process on sub folders until
crawl depth is reached
2016-12-22 16:25:09 +01:00
luccioman
128c8ef8d4 Fixed title rendering having non ASCII chars in QuickCrawlLink_p.html. 2016-12-21 08:19:09 +01:00
luccioman
feaa87005e Improved indentation for easier debugging steps. 2016-12-20 08:27:17 +01:00
reger
6be7339b1d remove the overhead of unused reverseMappingCache of HeaderFramewor / RequestHeader 2016-12-18 00:57:47 +01:00
reger
3f32262654 enable getCookies for HeaderFramework reusing Jetty CookieCutter 2016-12-09 00:33:20 +01:00
luccioman
a1f922b34a Reduced locations vocabulary memory footprint.
Reduced this vocabulary memory usage :
 - by using only one map term2entries instead of two maps having the
same key set
 - by generating the location object links on the fly using the
GeoLocation data instead of storing many duplicates of string prefix
"http://www.openstreetmap.org/?lat="
 
Measurements with VisualVM and GeoNames 0 enabled (cities with a
population > 1000) :
 - AutotaggingLibrary retained size :
  - initial : 309 718 763 bytes
  - after refactoring : 159 224 641 bytes
2016-12-05 10:57:37 +01:00
reger
9c06e752e4 allow request.setAttribute w/o "not implemented" exception by default
skip unused CONNECTION_PROP_ARGS check in getQueryString
2016-12-05 03:15:24 +01:00
luccioman
bf8a6d9848 Reduced GeoNames locations memory footprint.
Using String instead of StringBuilder instances in GeonamesLocation
allows to reuse the same immutable objects in the Tagging class.

Measurements with VisualVM and GeoNames 0 enabled (cities with a
population > 1000) :
 - OverArchingLocation retained size :
  - initial : 164 666 830 bytes
  - after refactoring : 97 736 804 bytes
 - AutotaggingLibrary retained size :
  - initial : 354 713 633 bytes
   - after refactoring : 309 718 763 bytes
2016-12-03 09:05:19 +01:00
luccioman
6bc2bf1aa4 Small memory footprint reduction for GeonamesLocation.
Reusing the same geonameid Integer instance between `id2loc` and
`name2ids` maps reduces (a little) memory footprint.
Measured OverarchigLocation class retained memory with VisualVM on
openJDK 8 :
 - initial : 183 439 490 bytes
 - after refactoring : 164 666 830 bytes
2016-12-02 13:12:47 +01:00
luccioman
7f846ef674 Small complementary memory footprint improvement for synonyms.
Memory footprint measured with VisualVM and all synonyms enabled :
 - before : 195 015 914 bytes
 - after : 192 548 826 bytes
2016-11-30 17:49:51 +01:00
luccioman
568e3dde6a Improved synonyms memory footprint.
The idea is to avoid unnecessary String objects duplication for the same
words. Particularly efficient with the large moby thesaurus.

Memory footprint measurements with VisualVM :
 - openthesaurus_de_yacy :
 	- initial : 19 443 796 bytes
 	- after refactoring : 18 012 606 bytes

 - mobythesaurus_en_yacy :
 	- initial : 343 453 904 bytes
 	- after refactoring : 173 843 780 bytes

 - thesaurus_ru_yacy :
 	- initial : 3 800 706 bytes
 	- after refactoring : 3 466 612 bytes

 - de + en + ru : 
 	- initial : 366 603 450 bytes
 	- after refactoring : 195 015 914 bytes
2016-11-30 16:50:25 +01:00
reger
60b3adfb43 fix ext2mime to return given default on input=null 2016-11-29 23:32:20 +01:00
luccioman
fc575fc760 Fixed a NullPointerException case. 2016-11-25 11:07:50 +01:00
reger
8e3e3ed191 update the older ResponseHeader patch to handle cookies,
to work directly with javax.servlet.http.Cookie (rename headerProps to
cookieStore as is only used for this).
(Re)implement set-cookie in DefaultServlet to make cookieAuthentication
work as designed.
2016-11-25 02:00:20 +01:00
reger
866d3a1960 make RequestHeader login succeed (without throwing exception by default)
correct getAuthType to return Auth Scheme only after authentication
2016-11-25 01:09:42 +01:00
luccioman
3092a8ced5 Fixed thread name consistency for improved monitoring.
Some tasks were modifying the current thread name without restoring it
once finished as it is effectively done elsewhere.
2016-11-23 17:59:52 +01:00
luccioman
eec5779889 Added a name prefix to pooled threads for easier monitoring.
Using JVM monitoring tools, it is then easier to identify tasks running
inside thread pool with a custom prefix rather than the generic one :
"pool-".
2016-11-23 11:21:14 +01:00
luccioman
0ba5a838f7 Added charset meta to Solr HTML writers.
Non-ASCII characters are thus correctly rendered in browsers.
This is a fix ro mantis 706 : http://mantis.tokeek.de/view.php?id=706
2016-11-21 19:55:13 +01:00
reger
08a0acc35d make a YearNavigator availabel, useable as SearchEvent.naviator plugin.
It can take any Date field of the index and displays a list of year strings
in reverse order by the year (not the score/count).
To allow to define the index field to use, the fieldname (and title can be 
appended to the navi's name "year" e.g. year:load_date_dt:LoadDate
It works also with dates_in_content_dts field (from the graphical date
navigator). Here the query parameter from: to: are used on selection as
Query modifier (for other dates currently no query parameter available, so
selection won't work to filter search results).
Not included in the UI Searchpage layout config so far (for experiment with
it manual change to conf needed).
2016-11-21 16:52:53 +01:00
reger
0d3bef659b implement RequestHeader.setCharacterEncoding for legacy header,
make sure .getProtocol returns a http version
move the patch for Set-Cookie to ResponseHeader (applies only here)
2016-11-20 19:30:38 +01:00
reger
4eeb448eb3 use DigestURL in UrlProxyServlet as parameter to pass requested url to
handler.
UrlProxyServlet splits url in parts to pass it on as parameter and 
HeaderFramework constructs a url from param parts. This is obsolete if
already created url is used (makes HeaderFramework.getRequestURL obsolete
= removed)
2016-11-20 05:27:33 +01:00
reger
fdcf33f08f fix Domain.stripToHostName for some IPv6 cases
add unit test for it
2016-11-19 16:37:16 +01:00
reger
ac6e198bd1 add unit test for Domains.stripToPort,
simplify ipv6 check
2016-11-19 06:22:55 +01:00
reger
f27531f5ec fix Domains.stripToPort, make ipv6 save 2016-11-19 05:56:48 +01:00
reger
67744a8038 fix HeaderFramework.getRequestURL on host with port considering ipv6 host 2016-11-19 05:08:11 +01:00