update to Jetty 9

besides adjustments in code it makes the servlet settings in web.xml significant.
This applies to solr, gsa and proxy servlet. There is no longer a default setup in code during init (as jetty 9 checks for double definition).
pull/1/head
reger 11 years ago
parent 1432a817dd
commit e9060d31bd

@ -1,87 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="source"/>
<classpathentry excluding="api/|env/|processing/domaingraph/applet/|yacy/|api/bookmarks/|api/ymarks/|api/bookmarks/posts/|api/bookmarks/tags/|api/bookmarks/xbel/|solr/|gsa/|solr/collection1/" kind="src" path="htroot"/>
<classpathentry excluding="bookmarks/|ymarks/|bookmarks/posts/|bookmarks/tags/|bookmarks/xbel/" kind="src" path="htroot/api"/>
<classpathentry kind="src" path="htroot/env"/>
<classpathentry kind="src" path="htroot/yacy"/>
<classpathentry excluding="posts/|tags/|xbel/" kind="src" path="htroot/api/bookmarks"/>
<classpathentry kind="src" path="htroot/api/ymarks"/>
<classpathentry kind="src" path="htroot/api/bookmarks/posts"/>
<classpathentry kind="src" path="htroot/api/bookmarks/tags"/>
<classpathentry kind="src" path="htroot/api/bookmarks/xbel"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/commons-logging-1.1.3.jar"/>
<classpathentry kind="lib" path="lib/J7Zip-modified.jar"/>
<classpathentry kind="lib" path="lib/webcat-0.1-swf.jar"/>
<classpathentry kind="lib" path="lib/activation.jar"/>
<classpathentry kind="lib" path="lib/commons-jxpath-1.3.jar"/>
<classpathentry kind="lib" path="lib/poi-3.9-20121203.jar"/>
<classpathentry kind="lib" path="lib/poi-scratchpad-3.9-20121203.jar"/>
<classpathentry kind="lib" path="lib/bcmail-jdk15-145.jar"/>
<classpathentry kind="lib" path="lib/bcprov-jdk15-145.jar"/>
<classpathentry kind="lib" path="lib/jsch-0.1.50.jar"/>
<classpathentry kind="lib" path="lib/jakarta-oro-2.0.8.jar"/>
<classpathentry kind="lib" path="lib/apache-mime4j-0.6.jar"/>
<classpathentry kind="lib" path="lib/commons-fileupload-1.2.2.jar"/>
<classpathentry kind="lib" path="lib/json-simple-1.1.1.jar"/>
<classpathentry kind="lib" path="lib/xercesImpl.jar"/>
<classpathentry kind="lib" path="lib/xml-apis.jar"/>
<classpathentry kind="lib" path="lib/geronimo-stax-api_1.0_spec-1.0.1.jar"/>
<classpathentry kind="lib" path="lib/commons-io-2.1.jar"/>
<classpathentry kind="lib" path="lib/commons-compress-1.8.jar"/>
<classpathentry kind="lib" path="lib/commons-lang-2.6.jar"/>
<classpathentry kind="lib" path="lib/jaudiotagger-2.0.4-20111207.115108-15.jar"/>
<classpathentry kind="lib" path="lib/commons-codec-1.7.jar"/>
<classpathentry kind="lib" path="lib/jcl-over-slf4j-1.7.2.jar"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.7.2.jar"/>
<classpathentry kind="lib" path="lib/zookeeper-3.4.5.jar"/>
<classpathentry kind="lib" path="lib/wstx-asl-3.2.9.jar"/>
<classpathentry kind="lib" path="lib/slf4j-jdk14-1.7.2.jar"/>
<classpathentry kind="lib" path="lib/log4j-over-slf4j-1.7.2.jar"/>
<classpathentry kind="lib" path="lib/httpclient-4.3.3.jar"/>
<classpathentry kind="lib" path="lib/httpcore-4.3.2.jar"/>
<classpathentry kind="lib" path="lib/httpmime-4.3.3.jar"/>
<classpathentry kind="lib" path="lib/noggit-0.5.jar"/>
<classpathentry kind="lib" path="lib/metadata-extractor-2.6.2.jar"/>
<classpathentry kind="lib" path="lib/jcifs-1.3.17.jar"/>
<classpathentry kind="lib" path="lib/fontbox-1.8.4.jar"/>
<classpathentry kind="lib" path="lib/jempbox-1.8.4.jar"/>
<classpathentry kind="lib" path="lib/pdfbox-1.8.4.jar"/>
<classpathentry kind="lib" path="lib/guava-16.0.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-common-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-phonetic-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-classification-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-codecs-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-core-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-facet-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-grouping-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-highlighter-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-join-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-memory-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-misc-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-queries-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-queryparser-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-spatial-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-suggest-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/solr-core-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/solr-solrj-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/spatial4j-0.4.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="lib/icu4j-core.jar"/>
<classpathentry kind="lib" path="lib/htmllexer.jar"/>
<classpathentry kind="lib" path="lib/jsoup-1.6.3.jar"/>
<classpathentry kind="lib" path="lib/jetty-client-8.1.14.v20131031.jar"/>
<classpathentry kind="lib" path="lib/jetty-continuation-8.1.14.v20131031.jar"/>
<classpathentry kind="lib" path="lib/jetty-http-8.1.14.v20131031.jar"/>
<classpathentry kind="lib" path="lib/jetty-io-8.1.14.v20131031.jar"/>
<classpathentry kind="lib" path="lib/jetty-security-8.1.14.v20131031.jar"/>
<classpathentry kind="lib" path="lib/jetty-server-8.1.14.v20131031.jar"/>
<classpathentry kind="lib" path="lib/jetty-servlet-8.1.14.v20131031.jar"/>
<classpathentry kind="lib" path="lib/jetty-servlets-8.1.14.v20131031.jar"/>
<classpathentry kind="lib" path="lib/jetty-util-8.1.14.v20131031.jar"/>
<classpathentry kind="lib" path="lib/jetty-webapp-8.1.14.v20131031.jar"/>
<classpathentry kind="lib" path="lib/jetty-xml-8.1.14.v20131031.jar"/>
<classpathentry kind="lib" path="lib/servlet-api-3.0.jar"/>
<classpathentry kind="output" path="gen"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="source"/>
<classpathentry excluding="api/|env/|processing/domaingraph/applet/|yacy/|api/bookmarks/|api/ymarks/|api/bookmarks/posts/|api/bookmarks/tags/|api/bookmarks/xbel/|solr/|gsa/|solr/collection1/" kind="src" path="htroot"/>
<classpathentry excluding="bookmarks/|ymarks/|bookmarks/posts/|bookmarks/tags/|bookmarks/xbel/" kind="src" path="htroot/api"/>
<classpathentry kind="src" path="htroot/env"/>
<classpathentry kind="src" path="htroot/yacy"/>
<classpathentry excluding="posts/|tags/|xbel/" kind="src" path="htroot/api/bookmarks"/>
<classpathentry kind="src" path="htroot/api/ymarks"/>
<classpathentry kind="src" path="htroot/api/bookmarks/posts"/>
<classpathentry kind="src" path="htroot/api/bookmarks/tags"/>
<classpathentry kind="src" path="htroot/api/bookmarks/xbel"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/commons-logging-1.1.3.jar"/>
<classpathentry kind="lib" path="lib/J7Zip-modified.jar"/>
<classpathentry kind="lib" path="lib/webcat-0.1-swf.jar"/>
<classpathentry kind="lib" path="lib/activation.jar"/>
<classpathentry kind="lib" path="lib/commons-jxpath-1.3.jar"/>
<classpathentry kind="lib" path="lib/poi-3.9-20121203.jar"/>
<classpathentry kind="lib" path="lib/poi-scratchpad-3.9-20121203.jar"/>
<classpathentry kind="lib" path="lib/bcmail-jdk15-145.jar"/>
<classpathentry kind="lib" path="lib/bcprov-jdk15-145.jar"/>
<classpathentry kind="lib" path="lib/jsch-0.1.50.jar"/>
<classpathentry kind="lib" path="lib/jakarta-oro-2.0.8.jar"/>
<classpathentry kind="lib" path="lib/apache-mime4j-0.6.jar"/>
<classpathentry kind="lib" path="lib/commons-fileupload-1.2.2.jar"/>
<classpathentry kind="lib" path="lib/json-simple-1.1.1.jar"/>
<classpathentry kind="lib" path="lib/xercesImpl.jar"/>
<classpathentry kind="lib" path="lib/xml-apis.jar"/>
<classpathentry kind="lib" path="lib/geronimo-stax-api_1.0_spec-1.0.1.jar"/>
<classpathentry kind="lib" path="lib/commons-io-2.1.jar"/>
<classpathentry kind="lib" path="lib/commons-compress-1.8.jar"/>
<classpathentry kind="lib" path="lib/commons-lang-2.6.jar"/>
<classpathentry kind="lib" path="lib/jaudiotagger-2.0.4-20111207.115108-15.jar"/>
<classpathentry kind="lib" path="lib/commons-codec-1.7.jar"/>
<classpathentry kind="lib" path="lib/jcl-over-slf4j-1.7.2.jar"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.7.2.jar"/>
<classpathentry kind="lib" path="lib/zookeeper-3.4.5.jar"/>
<classpathentry kind="lib" path="lib/wstx-asl-3.2.9.jar"/>
<classpathentry kind="lib" path="lib/slf4j-jdk14-1.7.2.jar"/>
<classpathentry kind="lib" path="lib/log4j-over-slf4j-1.7.2.jar"/>
<classpathentry kind="lib" path="lib/httpclient-4.3.3.jar"/>
<classpathentry kind="lib" path="lib/httpcore-4.3.2.jar"/>
<classpathentry kind="lib" path="lib/httpmime-4.3.3.jar"/>
<classpathentry kind="lib" path="lib/noggit-0.5.jar"/>
<classpathentry kind="lib" path="lib/metadata-extractor-2.6.2.jar"/>
<classpathentry kind="lib" path="lib/jcifs-1.3.17.jar"/>
<classpathentry kind="lib" path="lib/fontbox-1.8.4.jar"/>
<classpathentry kind="lib" path="lib/jempbox-1.8.4.jar"/>
<classpathentry kind="lib" path="lib/pdfbox-1.8.4.jar"/>
<classpathentry kind="lib" path="lib/guava-16.0.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-common-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-phonetic-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-classification-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-codecs-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-core-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-facet-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-grouping-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-highlighter-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-join-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-memory-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-misc-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-queries-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-queryparser-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-spatial-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-suggest-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/solr-core-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/solr-solrj-4.7.1.jar"/>
<classpathentry kind="lib" path="lib/spatial4j-0.4.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="lib/icu4j-core.jar"/>
<classpathentry kind="lib" path="lib/htmllexer.jar"/>
<classpathentry kind="lib" path="lib/jsoup-1.6.3.jar"/>
<classpathentry kind="lib" path="lib/jetty-client-9.1.4.v20140401.jar"/>
<classpathentry kind="lib" path="lib/jetty-continuation-9.1.4.v20140401.jar"/>
<classpathentry kind="lib" path="lib/jetty-deploy-9.1.4.v20140401.jar"/>
<classpathentry kind="lib" path="lib/jetty-http-9.1.4.v20140401.jar"/>
<classpathentry kind="lib" path="lib/jetty-io-9.1.4.v20140401.jar"/>
<classpathentry kind="lib" path="lib/jetty-jmx-9.1.4.v20140401.jar"/>
<classpathentry kind="lib" path="lib/jetty-proxy-9.1.4.v20140401.jar"/>
<classpathentry kind="lib" path="lib/jetty-security-9.1.4.v20140401.jar"/>
<classpathentry kind="lib" path="lib/jetty-server-9.1.4.v20140401.jar"/>
<classpathentry kind="lib" path="lib/jetty-servlet-9.1.4.v20140401.jar"/>
<classpathentry kind="lib" path="lib/jetty-servlets-9.1.4.v20140401.jar"/>
<classpathentry kind="lib" path="lib/jetty-util-9.1.4.v20140401.jar"/>
<classpathentry kind="lib" path="lib/jetty-webapp-9.1.4.v20140401.jar"/>
<classpathentry kind="lib" path="lib/jetty-xml-9.1.4.v20140401.jar"/>
<classpathentry kind="lib" path="lib/javax.servlet-api-3.1.0.jar"/>
<classpathentry kind="output" path="gen"/>
</classpath>

@ -61,19 +61,23 @@
<string>$JAVAROOT/lib/jaudiotagger-2.0.4-20111207.115108-15.jar</string>
<string>$JAVAROOT/lib/jcifs-1.3.17.jar</string>
<string>$JAVAROOT/lib/jcl-over-slf4j-1.7.2.jar</string>
<string>$JAVAROOT/lib/jempbox-1.8.4.jar</string>
<string>$JAVAROOT/lib/jetty-client-8.1.14.v20131031.jar</string>
<string>$JAVAROOT/lib/jetty-continuation-8.1.14.v20131031.jar</string>
<string>$JAVAROOT/lib/jetty-http-8.1.14.v20131031.jar</string>
<string>$JAVAROOT/lib/jetty-io-8.1.14.v20131031.jar</string>
<string>$JAVAROOT/lib/jetty-security-8.1.14.v20131031.jar</string>
<string>$JAVAROOT/lib/jetty-server-8.1.14.v20131031.jar</string>
<string>$JAVAROOT/lib/jetty-servlet-8.1.14.v20131031.jar</string>
<string>$JAVAROOT/lib/jetty-servlets-8.1.14.v20131031.jar</string>
<string>$JAVAROOT/lib/jetty-util-8.1.14.v20131031.jar</string>
<string>$JAVAROOT/lib/jetty-webapp-8.1.14.v20131031.jar</string>
<string>$JAVAROOT/lib/jetty-xml-8.1.14.v20131031.jar</string>
<string>$JAVAROOT/lib/jsch-0.1.50.jar</string>
<string>$JAVAROOT/lib/jempbox-1.8.4.jar</string>
<string>$JAVAROOT/lib/javax.servlet-api-3.1.0.jar</string>
<string>$JAVAROOT/lib/jetty-client-9.1.4.v20140401.jar</string>
<string>$JAVAROOT/lib/jetty-continuation-9.1.4.v20140401.jar</string>
<string>$JAVAROOT/lib/jetty-deploy-9.1.4.v20140401.jar</string>
<string>$JAVAROOT/lib/jetty-http-9.1.4.v20140401.jar</string>
<string>$JAVAROOT/lib/jetty-io-9.1.4.v20140401.jar</string>
<string>$JAVAROOT/lib/jetty-jmx-9.1.4.v20140401.jar</string>
<string>$JAVAROOT/lib/jetty-proxy-9.1.4.v20140401.jar</string>
<string>$JAVAROOT/lib/jetty-security-9.1.4.v20140401.jar</string>
<string>$JAVAROOT/lib/jetty-server-9.1.4.v20140401.jar</string>
<string>$JAVAROOT/lib/jetty-servlet-9.1.4.v20140401.jar</string>
<string>$JAVAROOT/lib/jetty-servlets-9.1.4.v20140401.jar</string>
<string>$JAVAROOT/lib/jetty-util-9.1.4.v20140401.jar</string>
<string>$JAVAROOT/lib/jetty-webapp-9.1.4.v20140401.jar</string>
<string>$JAVAROOT/lib/jetty-xml-9.1.4.v20140401.jar</string>
<string>$JAVAROOT/lib/jsch-0.1.50.jar</string>
<string>$JAVAROOT/lib/json-simple-1.1.1.jar</string>
<string>$JAVAROOT/lib/log4j-over-slf4j-1.7.2.jar</string>
<string>$JAVAROOT/lib/lucene-analyzers-common-4.7.1.jar</string>
@ -96,7 +100,6 @@
<string>$JAVAROOT/lib/pdfbox-1.8.4.jar</string>
<string>$JAVAROOT/lib/poi-3.9-20121203.jar</string>
<string>$JAVAROOT/lib/poi-scratchpad-3.9-20121203.jar</string>
<string>$JAVAROOT/lib/servlet-api-3.0.jar</string>
<string>$JAVAROOT/lib/slf4j-api-1.7.2.jar</string>
<string>$JAVAROOT/lib/slf4j-jdk14-1.7.2.jar</string>
<string>$JAVAROOT/lib/solr-core-4.7.1.jar</string>

@ -186,17 +186,21 @@
<pathelement location="${lib}/jcifs-1.3.17.jar" />
<pathelement location="${lib}/jcl-over-slf4j-1.7.2.jar" />
<pathelement location="${lib}/jempbox-1.8.4" />
<pathelement location="${lib}/jetty-client-8.1.14.v20131031.jar" />
<pathelement location="${lib}/jetty-continuation-8.1.14.v20131031.jar" />
<pathelement location="${lib}/jetty-http-8.1.14.v20131031.jar" />
<pathelement location="${lib}/jetty-io-8.1.14.v20131031.jar" />
<pathelement location="${lib}/jetty-security-8.1.14.v20131031.jar" />
<pathelement location="${lib}/jetty-server-8.1.14.v20131031.jar" />
<pathelement location="${lib}/jetty-servlet-8.1.14.v20131031.jar" />
<pathelement location="${lib}/jetty-servlets-8.1.14.v20131031.jar" />
<pathelement location="${lib}/jetty-util-8.1.14.v20131031.jar" />
<pathelement location="${lib}/jetty-webapp-8.1.14.v20131031.jar" />
<pathelement location="${lib}/jetty-xml-8.1.14.v20131031.jar" />
<pathelement location="${lib}/javax.servlet-api-3.1.0.jar" />
<pathelement location="${lib}/jetty-client-9.1.4.v20140401.jar" />
<pathelement location="${lib}/jetty-continuation-9.1.4.v20140401.jar" />
<pathelement location="${lib}/jetty-deploy-9.1.4.v20140401.jar" />
<pathelement location="${lib}/jetty-http-9.1.4.v20140401.jar" />
<pathelement location="${lib}/jetty-io-9.1.4.v20140401.jar" />
<pathelement location="${lib}/jetty-jmx-9.1.4.v20140401.jar" />
<pathelement location="${lib}/jetty-proxy-9.1.4.v20140401.jar" />
<pathelement location="${lib}/jetty-security-9.1.4.v20140401.jar" />
<pathelement location="${lib}/jetty-server-9.1.4.v20140401.jar" />
<pathelement location="${lib}/jetty-servlet-9.1.4.v20140401.jar" />
<pathelement location="${lib}/jetty-servlets-9.1.4.v20140401.jar" />
<pathelement location="${lib}/jetty-util-9.1.4.v20140401.jar" />
<pathelement location="${lib}/jetty-webapp-9.1.4.v20140401.jar" />
<pathelement location="${lib}/jetty-xml-9.1.4.v20140401.jar" />
<pathelement location="${lib}/jsch-0.1.50.jar" />
<pathelement location="${lib}/json-simple-1.1.1.jar" />
<pathelement location="${lib}/jsoup-1.6.3.jar" />
@ -221,7 +225,6 @@
<pathelement location="${lib}/pdfbox-1.8.4.jar" />
<pathelement location="${lib}/poi-3.9-20121203.jar" />
<pathelement location="${lib}/poi-scratchpad-3.9-20121203.jar" />
<pathelement location="${lib}/servlet-api-3.0.jar" />
<pathelement location="${lib}/slf4j-api-1.7.2.jar" />
<pathelement location="${lib}/slf4j-jdk14-1.7.2.jar" />
<pathelement location="${lib}/solr-core-4.7.1.jar" />

@ -38,7 +38,7 @@ import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.UserDB;
import net.yacy.data.UserDB.AccessRight;
import net.yacy.http.Jetty8HttpServerImpl;
import net.yacy.http.Jetty9HttpServerImpl;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverObjects;
@ -74,7 +74,7 @@ public class ConfigAccounts_p {
env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT, "");
env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_USER_NAME,user);
// make sure server accepts new credentials
Jetty8HttpServerImpl jhttpserver = (Jetty8HttpServerImpl)sb.getHttpServer();
Jetty9HttpServerImpl jhttpserver = (Jetty9HttpServerImpl)sb.getHttpServer();
if (!user.equals(oldusername)) jhttpserver.removeUser(oldusername);
jhttpserver.resetUser(user);
} else {

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -22,11 +22,6 @@
<location>htroot</location>
<encoding>UTF-8</encoding>
</source-folder>
<source-folder>
<label>YaCy</label>
<location>.</location>
<encoding>UTF-8</encoding>
</source-folder>
</folders>
<ide-actions>
<action name="build">
@ -82,10 +77,15 @@
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/3">
<compilation-unit>
<package-root>source</package-root>
<classpath mode="compile">lib/J7Zip-modified.jar;lib/activation.jar;lib/apache-mime4j-0.6.jar;lib/bcmail-jdk15-145.jar;lib/bcprov-jdk15-145.jar;lib/commons-codec-1.7.jar;lib/commons-compress-1.8.jar;lib/commons-fileupload-1.2.2.jar;lib/commons-io-2.1.jar;lib/commons-jxpath-1.3.jar;lib/commons-lang-2.6.jar;lib/commons-logging-1.1.3.jar;lib/fontbox-1.8.4.jar;lib/geronimo-stax-api_1.0_spec-1.0.1.jar;lib/guava-16.0.1.jar;lib/htmllexer.jar;lib/httpclient-4.3.3.jar;lib/httpcore-4.3.2.jar;lib/httpmime-4.3.3.jar;lib/icu4j-core.jar;lib/jakarta-oro-2.0.8.jar;lib/jaudiotagger-2.0.4-20111207.115108-15.jar;lib/javax.servlet-api-3.1.0.jar;lib/jcifs-1.3.17.jar;lib/jcl-over-slf4j-1.7.2.jar;lib/jempbox-1.8.4.jar;lib/jetty-client-9.1.4.v20140401.jar;lib/jetty-continuation-9.1.4.v20140401.jar;lib/jetty-deploy-9.1.4.v20140401.jar;lib/jetty-http-9.1.4.v20140401.jar;lib/jetty-io-9.1.4.v20140401.jar;lib/jetty-jmx-9.1.4.v20140401.jar;lib/jetty-proxy-9.1.4.v20140401.jar;lib/jetty-security-9.1.4.v20140401.jar;lib/jetty-server-9.1.4.v20140401.jar;lib/jetty-servlet-9.1.4.v20140401.jar;lib/jetty-servlets-9.1.4.v20140401.jar;lib/jetty-util-9.1.4.v20140401.jar;lib/jetty-webapp-9.1.4.v20140401.jar;lib/jetty-xml-9.1.4.v20140401.jar;lib/jsch-0.1.50.jar;lib/json-simple-1.1.1.jar;lib/jsoup-1.6.3.jar;lib/log4j-over-slf4j-1.7.2.jar;lib/lucene-analyzers-common-4.7.1.jar;lib/lucene-analyzers-phonetic-4.7.1.jar;lib/lucene-classification-4.7.1.jar;lib/lucene-codecs-4.7.1.jar;lib/lucene-core-4.7.1.jar;lib/lucene-facet-4.7.1.jar;lib/lucene-grouping-4.7.1.jar;lib/lucene-highlighter-4.7.1.jar;lib/lucene-join-4.7.1.jar;lib/lucene-memory-4.7.1.jar;lib/lucene-misc-4.7.1.jar;lib/lucene-queries-4.7.1.jar;lib/lucene-queryparser-4.7.1.jar;lib/lucene-spatial-4.7.1.jar;lib/lucene-suggest-4.7.1.jar;lib/metadata-extractor-2.6.2.jar;lib/noggit-0.5.jar;lib/pdfbox-1.8.4.jar;lib/poi-3.9-20121203.jar;lib/poi-scratchpad-3.9-20121203.jar;lib/servlet-api-3.0.jar;lib/slf4j-api-1.7.2.jar;lib/slf4j-jdk14-1.7.2.jar;lib/solr-core-4.7.1.jar;lib/solr-solrj-4.7.1.jar;lib/spatial4j-0.4.1.jar;lib/webcat-0.1-swf.jar;lib/wstx-asl-3.2.9.jar;lib/xercesImpl.jar;lib/xml-apis.jar;lib/zookeeper-3.4.5.jar</classpath>
<built-to>lib/yacycore.jar</built-to>
<source-level>1.7</source-level>
</compilation-unit>
<compilation-unit>
<package-root>htroot</package-root>
<classpath mode="compile">lib/J7Zip-modified.jar;lib/activation.jar;lib/apache-mime4j-0.6.jar;lib/arq-2.8.7.jar;lib/bcmail-jdk15-145.jar;lib/bcprov-jdk15-145.jar;lib/commons-codec-1.7.jar;lib/commons-compress-1.8.jar;lib/commons-fileupload-1.2.2.jar;lib/commons-io-2.1.jar;lib/commons-jxpath-1.3.jar;lib/commons-lang-2.6.jar;lib/commons-logging-1.1.3.jar;lib/fontbox-1.8.4.jar;lib/geronimo-stax-api_1.0_spec-1.0.1.jar;lib/guava-16.0.1.jar;lib/htmllexer.jar;lib/httpclient-4.3.3.jar;lib/httpcore-4.3.2.jar;lib/httpmime-4.3.3.jar;lib/icu4j-core.jar;lib/iri-0.8.jar;lib/jakarta-oro-2.0.8.jar;lib/jaudiotagger-2.0.4-20111207.115108-15.jar;lib/jcifs-1.3.17.jar;lib/jcl-over-slf4j-1.7.2.jar;lib/jempbox-1.8.4.jar;lib/jetty-client-8.1.14.v20131031.jar;lib/jetty-continuation-8.1.14.v20131031.jar;lib/jetty-http-8.1.14.v20131031.jar;lib/jetty-io-8.1.14.v20131031.jar;lib/jetty-security-8.1.14.v20131031.jar;lib/jetty-server-8.1.14.v20131031.jar;lib/jetty-servlet-8.1.14.v20131031.jar;lib/jetty-servlets-8.1.14.v20131031.jar;lib/jetty-util-8.1.14.v20131031.jar;lib/jetty-webapp-8.1.14.v20131031.jar;lib/jetty-xml-8.1.14.v20131031.jar;lib/jsch-0.1.50.jar;lib/json-simple-1.1.1.jar;lib/jsoup-1.6.3.jar;lib/log4j-over-slf4j-1.7.2.jar;lib/lucene-analyzers-common-4.7.1.jar;lib/lucene-analyzers-phonetic-4.7.1.jar;lib/lucene-classification-4.7.1.jar;lib/lucene-codecs-4.7.1.jar;lib/lucene-core-4.7.1.jar;lib/lucene-facet-4.7.1.jar;lib/lucene-grouping-4.7.1.jar;lib/lucene-highlighter-4.7.1.jar;lib/lucene-join-4.7.1.jar;lib/lucene-memory-4.7.1.jar;lib/lucene-misc-4.7.1.jar;lib/lucene-queries-4.7.1.jar;lib/lucene-queryparser-4.7.1.jar;lib/lucene-spatial-4.7.1.jar;lib/lucene-suggest-4.7.1.jar;lib/metadata-extractor-2.6.2.jar;lib/noggit-0.5.jar;lib/pdfbox-1.8.4.jar;lib/poi-3.9-20121203.jar;lib/poi-scratchpad-3.9-20121203.jar;lib/sax-2.0.1.jar;lib/servlet-api-3.0.jar;lib/slf4j-api-1.7.2.jar;lib/slf4j-jdk14-1.7.2.jar;lib/solr-core-4.7.1.jar;lib/solr-solrj-4.7.1.jar;lib/spatial4j-0.3.jar;lib/webcat-0.1-swf.jar;lib/wstx-asl-3.2.9.jar;lib/xercesImpl.jar;lib/xml-apis.jar;lib/zookeeper-3.4.5.jar</classpath>
<classpath mode="compile">lib/J7Zip-modified.jar;lib/activation.jar;lib/apache-mime4j-0.6.jar;lib/arq-2.8.7.jar;lib/bcmail-jdk15-145.jar;lib/bcprov-jdk15-145.jar;lib/commons-codec-1.7.jar;lib/commons-compress-1.8.jar;lib/commons-fileupload-1.2.2.jar;lib/commons-io-2.1.jar;lib/commons-jxpath-1.3.jar;lib/commons-lang-2.6.jar;lib/commons-logging-1.1.3.jar;lib/fontbox-1.8.4.jar;lib/geronimo-stax-api_1.0_spec-1.0.1.jar;lib/guava-16.0.1.jar;lib/htmllexer.jar;lib/httpclient-4.3.3.jar;lib/httpcore-4.3.2.jar;lib/httpmime-4.3.3.jar;lib/icu4j-core.jar;lib/iri-0.8.jar;lib/jakarta-oro-2.0.8.jar;lib/jaudiotagger-2.0.4-20111207.115108-15.jar;lib/jcifs-1.3.17.jar;lib/jcl-over-slf4j-1.7.2.jar;lib/jempbox-1.8.4.jar;lib/jetty-client-8.1.14.v20131031.jar;lib/jetty-continuation-8.1.14.v20131031.jar;lib/jetty-http-8.1.14.v20131031.jar;lib/jetty-io-8.1.14.v20131031.jar;lib/jetty-security-8.1.14.v20131031.jar;lib/jetty-server-8.1.14.v20131031.jar;lib/jetty-servlet-8.1.14.v20131031.jar;lib/jetty-servlets-8.1.14.v20131031.jar;lib/jetty-util-8.1.14.v20131031.jar;lib/jetty-webapp-8.1.14.v20131031.jar;lib/jetty-xml-8.1.14.v20131031.jar;lib/jsch-0.1.50.jar;lib/json-simple-1.1.1.jar;lib/jsoup-1.6.3.jar;lib/log4j-over-slf4j-1.7.2.jar;lib/lucene-analyzers-common-4.7.1.jar;lib/lucene-analyzers-phonetic-4.7.1.jar;lib/lucene-classification-4.7.1.jar;lib/lucene-codecs-4.7.1.jar;lib/lucene-core-4.7.1.jar;lib/lucene-facet-4.7.1.jar;lib/lucene-grouping-4.7.1.jar;lib/lucene-highlighter-4.7.1.jar;lib/lucene-join-4.7.1.jar;lib/lucene-memory-4.7.1.jar;lib/lucene-misc-4.7.1.jar;lib/lucene-queries-4.7.1.jar;lib/lucene-queryparser-4.7.1.jar;lib/lucene-spatial-4.7.1.jar;lib/lucene-suggest-4.7.1.jar;lib/metadata-extractor-2.6.2.jar;lib/noggit-0.5.jar;lib/pdfbox-1.8.4.jar;lib/poi-3.9-20121203.jar;lib/poi-scratchpad-3.9-20121203.jar;lib/sax-2.0.1.jar;lib/servlet-api-3.0.jar;lib/slf4j-api-1.7.2.jar;lib/slf4j-jdk14-1.7.2.jar;lib/solr-core-4.7.1.jar;lib/solr-solrj-4.7.1.jar;lib/spatial4j-0.3.jar;lib/webcat-0.1-swf.jar;lib/wstx-asl-3.2.9.jar;lib/xercesImpl.jar;lib/xml-apis.jar;lib/zookeeper-3.4.5.jar;lib/yacycore.jar</classpath>
<built-to>lib/yacycore.jar</built-to>
<source-level>1.6</source-level>
<source-level>1.7</source-level>
</compilation-unit>
</java-data>
</configuration>

@ -487,11 +487,6 @@
<artifactId>sax</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.servlet</artifactId>
<version>3.0.0.v201112011016</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
@ -516,28 +511,78 @@
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>javax.servlet</artifactId>
<groupId>org.eclipse.jetty.orbit</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>8.1.14.v20131031</version>
<version>9.1.4.v20140401</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>8.1.14.v20131031</version>
<version>9.1.4.v20140401</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlets</artifactId>
<version>8.1.14.v20131031</version>
<version>9.1.4.v20140401</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>8.1.14.v20131031</version>
</dependency>
<version>9.1.4.v20140401</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>9.1.4.v20140401</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-xml</artifactId>
<version>9.1.4.v20140401</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-http</artifactId>
<version>9.1.4.v20140401</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-security</artifactId>
<version>9.1.4.v20140401</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-io</artifactId>
<version>9.1.4.v20140401</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-continuation</artifactId>
<version>9.1.4.v20140401</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jmx</artifactId>
<version>9.1.4.v20140401</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-proxy</artifactId>
<version>9.1.4.v20140401</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-deploy</artifactId>
<version>9.1.4.v20140401</version>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>wstx-asl</artifactId>

@ -1,5 +1,5 @@
//
// Jetty8HttpServerImpl
// Jetty9HttpServerImpl
// Copyright 2011 by Florian Richter
// First released 13.04.2011 at http://yacy.net
//
@ -35,68 +35,75 @@ import java.net.SocketException;
import java.security.KeyStore;
import java.util.Enumeration;
import java.util.StringTokenizer;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.http.servlets.GSAsearchServlet;
import net.yacy.http.servlets.SolrSelectServlet;
import net.yacy.http.servlets.SolrServlet;
import net.yacy.http.servlets.YaCyDefaultServlet;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.utils.PKCS12Tool;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.proxy.ConnectHandler;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.SecureRequestCustomizer;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.ConnectHandler;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.SslConnectionFactory;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
import org.eclipse.jetty.server.handler.DefaultHandler;
import org.eclipse.jetty.server.handler.HandlerList;
import org.eclipse.jetty.server.handler.IPAccessHandler;
import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.webapp.WebAppContext;
/**
* class to embedded Jetty 8 http server into YaCy
* class to embedded Jetty 9 http server into YaCy
*/
public class Jetty8HttpServerImpl implements YaCyHttpServer {
public class Jetty9HttpServerImpl implements YaCyHttpServer {
private final Server server;
/**
* @param port TCP Port to listen for http requests
*/
public Jetty8HttpServerImpl(int port) {
public Jetty9HttpServerImpl(int port) {
Switchboard sb = Switchboard.getSwitchboard();
server = new Server();
SelectChannelConnector connector = new SelectChannelConnector();
ServerConnector connector = new ServerConnector(server);
connector.setPort(port);
connector.setName("httpd:"+Integer.toString(port));
server.addConnector(connector);
// add ssl/https connector
boolean useSSL = sb.getConfigBool("server.https", false);
if (useSSL) {
final SslContextFactory sslContextFactory = new SslContextFactory();
final SSLContext sslContext = initSslContext(sb);
if (sslContext != null) {
int sslport = sb.getConfigInt("port.ssl", 8443);
sslContextFactory.setSslContext(sslContext);
SslSelectChannelConnector sslconnector = new SslSelectChannelConnector(sslContextFactory);
sslconnector.setPort(sslport);
sslconnector.setName("ssld:" + Integer.toString(sslport)); // name must start with ssl (for withSSL() to work correctly)
// SSL HTTP Configuration
HttpConfiguration https_config = new HttpConfiguration();
https_config.addCustomizer(new SecureRequestCustomizer());
// SSL Connector
ServerConnector sslConnector = new ServerConnector(server,
new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()),
new HttpConnectionFactory(https_config));
sslConnector.setPort(sslport);
sslConnector.setName("ssld:" + Integer.toString(sslport)); // name must start with ssl (for withSSL() to work correctly)
server.addConnector(sslconnector);
server.addConnector(sslConnector);
ConcurrentLog.info("SERVER", "SSL support initialized successfully on port " + sslport);
}
}
@ -141,19 +148,21 @@ public class Jetty8HttpServerImpl implements YaCyHttpServer {
// to make sure they are available even if removed in individual web.xml
// additional, optional or individual servlets or servlet mappings can be set in web.xml
// in Jetty 9 servlet should be set only once
// therefore only the settings in web.xml is used
//add SolrSelectServlet
htrootContext.addServlet(SolrSelectServlet.class, "/solr/select"); // uses the default core, collection1
htrootContext.addServlet(SolrSelectServlet.class, "/solr/collection1/select"); // the same servlet, identifies the collection1 core using the path
htrootContext.addServlet(SolrSelectServlet.class, "/solr/webgraph/select"); // the same servlet, identifies the webgraph core using the path
//htrootContext.addServlet(SolrSelectServlet.class, "/solr/select"); // uses the default core, collection1
//htrootContext.addServlet(SolrSelectServlet.class, "/solr/collection1/select"); // the same servlet, identifies the collection1 core using the path
//htrootContext.addServlet(SolrSelectServlet.class, "/solr/webgraph/select"); // the same servlet, identifies the webgraph core using the path
htrootContext.addServlet(SolrServlet.class, "/solr/collection1/admin/luke");
htrootContext.addServlet(SolrServlet.class, "/solr/webgraph/admin/luke");
//htrootContext.addServlet(SolrServlet.class, "/solr/collection1/admin/luke");
//htrootContext.addServlet(SolrServlet.class, "/solr/webgraph/admin/luke");
// add proxy?url= servlet
//htrootContext.addServlet(YaCyProxyServlet.class,"/proxy.html");
// add GSA servlet
htrootContext.addServlet(GSAsearchServlet.class,"/gsa/search");
//htrootContext.addServlet(GSAsearchServlet.class,"/gsa/search");
// --- eof default servlet mappings --------------------------------------------
// define list of YaCy specific general handlers
@ -180,7 +189,7 @@ public class Jetty8HttpServerImpl implements YaCyHttpServer {
// changes will ivalidate all current existing user-password-hashes (from userDB)
loginService.setName(sb.getConfig(SwitchboardConstants.ADMIN_REALM,"YaCy"));
Jetty8YaCySecurityHandler securityHandler = new Jetty8YaCySecurityHandler();
Jetty9YaCySecurityHandler securityHandler = new Jetty9YaCySecurityHandler();
securityHandler.setLoginService(loginService);
htrootContext.setSecurityHandler(securityHandler);
@ -219,7 +228,7 @@ public class Jetty8HttpServerImpl implements YaCyHttpServer {
@Override
public void startupServer() throws Exception {
// option to finish running requests on shutdown
server.setGracefulShutdown(3000);
// server.setGracefulShutdown(3000);
server.setStopAtShutdown(true);
server.start();
}
@ -258,7 +267,10 @@ public class Jetty8HttpServerImpl implements YaCyHttpServer {
public int getSslPort() {
Connector[] clist = server.getConnectors();
for (Connector c:clist) {
if (c.getName().startsWith("ssl")) return c.getPort();
if (c.getName().startsWith("ssl")) {
int port =((ServerConnector)c).getLocalPort();
return port;
}
}
return -1;
}
@ -290,25 +302,25 @@ public class Jetty8HttpServerImpl implements YaCyHttpServer {
final int sslport = Switchboard.getSwitchboard().getConfigInt("port.ssl", 8443);
for (Connector con : cons) {
// check http connector
if (con.getName().startsWith("httpd") && con.getPort() != port) {
con.close();
if (con.getName().startsWith("httpd") && ((ServerConnector)con).getPort() != port) {
((ServerConnector)con).close();
con.stop();
if (!con.isStopped()) {
ConcurrentLog.warn("SERVER", "Reconnect: Jetty Connector failed to stop");
}
con.setPort(port);
((ServerConnector)con).setPort(port);
con.start();
ConcurrentLog.info("SERVER", "set new port for Jetty connector " + con.getName());
continue;
}
// check https connector
if (con.getName().startsWith("ssl") && con.getPort() != sslport) {
con.close();
if (con.getName().startsWith("ssl") && ((ServerConnector)con).getPort() != sslport) {
((ServerConnector)con).close();
con.stop();
if (!con.isStopped()) {
ConcurrentLog.warn("SERVER", "Reconnect: Jetty Connector failed to stop");
}
con.setPort(sslport);
((ServerConnector)con).setPort(sslport);
con.start();
ConcurrentLog.info("SERVER", "set new port for Jetty connector " + con.getName());
}
@ -326,7 +338,7 @@ public class Jetty8HttpServerImpl implements YaCyHttpServer {
* @param username
*/
public void resetUser(String username) {
Jetty8YaCySecurityHandler hx = this.server.getChildHandlerByClass(Jetty8YaCySecurityHandler.class);
Jetty9YaCySecurityHandler hx = this.server.getChildHandlerByClass(Jetty9YaCySecurityHandler.class);
if (hx != null) {
YaCyLoginService loginservice = (YaCyLoginService) hx.getLoginService();
loginservice.loadUser(username);
@ -338,7 +350,7 @@ public class Jetty8HttpServerImpl implements YaCyHttpServer {
* @param username
*/
public void removeUser(String username) {
Jetty8YaCySecurityHandler hx = this.server.getChildHandlerByClass(Jetty8YaCySecurityHandler.class);
Jetty9YaCySecurityHandler hx = this.server.getChildHandlerByClass(Jetty9YaCySecurityHandler.class);
if (hx != null) {
YaCyLoginService loginservice = (YaCyLoginService) hx.getLoginService();
loginservice.removeUser(username);

@ -25,14 +25,12 @@
package net.yacy.http;
import java.net.MalformedURLException;
import net.yacy.cora.document.id.MultiProtocolURL;
import net.yacy.cora.protocol.Domains;
import net.yacy.data.UserDB.AccessRight;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverAccessTracker;
import org.eclipse.jetty.security.ConstraintSecurityHandler;
import org.eclipse.jetty.security.RoleInfo;
import org.eclipse.jetty.server.Request;
@ -42,16 +40,8 @@ import org.eclipse.jetty.server.Request;
* demands authentication for pages with _p. inside
* and updates AccessTracker
*/
public class Jetty8YaCySecurityHandler extends ConstraintSecurityHandler {
public class Jetty9YaCySecurityHandler extends ConstraintSecurityHandler {
public Jetty8YaCySecurityHandler() {
super();
for (AccessRight right : AccessRight.values()) {
addRole(right.toString()); // add default YaCy roles
}
}
/**
* create the constraint for the given path
* for urls containing *_p. (like info_p.html) admin access is required,
@ -67,7 +57,6 @@ public class Jetty8YaCySecurityHandler extends ConstraintSecurityHandler {
final Switchboard sb = Switchboard.getSwitchboard();
final boolean adminAccountGrantedForLocalhost = sb.getConfigBool(SwitchboardConstants.ADMIN_ACCOUNT_FOR_LOCALHOST, false);
final boolean adminAccountNeededForAllPages = sb.getConfigBool(SwitchboardConstants.ADMIN_ACCOUNT_All_PAGES, false);
//final String adminAccountBase64MD5 = sb.getConfig(YaCyLegacyCredential.ADMIN_ACCOUNT_B64MD5, "");
String refererHost;
// update AccessTracker
@ -87,7 +76,6 @@ public class Jetty8YaCySecurityHandler extends ConstraintSecurityHandler {
if (!protectedPage && !sb.getConfigBool(SwitchboardConstants.PUBLIC_SEARCHPAGE, true)) {
protectedPage = pathInContext.startsWith("/solr/") || pathInContext.startsWith("/gsa/");
}
//final boolean accountEmpty = adminAccountBase64MD5.length() == 0;
if (protectedPage) {
if (grantedForLocalhost) {

@ -32,7 +32,7 @@ import net.yacy.server.http.HTTPDProxyHandler;
import org.eclipse.jetty.continuation.Continuation;
import org.eclipse.jetty.continuation.ContinuationSupport;
import org.eclipse.jetty.http.HttpURI;
import org.eclipse.jetty.servlets.ProxyServlet;
import org.eclipse.jetty.proxy.ProxyServlet;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
@ -82,7 +82,7 @@ public class UrlProxyServlet extends ProxyServlet implements Servlet {
super.init(config);
// must be lower case (header names are internally converted to lower)
_DontProxyHeaders.add("host"); // to prevent Host header setting from original servletrequest (which is localhost)
//_DontProxyHeaders.add("host"); // to prevent Host header setting from original servletrequest (which is localhost)
String tmps = config.getInitParameter("stopProxyText");
if (tmps != null) {
_stopProxyText = tmps;
@ -112,9 +112,9 @@ public class UrlProxyServlet extends ProxyServlet implements Servlet {
}
}
if ("CONNECT".equalsIgnoreCase(request.getMethod())) {
/* if ("CONNECT".equalsIgnoreCase(request.getMethod())) {
handleConnect(request, response);
} else {
} else */{
final Continuation continuation = ContinuationSupport.getContinuation(request);
@ -201,7 +201,7 @@ public class UrlProxyServlet extends ProxyServlet implements Servlet {
response.setStatus(httpStatus);
response.setContentType(mimeType);
if ((httpStatus == HttpServletResponse.SC_OK) && (mimeType != null) && mimeType.startsWith("text")) {
if ((httpStatus < HttpServletResponse.SC_BAD_REQUEST) && (mimeType != null) && mimeType.startsWith("text")) {
if (proxyResponseHeader.containsKey(HeaderFramework.TRANSFER_ENCODING) && proxyResponseHeader.get(HeaderFramework.TRANSFER_ENCODING).contains("chunked")) {
proxyout = new ChunkedInputStream(proxyout);
}
@ -280,6 +280,10 @@ public class UrlProxyServlet extends ProxyServlet implements Servlet {
response.getOutputStream().write(sbb);
} else {
if (httpStatus >= HttpServletResponse.SC_BAD_REQUEST) {
response.sendError(httpStatus,"Site " + proxyurl + " returned with status");
return;
}
if ((response.getHeader(HeaderFramework.CONTENT_LENGTH) == null) && prop.containsKey(HeaderFramework.CONNECTION_PROP_PROXY_RESPOND_SIZE)) {
response.setHeader(HeaderFramework.CONTENT_LENGTH, (String) prop.get(HeaderFramework.CONNECTION_PROP_PROXY_RESPOND_SIZE));
}
@ -334,7 +338,7 @@ public class UrlProxyServlet extends ProxyServlet implements Servlet {
* @return destination url from query parameter &url=_destinationurl_
* @throws MalformedURLException
*/
@Override
/* @Override
protected HttpURI proxyHttpURI(HttpServletRequest request, String uri) throws MalformedURLException {
String strARGS = request.getQueryString();
if (strARGS.startsWith("url=")) {
@ -353,7 +357,7 @@ public class UrlProxyServlet extends ProxyServlet implements Servlet {
}
return null;
}
*/
@Override
public String getServletInfo() {
return "YaCy Proxy Servlet";

@ -38,7 +38,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.zip.GZIPInputStream;
import javax.servlet.ReadListener;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@ -48,7 +48,6 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpServletResponse;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.document.analysis.Classification;
import net.yacy.cora.protocol.HeaderFramework;
@ -73,15 +72,18 @@ import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
import net.yacy.server.servletProperties;
import net.yacy.visualization.RasterPlotter;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.eclipse.jetty.http.HttpHeaders;
import org.eclipse.jetty.http.HttpMethods;
import static org.eclipse.jetty.http.HttpHeader.CONTENT_RANGE;
import static org.eclipse.jetty.http.HttpHeader.IF_MODIFIED_SINCE;
import static org.eclipse.jetty.http.HttpHeader.IF_UNMODIFIED_SINCE;
import static org.eclipse.jetty.http.HttpHeader.REQUEST_RANGE;
import static org.eclipse.jetty.http.HttpMethod.HEAD;
import org.eclipse.jetty.http.MimeTypes;
import org.eclipse.jetty.io.Buffer;
import static org.eclipse.jetty.http.MimeTypes.Type.TEXT_HTML;
import static org.eclipse.jetty.http.MimeTypes.Type.TEXT_HTML_UTF_8;
import org.eclipse.jetty.io.WriterOutputStream;
import org.eclipse.jetty.server.InclusiveByteRange;
import org.eclipse.jetty.util.MultiPartOutputStream;
@ -357,7 +359,7 @@ public class YaCyDefaultServlet extends HttpServlet {
}
}
}
/* ------------------------------------------------------------ */
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
@ -409,12 +411,12 @@ public class YaCyDefaultServlet extends HttpServlet {
protected boolean passConditionalHeaders(HttpServletRequest request, HttpServletResponse response, Resource resource)
throws IOException {
try {
if (!request.getMethod().equals(HttpMethods.HEAD)) {
if (!request.getMethod().equals(HEAD.asString())) {
String ifms = request.getHeader(HttpHeaders.IF_MODIFIED_SINCE);
String ifms = request.getHeader(IF_MODIFIED_SINCE.asString());
if (ifms != null) {
long ifmsl = request.getDateHeader(HttpHeaders.IF_MODIFIED_SINCE);
long ifmsl = request.getDateHeader(IF_MODIFIED_SINCE.asString());
if (ifmsl != -1) {
if (resource.lastModified() / 1000 <= ifmsl / 1000) {
response.reset();
@ -426,7 +428,7 @@ public class YaCyDefaultServlet extends HttpServlet {
}
// Parse the if[un]modified dates and compare to resource
long date = request.getDateHeader(HttpHeaders.IF_UNMODIFIED_SINCE);
long date = request.getDateHeader(IF_UNMODIFIED_SINCE.asString());
if (date != -1) {
if (resource.lastModified() / 1000 > date / 1000) {
@ -464,7 +466,7 @@ public class YaCyDefaultServlet extends HttpServlet {
}
byte[] data = dir.getBytes("UTF-8");
response.setContentType(MimeTypes.TEXT_HTML_UTF_8);
response.setContentType(TEXT_HTML_UTF_8.asString());
response.setContentLength(data.length);
response.getOutputStream().write(data);
}
@ -510,10 +512,10 @@ public class YaCyDefaultServlet extends HttpServlet {
List<?> ranges = InclusiveByteRange.satisfiableRanges(reqRanges, content_length);
// if there are no satisfiable ranges, send 416 response
if (ranges == null || ranges.size() == 0) {
if (ranges == null || ranges.isEmpty()) {
writeHeaders(response, resource, content_length);
response.setStatus(HttpServletResponse.SC_REQUESTED_RANGE_NOT_SATISFIABLE);
response.setHeader(HttpHeaders.CONTENT_RANGE,
response.setHeader(CONTENT_RANGE.asString(),
InclusiveByteRange.to416HeaderRangeString(content_length));
resource.writeTo(out, 0, content_length);
out.close();
@ -528,7 +530,7 @@ public class YaCyDefaultServlet extends HttpServlet {
long singleLength = singleSatisfiableRange.getSize(content_length);
writeHeaders(response, resource, singleLength);
response.setStatus(HttpServletResponse.SC_PARTIAL_CONTENT);
response.setHeader(HttpHeaders.CONTENT_RANGE,
response.setHeader(CONTENT_RANGE.asString(),
singleSatisfiableRange.toHeaderRangeString(content_length));
resource.writeTo(out, singleSatisfiableRange.getFirst(content_length), singleLength);
out.close();
@ -551,7 +553,7 @@ public class YaCyDefaultServlet extends HttpServlet {
// send an old style multipart/x-byteranges Content-Type. This
// keeps Netscape and acrobat happy. This is what Apache does.
String ctp;
if (request.getHeader(HttpHeaders.REQUEST_RANGE) != null) {
if (request.getHeader(REQUEST_RANGE.asString()) != null) {
ctp = "multipart/x-byteranges; boundary=";
} else {
ctp = "multipart/byteranges; boundary=";
@ -612,9 +614,9 @@ public class YaCyDefaultServlet extends HttpServlet {
/* ------------------------------------------------------------ */
protected void writeHeaders(HttpServletResponse response, Resource resource, long count) {
if (response.getContentType() == null) {
Buffer extensionmime;
final String extensionmime;
if ((extensionmime = _mimeTypes.getMimeByExtension(resource.getName())) != null) {
response.setContentType(extensionmime.toString());
response.setContentType(extensionmime);
}
}
@ -795,13 +797,7 @@ public class YaCyDefaultServlet extends HttpServlet {
} else {
tmp = invokeServlet(targetClass, legacyRequestHeader, args);
}
} catch (InvocationTargetException e) {
ConcurrentLog.logException(e);
throw new ServletException(targetFile.getAbsolutePath());
} catch (IllegalArgumentException e) {
ConcurrentLog.logException(e);
throw new ServletException(targetFile.getAbsolutePath());
} catch (IllegalAccessException e) {
} catch (InvocationTargetException | IllegalArgumentException | IllegalAccessException e) {
ConcurrentLog.logException(e);
throw new ServletException(targetFile.getAbsolutePath());
}
@ -834,7 +830,7 @@ public class YaCyDefaultServlet extends HttpServlet {
result = RasterPlotter.exportImage(bi, targetExt);
}
final String mimeType = Classification.ext2mime(targetExt, MimeTypes.TEXT_HTML);
final String mimeType = Classification.ext2mime(targetExt, TEXT_HTML.asString());
response.setContentType(mimeType);
response.setContentLength(result.length());
response.setStatus(HttpServletResponse.SC_OK);
@ -894,14 +890,14 @@ public class YaCyDefaultServlet extends HttpServlet {
templatePatterns.putHTML("newpeer_peerhash", myPeer.hash);
templatePatterns.put("navigation-p2p", sb.getConfigBool(SwitchboardConstants.DHT_ENABLED, true) || !sb.isRobinsonMode() ? 1 : 0);
String submitted = sb.getConfig("server.servlets.submitted", "");
boolean crawler_enabled = submitted.indexOf("Crawler_p") >= 0;
boolean advanced_enabled = crawler_enabled || submitted.indexOf("ConfigBasic") >= 0 || submitted.indexOf("CrawlStart") >= 0;
boolean crawler_enabled = submitted.contains("Crawler_p");
boolean advanced_enabled = crawler_enabled || submitted.contains("ConfigBasic") || submitted.contains("CrawlStart");
templatePatterns.put("navigation-crawlmonitor", crawler_enabled);
templatePatterns.put("navigation-advanced", advanced_enabled);
templatePatterns.put(SwitchboardConstants.GREETING_HOMEPAGE, sb.getConfig(SwitchboardConstants.GREETING_HOMEPAGE, ""));
templatePatterns.put(SwitchboardConstants.GREETING_SMALL_IMAGE, sb.getConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, ""));
String mimeType = Classification.ext2mime(targetExt, MimeTypes.TEXT_HTML);
String mimeType = Classification.ext2mime(targetExt, TEXT_HTML.asString());
InputStream fis;
long fileSize = targetFile.length();
@ -926,9 +922,9 @@ public class YaCyDefaultServlet extends HttpServlet {
}
}
private static final String appendPath(String proplist, String path) {
private static String appendPath(String proplist, String path) {
if (proplist.length() == 0) return path;
if (proplist.indexOf(path) >= 0) return proplist;
if (proplist.contains(path)) return proplist;
return proplist + "," + path;
}
@ -1057,5 +1053,28 @@ public class YaCyDefaultServlet extends HttpServlet {
public void close() throws IOException {
in.close();
}
@Override
public boolean isFinished() {
try {
return (in.available() < 1);
} catch (IOException ex) {
return true;
}
}
@Override
public boolean isReady() {
try {
return in.available() > 0;
} catch (IOException ex) {
return false;
}
}
@Override
public void setReadListener(ReadListener rl) {
// TODO: implement
}
}
}

@ -39,7 +39,7 @@ import net.yacy.server.http.HTTPDProxyHandler;
import org.eclipse.jetty.continuation.Continuation;
import org.eclipse.jetty.continuation.ContinuationSupport;
import org.eclipse.jetty.http.HttpURI;
import org.eclipse.jetty.servlets.ProxyServlet;
import org.eclipse.jetty.proxy.ProxyServlet;
/**
* Servlet to implement proxy via url parameter "/proxy.html?url=xyz_urltoproxy"
@ -65,7 +65,7 @@ public class YaCyProxyServlet extends ProxyServlet implements Servlet {
super.init(config);
// must be lower case (header names are internally converted to lower)
_DontProxyHeaders.add("host"); // to prevent Host header setting from original servletrequest (which is localhost)
//_DontProxyHeaders.add("host"); // to prevent Host header setting from original servletrequest (which is localhost)
}
/* ------------------------------------------------------------ */
@ -90,9 +90,8 @@ public class YaCyProxyServlet extends ProxyServlet implements Servlet {
}
}
if ("CONNECT".equalsIgnoreCase(request.getMethod())) {
handleConnect(request, response);
} else {
/* handleConnect(request, response);
} else*/ {
final Continuation continuation = ContinuationSupport.getContinuation(request);
@ -342,7 +341,7 @@ public class YaCyProxyServlet extends ProxyServlet implements Servlet {
* @return destination url from query parameter &url=_destinationurl_
* @throws MalformedURLException
*/
@Override
/* @Override
protected HttpURI proxyHttpURI(HttpServletRequest request, String uri) throws MalformedURLException {
String strARGS = request.getQueryString();
if (strARGS.startsWith("url=")) {
@ -361,7 +360,7 @@ public class YaCyProxyServlet extends ProxyServlet implements Servlet {
}
return null;
}
*/
@Override
public String getServletInfo() {
return "YaCy Proxy Servlet";

@ -38,9 +38,8 @@ import java.io.RandomAccessFile;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
import java.util.Properties;
import java.util.concurrent.Semaphore;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Semaphore;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.RequestHeader;
@ -51,8 +50,8 @@ import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.Translator;
import net.yacy.gui.YaCyApp;
import net.yacy.gui.framework.Browser;
import net.yacy.http.Jetty9HttpServerImpl;
import net.yacy.http.YaCyHttpServer;
import net.yacy.http.Jetty8HttpServerImpl;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.Formatter;
import net.yacy.kelondro.util.MemoryControl;
@ -286,7 +285,7 @@ public final class yacy {
try {
// start http server
YaCyHttpServer httpServer;
httpServer = new Jetty8HttpServerImpl(port);
httpServer = new Jetty9HttpServerImpl(port);
httpServer.startupServer();
sb.setHttpServer(httpServer);
ConcurrentLog.info("STARTUP",httpServer.getVersion());

Loading…
Cancel
Save