Merge remote-tracking branch 'origin/master'

Conflicts:
	htroot/Load_MediawikiWiki.java
	htroot/Load_PHPBB3.java
	htroot/ViewImage.java
pull/39/head
luccioman 9 years ago
commit 6e96c7341a

@ -20,79 +20,77 @@
<classpathentry kind="lib" path="lib/commons-jxpath-1.3.jar"/>
<classpathentry kind="lib" path="lib/jsch-0.1.53.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.3.1.jar"/>
<classpathentry kind="lib" path="lib/commons-fileupload-1.3.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/commons-compress-1.10.jar"/>
<classpathentry kind="lib" path="lib/commons-compress-1.11.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.10.jar"/>
<classpathentry kind="lib" path="lib/jcl-over-slf4j-1.7.13.jar"/>
<classpathentry kind="lib" path="lib/slf4j-jdk14-1.7.13.jar"/>
<classpathentry kind="lib" path="lib/log4j-over-slf4j-1.7.13.jar"/>
<classpathentry kind="lib" path="lib/httpcore-4.4.4.jar"/>
<classpathentry kind="lib" path="lib/metadata-extractor-2.8.1.jar"/>
<classpathentry kind="lib" path="lib/jcl-over-slf4j-1.7.21.jar"/>
<classpathentry kind="lib" path="lib/slf4j-jdk14-1.7.21.jar"/>
<classpathentry kind="lib" path="lib/log4j-over-slf4j-1.7.21.jar"/>
<classpathentry kind="lib" path="lib/httpcore-4.4.5.jar"/>
<classpathentry kind="lib" path="lib/metadata-extractor-2.9.1.jar"/>
<classpathentry kind="lib" path="lib/xmpcore-5.1.2.jar"/>
<classpathentry kind="lib" path="lib/jcifs-1.3.17.jar"/>
<classpathentry kind="lib" path="lib/guava-18.0.jar"/>
<classpathentry kind="lib" path="lib/spatial4j-0.4.1.jar"/>
<classpathentry kind="lib" path="lib/spatial4j-0.5.jar"/>
<classpathentry kind="lib" path="lib/zookeeper-3.4.6.jar"/>
<classpathentry kind="lib" path="lib/org.restlet.jar"/>
<classpathentry kind="lib" path="lib/fontbox-1.8.11.jar"/>
<classpathentry kind="lib" path="lib/jempbox-1.8.11.jar"/>
<classpathentry kind="lib" path="lib/pdfbox-1.8.11.jar"/>
<classpathentry kind="lib" path="lib/fontbox-2.0.2.jar"/>
<classpathentry kind="lib" path="lib/pdfbox-2.0.2.jar"/>
<classpathentry kind="lib" path="lib/bcmail-jdk15-1.46.jar"/>
<classpathentry kind="lib" path="lib/bcprov-jdk15-1.46.jar"/>
<classpathentry kind="lib" path="lib/poi-3.13-20150929.jar"/>
<classpathentry kind="lib" path="lib/poi-scratchpad-3.13-20150929.jar"/>
<classpathentry kind="lib" path="lib/commons-io-2.4.jar"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.7.13.jar"/>
<classpathentry kind="lib" path="lib/poi-3.14-20160307.jar"/>
<classpathentry kind="lib" path="lib/poi-scratchpad-3.14-20160307.jar"/>
<classpathentry kind="lib" path="lib/commons-io-2.5.jar"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.7.21.jar"/>
<classpathentry kind="lib" path="lib/chardet.jar"/>
<classpathentry kind="lib" path="lib/jetty-client-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-continuation-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-deploy-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-http-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-io-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-jmx-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-proxy-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-security-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-server-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-servlet-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-servlets-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-util-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-webapp-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-xml-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/httpclient-4.5.1.jar"/>
<classpathentry kind="lib" path="lib/httpmime-4.5.1.jar"/>
<classpathentry kind="lib" path="lib/jetty-client-9.2.17.v20160517.jar"/>
<classpathentry kind="lib" path="lib/jetty-continuation-9.2.17.v20160517.jar"/>
<classpathentry kind="lib" path="lib/jetty-deploy-9.2.17.v20160517.jar"/>
<classpathentry kind="lib" path="lib/jetty-http-9.2.17.v20160517.jar"/>
<classpathentry kind="lib" path="lib/jetty-io-9.2.17.v20160517.jar"/>
<classpathentry kind="lib" path="lib/jetty-jmx-9.2.17.v20160517.jar"/>
<classpathentry kind="lib" path="lib/jetty-proxy-9.2.17.v20160517.jar"/>
<classpathentry kind="lib" path="lib/jetty-security-9.2.17.v20160517.jar"/>
<classpathentry kind="lib" path="lib/jetty-server-9.2.17.v20160517.jar"/>
<classpathentry kind="lib" path="lib/jetty-servlet-9.2.17.v20160517.jar"/>
<classpathentry kind="lib" path="lib/jetty-servlets-9.2.17.v20160517.jar"/>
<classpathentry kind="lib" path="lib/jetty-util-9.2.17.v20160517.jar"/>
<classpathentry kind="lib" path="lib/jetty-webapp-9.2.17.v20160517.jar"/>
<classpathentry kind="lib" path="lib/jetty-xml-9.2.17.v20160517.jar"/>
<classpathentry kind="lib" path="lib/httpclient-4.5.2.jar"/>
<classpathentry kind="lib" path="lib/httpmime-4.5.2.jar"/>
<classpathentry kind="lib" path="lib/noggit-0.6.jar"/>
<classpathentry kind="lib" path="lib/solr-core-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/solr-solrj-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/solr-core-5.5.1.jar"/>
<classpathentry kind="lib" path="lib/solr-solrj-5.5.1.jar"/>
<classpathentry kind="lib" path="lib/stax2-api-3.1.4.jar"/>
<classpathentry kind="lib" path="lib/woodstox-core-asl-4.4.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-common-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-phonetic-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-classification-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-codecs-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-core-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-facet-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-grouping-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-highlighter-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-join-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-memory-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-misc-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-queries-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-queryparser-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-spatial-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-suggest-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-backward-codecs-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-common-5.5.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-phonetic-5.5.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-classification-5.5.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-codecs-5.5.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-core-5.5.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-facet-5.5.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-grouping-5.5.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-highlighter-5.5.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-join-5.5.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-memory-5.5.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-misc-5.5.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-queries-5.5.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-queryparser-5.5.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-spatial-5.5.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-suggest-5.5.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-backward-codecs-5.5.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="lib/icu4j-56_1.jar"/>
<classpathentry kind="lib" path="lib/icu4j-57_1.jar"/>
<classpathentry kind="lib" path="lib/htmllexer.jar"/>
<classpathentry kind="lib" path="lib/jsoup-1.8.3.jar"/>
<classpathentry kind="lib" path="lib/jsoup-1.9.2.jar"/>
<classpathentry kind="lib" path="lib/javax.servlet-api-3.1.0.jar"/>
<classpathentry kind="lib" path="lib/weupnp-0.1.3.jar"/>
<classpathentry kind="lib" path="lib/weupnp-0.1.4.jar"/>
<classpathentry kind="lib" path="lib/common-image-3.2.1.jar"/>
<classpathentry kind="lib" path="lib/common-io-3.2.1.jar"/>
<classpathentry kind="lib" path="lib/common-lang-3.2.1.jar"/>
@ -102,5 +100,6 @@
<classpathentry kind="lib" path="lib/imageio-bmp-3.2.1.jar"/>
<classpathentry kind="lib" path="lib/jsonic-1.2.0.jar"/>
<classpathentry kind="lib" path="lib/langdetect.jar"/>
<classpathentry kind="lib" path="lib/xliff-core-1.2-1.1.jar"/>
<classpathentry kind="output" path="gen"/>
</classpath>

38
.gitignore vendored

@ -1,19 +1,19 @@
*.class
*.*~
lib/yacycore.jar
libbuild/svnRevNr.jar
libbuild/GitRevTask.jar
gen/**
/DATA
classes/
RELEASE/
/yacy.pid
.DS_Store
lib/yacy-cora.jar
/DATA.bkp
/DATA.1
/gen
/api
/winDATA.bkp/
/DATA.cloud/
yacy.log
*.class
*.*~
lib/yacycore.jar
libbuild/svnRevNr.jar
libbuild/GitRevTask.jar
gen/**
/DATA
classes/
RELEASE/
/yacy.pid
.DS_Store
/DATA.bkp
/DATA.1
/gen
/api
/winDATA.bkp/
/DATA.cloud/
yacy.log
/target/

@ -35,17 +35,13 @@
<outputDirectory>htroot</outputDirectory>
</fileSet>
<fileSet>
<directory>langstats</directory>
<outputDirectory>langstats</outputDirectory>
<directory>langdetect</directory>
<outputDirectory>langdetect</outputDirectory>
</fileSet>
<fileSet>
<directory>locales</directory>
<outputDirectory>locales</outputDirectory>
</fileSet>
<fileSet>
<directory>ranking</directory>
<outputDirectory>ranking</outputDirectory>
</fileSet>
<fileSet>
<directory>skins</directory>
<outputDirectory>skins</outputDirectory>

@ -160,8 +160,6 @@
<!-- when changing paths here, please also update the paths in /addon/YaCy.app/Contents/Info.plist -->
<path id="project.class.path">
<pathelement location="${build}" />
<pathelement location="${htroot}" />
<pathelement location="${lib}/apache-mime4j-0.6.jar" />
<pathelement location="${lib}/bcmail-jdk15-1.46.jar" />
<pathelement location="${lib}/bcprov-jdk15-1.46.jar" />
<pathelement location="${lib}/chardet.jar" />
@ -169,19 +167,19 @@
<pathelement location="${lib}/common-io-3.2.1.jar" />
<pathelement location="${lib}/common-lang-3.2.1.jar" />
<pathelement location="${lib}/commons-codec-1.10.jar" />
<pathelement location="${lib}/commons-compress-1.10.jar" />
<pathelement location="${lib}/commons-fileupload-1.3.1.jar" />
<pathelement location="${lib}/commons-io-2.4.jar" />
<pathelement location="${lib}/commons-compress-1.11.jar" />
<pathelement location="${lib}/commons-fileupload-1.3.2.jar" />
<pathelement location="${lib}/commons-io-2.5.jar" />
<pathelement location="${lib}/commons-jxpath-1.3.jar" />
<pathelement location="${lib}/commons-lang-2.6.jar" />
<pathelement location="${lib}/commons-logging-1.2.jar" />
<pathelement location="${lib}/fontbox-1.8.11.jar" />
<pathelement location="${lib}/fontbox-2.0.2.jar" />
<pathelement location="${lib}/guava-18.0.jar" />
<pathelement location="${lib}/htmllexer.jar" />
<pathelement location="${lib}/httpclient-4.5.1.jar" />
<pathelement location="${lib}/httpcore-4.4.4.jar" />
<pathelement location="${lib}/httpmime-4.5.1.jar" />
<pathelement location="${lib}/icu4j-56_1.jar" />
<pathelement location="${lib}/httpclient-4.5.2.jar" />
<pathelement location="${lib}/httpcore-4.4.5.jar" />
<pathelement location="${lib}/httpmime-4.5.2.jar" />
<pathelement location="${lib}/icu4j-57_1.jar" />
<pathelement location="${lib}/imageio-bmp-3.2.1.jar" />
<pathelement location="${lib}/imageio-core-3.2.1.jar" />
<pathelement location="${lib}/imageio-metadata-3.2.1.jar" />
@ -191,60 +189,60 @@
<pathelement location="${lib}/jaudiotagger-2.0.4-20111207.115108-15.jar" />
<pathelement location="${lib}/javax.servlet-api-3.1.0.jar" />
<pathelement location="${lib}/jcifs-1.3.17.jar" />
<pathelement location="${lib}/jcl-over-slf4j-1.7.13.jar" />
<pathelement location="${lib}/jempbox-1.8.11.jar" />
<pathelement location="${lib}/jetty-client-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-continuation-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-deploy-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-http-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-io-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-jmx-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-proxy-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-security-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-server-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-servlet-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-servlets-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-util-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-webapp-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-xml-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jcl-over-slf4j-1.7.21.jar" />
<pathelement location="${lib}/jetty-client-9.2.17.v20160517.jar" />
<pathelement location="${lib}/jetty-continuation-9.2.17.v20160517.jar" />
<pathelement location="${lib}/jetty-deploy-9.2.17.v20160517.jar" />
<pathelement location="${lib}/jetty-http-9.2.17.v20160517.jar" />
<pathelement location="${lib}/jetty-io-9.2.17.v20160517.jar" />
<pathelement location="${lib}/jetty-jmx-9.2.17.v20160517.jar" />
<pathelement location="${lib}/jetty-proxy-9.2.17.v20160517.jar" />
<pathelement location="${lib}/jetty-security-9.2.17.v20160517.jar" />
<pathelement location="${lib}/jetty-server-9.2.17.v20160517.jar" />
<pathelement location="${lib}/jetty-servlet-9.2.17.v20160517.jar" />
<pathelement location="${lib}/jetty-servlets-9.2.17.v20160517.jar" />
<pathelement location="${lib}/jetty-util-9.2.17.v20160517.jar" />
<pathelement location="${lib}/jetty-webapp-9.2.17.v20160517.jar" />
<pathelement location="${lib}/jetty-xml-9.2.17.v20160517.jar" />
<pathelement location="${lib}/jsch-0.1.53.jar" />
<pathelement location="${lib}/json-simple-1.1.1.jar" />
<pathelement location="${lib}/jsoup-1.8.3.jar" />
<pathelement location="${lib}/log4j-over-slf4j-1.7.13.jar" />
<pathelement location="${lib}/lucene-analyzers-common-5.4.0.jar" />
<pathelement location="${lib}/lucene-analyzers-phonetic-5.4.0.jar" />
<pathelement location="${lib}/lucene-backward-codecs-5.4.0.jar" />
<pathelement location="${lib}/lucene-classification-5.4.0.jar" />
<pathelement location="${lib}/lucene-codecs-5.4.0.jar" />
<pathelement location="${lib}/lucene-core-5.4.0.jar" />
<pathelement location="${lib}/lucene-facet-5.4.0.jar" />
<pathelement location="${lib}/lucene-grouping-5.4.0.jar" />
<pathelement location="${lib}/lucene-highlighter-5.4.0.jar" />
<pathelement location="${lib}/lucene-join-5.4.0.jar" />
<pathelement location="${lib}/lucene-memory-5.4.0.jar" />
<pathelement location="${lib}/lucene-misc-5.4.0.jar" />
<pathelement location="${lib}/lucene-queries-5.4.0.jar" />
<pathelement location="${lib}/lucene-queryparser-5.4.0.jar" />
<pathelement location="${lib}/lucene-spatial-5.4.0.jar" />
<pathelement location="${lib}/lucene-suggest-5.4.0.jar" />
<pathelement location="${lib}/jsoup-1.9.2.jar" />
<pathelement location="${lib}/log4j-over-slf4j-1.7.21.jar" />
<pathelement location="${lib}/lucene-analyzers-common-5.5.1.jar" />
<pathelement location="${lib}/lucene-analyzers-phonetic-5.5.1.jar" />
<pathelement location="${lib}/lucene-backward-codecs-5.5.1.jar" />
<pathelement location="${lib}/lucene-classification-5.5.1.jar" />
<pathelement location="${lib}/lucene-codecs-5.5.1.jar" />
<pathelement location="${lib}/lucene-core-5.5.1.jar" />
<pathelement location="${lib}/lucene-facet-5.5.1.jar" />
<pathelement location="${lib}/lucene-grouping-5.5.1.jar" />
<pathelement location="${lib}/lucene-highlighter-5.5.1.jar" />
<pathelement location="${lib}/lucene-join-5.5.1.jar" />
<pathelement location="${lib}/lucene-memory-5.5.1.jar" />
<pathelement location="${lib}/lucene-misc-5.5.1.jar" />
<pathelement location="${lib}/lucene-queries-5.5.1.jar" />
<pathelement location="${lib}/lucene-queryparser-5.5.1.jar" />
<pathelement location="${lib}/lucene-spatial-5.5.1.jar" />
<pathelement location="${lib}/lucene-suggest-5.5.1.jar" />
<pathelement location="${lib}/jsonic-1.2.0.jar" />
<pathelement location="${lib}/langdetect.jar" />
<pathelement location="${lib}/metadata-extractor-2.8.1.jar" />
<pathelement location="${lib}/metadata-extractor-2.9.1.jar" />
<pathelement location="${lib}/noggit-0.5.jar" />
<pathelement location="${lib}/org.restlet.jar" />
<pathelement location="${lib}/pdfbox-1.8.11.jar" />
<pathelement location="${lib}/poi-3.13-20150929.jar" />
<pathelement location="${lib}/poi-scratchpad-3.13-20150929.jar" />
<pathelement location="${lib}/slf4j-api-1.7.13.jar" />
<pathelement location="${lib}/slf4j-jdk14-1.7.13.jar" />
<pathelement location="${lib}/solr-core-5.4.0.jar" />
<pathelement location="${lib}/solr-solrj-5.4.0.jar" />
<pathelement location="${lib}/spatial4j-0.4.1.jar" />
<pathelement location="${lib}/pdfbox-2.0.2.jar" />
<pathelement location="${lib}/poi-3.14-20160307.jar" />
<pathelement location="${lib}/poi-scratchpad-3.14-20160307.jar" />
<pathelement location="${lib}/slf4j-api-1.7.21.jar" />
<pathelement location="${lib}/slf4j-jdk14-1.7.21.jar" />
<pathelement location="${lib}/solr-core-5.5.1.jar" />
<pathelement location="${lib}/solr-solrj-5.5.1.jar" />
<pathelement location="${lib}/spatial4j-0.5.jar" />
<pathelement location="${lib}/stax2-api_3.1.4.jar" />
<pathelement location="${lib}/webcat-swf-0.1.jar" />
<pathelement location="${lib}/weupnp-0.1.3.jar" />
<pathelement location="${lib}/weupnp-0.1.4.jar" />
<pathelement location="${lib}/woodstox-core-asl-4.4.1.jar" />
<pathelement location="${lib}/xercesImpl.jar" />
<pathelement location="${lib}/xliff-core-1.2-1.1.jar" />
<pathelement location="${lib}/xml-apis.jar" />
<pathelement location="${lib}/xmpcore-5.1.2.jar" />
<pathelement location="${lib}/zookeeper-3.4.6.jar" />
@ -292,21 +290,6 @@
</target>
<target name="compile-cora" depends="init" description="compile YaCy cora component">
<!-- compile the cora sources -->
<javac srcdir="${src}/net/yacy/cora/" destdir="${build}/"
debug="true" debuglevel="lines,vars,source"
source="${javacSource}" target="${javacTarget}" encoding="UTF-8">
<classpath refid="project.class.path" />
<compilerarg value="-Xlint"/>
</javac>
<!-- make yacy-cora.jar -->
<jar destfile="${lib}/yacy-cora.jar" includes="**/net/yacy/cora/**" basedir="${build}/"></jar>
</target>
<target name="compile" depends="compile-core" description="compile YaCy core and YaCy servlets">
<!-- compile htroot, htroot/yacy and htroot/htdocsdefault -->
<javac srcdir="${htroot}/"
@ -528,7 +511,6 @@
<delete file="${build}/net/yacy/peers/operation/yacyBuildProperties.java" failonerror="false"/>
<delete file="${build}/log4j.properties" failonerror="false"/>
<delete file="${lib}/yacycore.jar" failonerror="false"/>
<delete file="${lib}/yacy-cora.jar" failonerror="false"/>
<delete file="${lib}/svnRevNr.jar" failonerror="false"/>
<delete file="${libbuild}/svnRevNr.jar" failonerror="false"/>
<delete file="${libbuild}/GitRevTask.jar" failonerror="false"/>
@ -660,7 +642,6 @@
<java classname="net.yacy.yacy" fork="yes">
<classpath>
<pathelement location="${build}"/>
<pathelement location="${htroot}"/>
<pathelement location="${lib}" />
<fileset dir="${lib}" includes="**/*.jar" />
</classpath>
@ -680,7 +661,6 @@
<classpath refid="run.classpath"/>
<classpath>
<pathelement location="${build}"/>
<pathelement location="${htroot}"/>
<pathelement location="${lib}" />
<fileset dir="${lib}" includes="**/*.jar" />
</classpath>
@ -716,7 +696,6 @@
<java classname="net.yacy.yacy" fork="yes">
<classpath>
<pathelement location="${build}"/>
<pathelement location="${htroot}"/>
<pathelement location="${lib}" />
<fileset dir="${lib}" includes="**/*.jar" />
</classpath>

3
debian/control vendored

@ -7,7 +7,8 @@ Standards-Version: 3.7.2
Package: yacy
Architecture: all
Depends: openjdk-7-jre-headless, sudo, debconf
Depends: java7-runtime-headless | java8-runtime-headless, sudo, debconf
Suggests: curl | wget
Description: Peer-to-Peer Web Search Engine
YaCy is a Java-based peer-to-peer search engine.
It provides a personal web search engine, which is

@ -327,9 +327,6 @@ search.BlackLists=url.default.black
surftips.BlackLists=url.default.black
news.BlackLists=url.default.black
proxyCookieBlackList=cookie.default.black
proxyCookieWhiteList=cookie.default.black
# the blue-list;
# no search result is locally presented that has any word of the bluelist
# in the search words, the URL or the URL's description
@ -664,10 +661,7 @@ collection=user
730_ccfilter_busysleep=1000
730_ccfilter_memprereq=1048576
730_ccfilter_loadprereq=8.0
80_searchresult_idlesleep=10000
80_searchresult_busysleep=200
80_searchresult_memprereq=0
80_searchresult_loadprereq=2.0
85_scheduler_idlesleep=60000
85_scheduler_busysleep=60000
85_scheduler_memprereq=1048576
@ -1004,6 +998,9 @@ httpc.nameCacheNoCachingPatterns = .*.ath.cx,.*.blogdns.*,.*.boldlygoingnowhere.
#squid Redirector compatible
externalRedirector=
# the Yacy Version this config was created with
Version=
# old version value (keep to allow conversion of .conf, until next main releas > 1.83)
svnRevision=0
currentSkin=pdbootstrap
@ -1039,7 +1036,7 @@ search.ranking.rwi.profile =
search.ranking.solr.collection.boostname.tmpa.0=Default Profile
search.ranking.solr.collection.boostfields.tmpa.0=url_paths_sxt^3.0,synonyms_sxt^0.5,title^5.0,text_t^1.0,host_s^6.0,h1_txt^5.0,url_file_name_tokens_t^4.0,h2_txt^3.0,keywords^2.0,description_txt^1.5,author^1.0
search.ranking.solr.collection.filterquery.tmpa.0=
search.ranking.solr.collection.boostquery.tmpa.0=crawldepth_i:0^0.8 crawldepth_i:1^0.4
search.ranking.solr.collection.boostquery.tmpa.0=crawldepth_i:0^0.8\ncrawldepth_i:1^0.4
search.ranking.solr.collection.boostfunction.tmpb.0=
search.ranking.solr.collection.boostname.tmpa.1=Date Profile: sort by date in descending order for a '/date' usage
search.ranking.solr.collection.boostfields.tmpa.1=url_paths_sxt^0.1,title^0.1,text_t^0.1
@ -1054,7 +1051,7 @@ search.ranking.solr.collection.boostfunction.tmpb.2=
search.ranking.solr.collection.boostname.tmpa.3=_unused3
search.ranking.solr.collection.boostfields.tmpa.3=text_t^1.0
search.ranking.solr.collection.filterquery.tmpa.3=
search.ranking.solr.collection.boostquery.tmpa.3=crawldepth_i:0^0.8 crawldepth_i:1^0.4
search.ranking.solr.collection.boostquery.tmpa.3=crawldepth_i:0^0.8\ncrawldepth_i:1^0.4
search.ranking.solr.collection.boostfunction.tmpb.3=
# the following values are used to identify duplicate content

@ -58,18 +58,13 @@ network.unit.remotecrawl.speed = 300
network.unit.bootstrap.seedlist0 = http://www.yacy.net/seed.txt
network.unit.bootstrap.seedlist1 = http://low.audioattack.de/yacy/seed.txt
network.unit.bootstrap.seedlist2 = http://sixcooler.de/yacy/seed.txt
network.unit.bootstrap.seedlist3 = http://fennec.cx/yacy/seed.txt
network.unit.bootstrap.seedlist4 = http://buelte.com/share/seed.txt
network.unit.bootstrap.seedlist5 = http://esbek.iv.net.pl/yacy/seed.txt
network.unit.bootstrap.seedlist6 = http://freenode.homeunix.org/yacy/seed.txt
network.unit.bootstrap.seedlist7 = http://yacy.tschability.ch/seed.txt
network.unit.bootstrap.seedlist8 = http://xz1.nl/yacy/seed.txt
network.unit.bootstrap.seedlist9 = http://massagefreun.de/yacy/seed.txt
network.unit.bootstrap.seedlist10 = http://yacy-vs2.db0anf.de/bootstrap/vs2-seed.txt
network.unit.bootstrap.seedlist11 = http://178.63.78.81:8090/www/seed.txt
network.unit.bootstrap.seedlist12 = http://188.243.64.125:37852/yacy/seed.txt
network.unit.bootstrap.seedlist13 = http://213.174.50.179/seed.txt
network.unit.bootstrap.seedlist14 = http://87.106.29.77:59465/seed.txt
network.unit.bootstrap.seedlist3 = http://yacyseed.underworld.fr/seed.txt
network.unit.bootstrap.seedlist4 = http://yacycalou.net:8090/seed.txt
network.unit.bootstrap.seedlist5 = http://yacyseed.fherb.de/seed.txt
network.unit.bootstrap.seedlist6 = http://fennec.cx/yacy/seed.txt
network.unit.bootstrap.seedlist7 = http://freenode.homeunix.org/yacy/seed.txt
network.unit.bootstrap.seedlist8 = http://yacy.tschability.ch/seed.txt
network.unit.bootstrap.seedlist9 = http://xz1.nl/yacy/seed.txt
# each network may use different yacy distributions.
# the auto-updater can access network-specific update locations

@ -0,0 +1,78 @@
# Network definition file for the freeworld network
# this is the default standard network for fresh YaCy Peers
# -----------------------------------------------------------------#
# for an explanation please see the file yacy.network.readme #
# this is a work in progress. disabled properties are not yet used #
# -----------------------------------------------------------------#
# define the name of the nework
# this nickname is also used to identifiy network requests
network.unit.name = zeronet
# the visible name of the network
network.unit.description = ZeroNet Search Index
# definition of the content domain: possible values are:
# global, local, any
network.unit.domain = any
# maximum search time for remote queries (milliseconds)
network.unit.remotesearch.maxtime = 3000
# maximum number of results per remote query
network.unit.remotesearch.maxcount = 10
# flag to switch on dht transmission
# if the dht transmission is set to 'false' then for a global
# query all targets are accessed
network.unit.dht = false
# the number of redundant target peers:
# redundant peers get a copy of the original dht target information
network.unit.dhtredundancy.junior = 1
network.unit.dhtredundancy.senior = 3
# the vertical partition of the dht: this applies a division
# of the dht into 2^^<partitionExponent> fragments which get
# all the same word-partition targets but a document-dht computed
# fragment of all documents
network.unit.dht.partitionExponent = 4
# network request burst attributes: this enables non-dht target
# positions for certain situations. This is not a 'traditional' burst-mode
# since it does not refer to a handshake to a single client but it refers
# to not-handshaking in a distributed way. It means to get data without using
# a dht transmission logic.
# switch to enable verification of search results
# must be set to true in untrusted networks and can be
# set to false in completely trusted networks
network.unit.inspection.searchverify = false
# speed of remote crawl de-queueing. this is the number of milliseconds
# as a pause between two requests
network.unit.remotecrawl.speed = 300
# addresses of seed-list bootstrap locations
network.unit.bootstrap.seedlist0 = http://search.yacy.net:7050/share/seed.txt
# each network may use different yacy distributions.
# the auto-updater can access network-specific update locations
network.unit.update.location0 = http://yacy.net/en/index.html
network.unit.update.location0.key = MIIBtzCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BYHPUCgYEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYQAAoGAbGeo21lW3Ost86RxSrCLIHaYaaj/68jFrTMjAORGJqUTgnvYCd4T1HmD/pCYrW8sQtN4KFPbm8M/MbDWeojQpy+qVqewBilYIdNpArGknvFkw4jpDPu7aR6FRz56zcZTnBiOpqAbBXDB3o6D1w9zVDPd4LBSTLgedt0joZeVAVk=
network.unit.update.location1 = http://kaskelix.de/update/
network.unit.update.location1.key = MIIBtzCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BYHPUCgYEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYQAAoGAbGeo21lW3Ost86RxSrCLIHaYaaj/68jFrTMjAORGJqUTgnvYCd4T1HmD/pCYrW8sQtN4KFPbm8M/MbDWeojQpy+qVqewBilYIdNpArGknvFkw4jpDPu7aR6FRz56zcZTnBiOpqAbBXDB3o6D1w9zVDPd4LBSTLgedt0joZeVAVk=
network.unit.update.location2 = http://latest.yacy.de/
network.unit.update.location2.key = MIIBtzCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BYHPUCgYEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYQAAoGAbGeo21lW3Ost86RxSrCLIHaYaaj/68jFrTMjAORGJqUTgnvYCd4T1HmD/pCYrW8sQtN4KFPbm8M/MbDWeojQpy+qVqewBilYIdNpArGknvFkw4jpDPu7aR6FRz56zcZTnBiOpqAbBXDB3o6D1w9zVDPd4LBSTLgedt0joZeVAVk=
# properties for in-protocol response authentication:
network.unit.protocol.control = uncontrolled
# white/blacklists
network.unit.access.whitelist = 10\..*,127\..*,172\.(1[6-9]|2[0-9]|3[0-1])\..*,169\.254\..*,192\.168\..*,localhost
network.unit.access.blacklist =
# greedy learning: fast information acquisition heuristic for new peers
greedylearning.enabled = false
greedylearning.limit.doccount = 1000

@ -2,4 +2,5 @@ defaults/yacy.network.freeworld.unit
defaults/yacy.network.webportal.unit
defaults/yacy.network.intranet.unit
defaults/yacy.network.allip.unit
defaults/yacy.network.metager.unit
defaults/yacy.network.metager.unit
defaults/yacy.network.zeronet.unit

@ -0,0 +1,46 @@
# Build a docker image from latest YaCy sources
# Base image : latest stable Debian
FROM debian:latest
# Install needed packages
RUN apt-get update && apt-get install -yq \
default-jdk \
default-jre-headless \
ant \
git
# set current working dir
WORKDIR /opt
# clone main YaCy git repository (we need to clone git repository to generate correct version when building from source)
RUN git clone https://github.com/yacy/yacy_search_server.git
# trace content of source directory
RUN ls -la /opt/yacy_search_server
# set current working dir
WORKDIR /opt/yacy_search_server
# Compile with ant
RUN ant compile
# Set initial admin password : "docker" (encoded with custom yacy md5 function net.yacy.cora.order.Digest.encodeMD5Hex())
RUN sed -i "/adminAccountBase64MD5=/c\adminAccountBase64MD5=MD5:e672161ffdce91be4678605f4f4e6786" /opt/yacy_search_server/defaults/yacy.init
# make some cleaning to reduce image size
RUN rm -rf .git \
&& apt-get purge -yq --auto-remove \
default-jdk \
ant \
git \
&& apt-get clean
# Expose port 8090
EXPOSE 8090
# Set data volume : can be used to persist yacy data and configuration
VOLUME ["/opt/yacy_search_server/DATA"]
# Start yacy ind debug mode (-d) to display console logs and to wait for yacy process
CMD sh /opt/yacy_search_server/startYACY.sh -d

@ -0,0 +1,67 @@
# Yacy Docker image from latest sources
[![Deploy to Docker Cloud](https://files.cloud.docker.com/images/deploy-to-dockercloud.svg)](https://cloud.docker.com/stack/deploy/?repo=https://github.com/luccioman/yacy_search_server/tree/docker/docker)
## Getting built image from Docker Hub
docker pull luccioman/yacy
Repository URL : (https://hub.docker.com/r/luccioman/yacy/)
## Building image yourself
Using yacy_search_server/docker/Dockerfile :
cd yacy_search_server/docker
docker build .
## Default admin account
login : admin
password : docker
You should modify this default password with page /ConfigAccounts_p.html when exposing publicly your YaCy container.
## Usage
### First start
#### Most basic
docker run luccioman/yacy
YaCy web interface is then exposed at http://[container_ip]:8090.
You can retrieve the container IP address with `docker inspect`.
#### Easier to handle
docker run --name yacy -p 8090:8090 luccioman/yacy
--name option allow easier management of your container (without it, docker automatically generate a new name at each startup).
-p option map host port and container port, allowing web interface access through the usual http://localhost:8090.
#### With persistent data volume
docker run -v [your_host/data/directory]:/opt/yacy_search_server/DATA luccioman/yacy
This allow your container to reuse a data directory form the host.
#### As background process
docker run -d luccioman/yacy
### Next starts
#### As attached process
docker start -a yacy
#### As background process
docker start yacy
### Shutdown
* Use "Shutdown" button in administration web interface

@ -0,0 +1,6 @@
yacy:
image: 'luccioman/yacy:latest'
ports:
- '8090:8090'
restart: on-failure
autoredeploy: true

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.yacy</groupId>
<artifactId>SimpleSearchClient</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<description>Simple search client example to query YaCy and receive search results as RSS feed</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<build>
<sourceDirectory>src</sourceDirectory>
</build>
</project>

@ -23,18 +23,17 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
package net.yacy;
package net.yacy.simplesearchclient;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.regex.Pattern;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import net.yacy.cora.util.CommonPattern;
import org.w3c.dom.CharacterData;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@ -55,6 +54,7 @@ public class YaCySearchClient {
private final String host, query;
private final int port;
private int offset;
private final static Pattern SPACE = Pattern.compile(" ");
public YaCySearchClient(final String host, final int port, final String query) {
this.host = host;
@ -80,7 +80,7 @@ public class YaCySearchClient {
.append("/yacysearch.rss?verify=false&startRecord=")
.append(YaCySearchClient.this.offset)
.append("&maximumRecords=10&resource=local&query=")
.append(CommonPattern.SPACE.matcher(YaCySearchClient.this.query).replaceAll("+")).toString();
.append(SPACE.matcher(YaCySearchClient.this.query).replaceAll("+")).toString();
try { url = new URL(u); } catch (final MalformedURLException e) { throw new IOException (e); }
try { doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(url.openStream()); }
catch (final ParserConfigurationException e) { throw new IOException (e); }
@ -131,14 +131,22 @@ public class YaCySearchClient {
* Use this method as stub for an integration in your own programs
*/
public static void main(String[] args) {
for (String query: args) try {
long t = System.currentTimeMillis();
YaCySearchClient search = new YaCySearchClient("localhost", 8090, query);
System.out.println("Search result for '" + query + "':");
System.out.print(search.next().toString()); // get 10 results; you may repeat this for next 10
System.out.println("Search Time: " + (System.currentTimeMillis() - t) + " milliseconds\n");
} catch (final IOException e) {
e.printStackTrace();
if (args.length < 1) {
System.out.println("No query string as argument found.");
System.out.println("Call the main method with one argument, the query string,");
System.out.println("while YaCy is running on localhost.");
} else {
for (String query : args) {
try {
long t = System.currentTimeMillis();
YaCySearchClient search = new YaCySearchClient("localhost", 8090, query);
System.out.println("Search result for '" + query + "':");
System.out.print(search.next().toString()); // get 10 results; you may repeat this for next 10
System.out.println("Search Time: " + (System.currentTimeMillis() - t) + " milliseconds\n");
} catch (final IOException e) {
e.printStackTrace();
}
}
}
}
}

@ -163,7 +163,7 @@
</fieldset>
<fieldset class="listSettings">
<legend>Settings for this list</legend>
<legend>Settings for this list <b><em>#[currentBlacklist]#</em></b></legend>
<form action="Blacklist_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<div>
<input type="hidden" name="selectedListName" value="#[currentBlacklist]#" />

@ -33,13 +33,14 @@
<li>
<img src="env/grafics/ok.png" height="16" width="16" alt="ok" />&nbsp;Select a language for the interface:<br />
<fieldset>
<input type="radio" name="language" value="default" id="lang_en" onchange="this.form.submit()" #(lang_en)#::checked="checked"#(/lang_en)# /><label for="lang_en">English</label>
<input type="radio" name="language" value="de" id="lang_de" onchange="this.form.submit()" #(lang_de)#::checked="checked"#(/lang_de)# /><label for="lang_de">Deutsch</label>&nbsp;
<input type="radio" name="language" value="fr" id="lang_fr" onchange="this.form.submit()" #(lang_fr)#::checked="checked"#(/lang_fr)# /><label for="lang_fr">Fran&ccedil;ais</label>&nbsp;
<input type="radio" name="language" value="cn" id="lang_cn" onchange="this.form.submit()" #(lang_cn)#::checked="checked"#(/lang_cn)# /><label for="lang_cn">&#27721;&#35821;/&#28450;&#35486</label>
<input type="radio" name="language" value="ru" id="lang_ru" onchange="this.form.submit()" #(lang_ru)#::checked="checked"#(/lang_ru)# /><label for="lang_ru">&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081;</label>
<input type="radio" name="language" value="uk" id="lang_uk" onchange="this.form.submit()" #(lang_uk)#::checked="checked"#(/lang_uk)# /><label for="lang_uk">&#1059;&#1082;&#1088;&#1072;&#1111;&#1085;&#1089;&#1100;&#1082;&#1072;</label>
<input type="radio" name="language" value="hi" id="lang_hi" onchange="this.form.submit()" #(lang_hi)#::checked="checked"#(/lang_hi)# /><label for="lang_hi">&#2361;&#2367;&#2344;&#2381;&#2342;&#2368;</label>
<input type="radio" name="language" value="default" id="lang_en" onchange="this.form.submit()" #(lang_en)#::checked="checked"#(/lang_en)# /><label for="lang_en">English</label>
<input type="radio" name="language" value="ja" id="lang_ja" onchange="this.form.submit()" #(lang_ja)#::checked="checked"#(/lang_ja)# /><label for="lang_ja">&#26085;&#26412;&#35486;</label>
</fieldset>
</li>
<!-- take care that no other items are changed, but also change the former if no js is enabled -->

@ -36,7 +36,6 @@ import java.util.regex.Pattern;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.data.Translator;
import net.yacy.data.WorkTables;
import net.yacy.http.YaCyHttpServer;
import net.yacy.kelondro.workflow.InstantBusyThread;
@ -46,6 +45,7 @@ import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
import net.yacy.server.http.HTTPDFileHandler;
import net.yacy.utils.translation.TranslatorXliff;
import net.yacy.utils.upnp.UPnPMappingType;
import net.yacy.utils.upnp.UPnP;
@ -85,7 +85,7 @@ public class ConfigBasic {
// language settings
if (post != null && post.containsKey("language") && !lang.equals(post.get("language", "default")) &&
(Translator.changeLang(env, langPath, post.get("language", "default") + ".lng"))) {
(new TranslatorXliff().changeLang(env, langPath, post.get("language", "default") + ".lng"))) {
prop.put("changedLanguage", "1");
}
@ -275,6 +275,7 @@ public class ConfigBasic {
prop.put("lang_ru", "0");
prop.put("lang_uk", "0");
prop.put("lang_en", "0");
prop.put("lang_jp", "0");
if ("default".equals(lang)) {
prop.put("lang_en", "1");
} else {

@ -39,14 +39,15 @@
</form>
<form action="ConfigLanguage_p.html" accept-charset="UTF-8">
<fieldset>
<fieldset><legend>Download Language File</legend>
<p>Supported formats are the internal language file (extension .lng) or XLIFF (extension .xlf) format.</p>
<dl>
<dt><label for="url_install">Install new language from URL</label>:</dt>
<dd>
<input type="text" name="url" id="url_install" size="30" />
</dd>
<dt><label for="use_lang"> Use this language</label></dt>
<dt><label for="use_lang">Use this language</label></dt>
<dd>
<input type="checkbox" name="use_lang" id="use_lang" value="on" checked="checked" />
</dd>
@ -56,6 +57,7 @@
<p>Make sure that you only download data from trustworthy sources. The new language file
might overwrite existing data if a file of the same name exists already.</p>
</fieldset>
<p><a href="Translator_p.html">Simple Editor</a> to add untranslated text</p>
</form>
#(status)#
::<p><strong>Unable to get URL: #[url]#</strong></p>

@ -29,11 +29,12 @@
//javac -classpath .:../Classes Blacklist_p.java
//if the shell's current path is HTROOT
import java.io.BufferedWriter;
import com.google.common.io.Files;
import java.io.File;
import java.io.FileWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@ -48,6 +49,7 @@ import net.yacy.kelondro.util.FileUtils;
import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
import net.yacy.utils.translation.TranslatorXliff;
public class ConfigLanguage_p {
@ -80,7 +82,7 @@ public class ConfigLanguage_p {
* directory traversal attacks!
*/
if (langFiles.contains(selectedLanguage) || selectedLanguage.startsWith("default")) {
Translator.changeLang(env, langPath, selectedLanguage);
new TranslatorXliff().changeLang(env, langPath, selectedLanguage);
}
//delete language file
@ -93,6 +95,7 @@ public class ConfigLanguage_p {
if (langFiles.contains(selectedLanguage)) {
final File langfile= new File(langPath, selectedLanguage);
FileUtils.deletedelete(langfile);
new TranslatorXliff().getScratchFile(langfile).delete();
}
//load language file from URL
@ -102,25 +105,33 @@ public class ConfigLanguage_p {
try {
final DigestURL u = new DigestURL(url);
it = FileUtils.strings(u.get(ClientIdentification.yacyInternetCrawlerAgent, null, null));
try {
TranslatorXliff tx = new TranslatorXliff();
File langFile = tx.getScratchFile(new File(langPath, u.getFileName()));
final OutputStreamWriter bw = new OutputStreamWriter(new FileOutputStream(langFile), StandardCharsets.UTF_8.name());
while (it.hasNext()) {
bw.write(it.next() + "\n");
}
bw.close();
// convert downloaded xliff to internal lng file
final String ext = Files.getFileExtension(langFile.getName());
if (ext.equalsIgnoreCase("xlf") || ext.equalsIgnoreCase("xliff")) {
Map<String,Map<String,String>> lng = tx.loadTranslationsListsFromXliff(langFile);
langFile = new File(langPath, Files.getNameWithoutExtension(langFile.getName())+".lng");
tx.saveAsLngFile(null, langFile, lng);
}
if (post.containsKey("use_lang") && "on".equals(post.get("use_lang"))) {
tx.changeLang(env, langPath, langFile.getName());
}
} catch (final IOException e) {
prop.put("status", "2");//error saving the language file
}
} catch(final IOException e) {
prop.put("status", "1");//unable to get url
prop.put("status_url", url);
return prop;
}
try {
final File langFile = new File(langPath, url.substring(url.lastIndexOf('/'), url.length()));
final BufferedWriter bw = new BufferedWriter(new PrintWriter(new FileWriter(langFile)));
while (it.hasNext()) {
bw.write(it.next() + "\n");
}
bw.close();
} catch(final IOException e) {
prop.put("status", "2");//error saving the language file
return prop;
}
if (post.containsKey("use_lang") && "on".equals(post.get("use_lang"))) {
Translator.changeLang(env, langPath, url.substring(url.lastIndexOf('/'), url.length()));
}
}
}

@ -10,7 +10,7 @@
<h2>Exclude Web-Spiders</h2>
<p>
Here you can set up a robots.txt for all webcrawlers that try to access the webinterface of your peer.
<span class="tt">robots.txt</span> is a volunteer agreement most search-engines (including YaCy) follow.
<span class="tt">robots.txt</span> is a voluntary agreement most search-engines (including YaCy) follow.
It disallows crawlers to access webpages or even entire domains.
</p>
#(error)#
@ -50,4 +50,4 @@
</form>
#%env/templates/footer.template%#
</body>
</html>
</html>

@ -43,8 +43,9 @@ public class ConfigRobotsTxt_p {
final Switchboard sb = (Switchboard) env;
final servletProperties prop = new servletProperties();
final RobotsTxtConfig rbc = ((Switchboard)env).robotstxtConfig;
prop.put("clientname", sb.peers.mySeed().getPublicAddress(sb.peers.mySeed().getIP()));
final RobotsTxtConfig rbc = sb.robotstxtConfig;
// globaly overwitten by template engine (removed to avoid risk of NPE in intranet mode)
// prop.put("clientname", sb.peers.mySeed().getPublicAddress(sb.peers.mySeed().getIP()));
if (post != null) {
if (post.containsKey("save")) {

@ -34,7 +34,7 @@ public class ConfigSearchBox {
final serverObjects prop = new serverObjects();
final Switchboard sb = (Switchboard) env;
String myaddress = sb.peers.mySeed().getPublicAddress(sb.peers.mySeed().getIP());
String myaddress = sb.peers.mySeed().getIP() == null ? null : sb.peers.mySeed().getPublicAddress(sb.peers.mySeed().getIP());
if (myaddress == null) myaddress = "localhost:" + sb.getLocalPort();
prop.put("myaddress", myaddress);
return prop;

@ -61,8 +61,8 @@ public class CrawlMonitorRemoteStart {
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_dark", dark ? "1" : "0");
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_cre", record.created().toString());
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_peername", peername);
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_startURL", record.attributes().get("startURL").toString());
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_intention", record.attributes().get("intention").toString());
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_startURL", record.attributes().get("startURL"));
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_intention", record.attributes().get("intention"));
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_generalDepth", record.attributes().get("generalDepth"));
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_crawlingQ", ("true".equals(record.attributes().get("crawlingQ"))) ? "1" : "0");
showedCrawl++;
@ -88,8 +88,8 @@ public class CrawlMonitorRemoteStart {
prop.put("otherCrawlStartFinished_" + showedCrawl + "_dark", dark ? "1" : "0");
prop.put("otherCrawlStartFinished_" + showedCrawl + "_cre", record.created().toString());
prop.putHTML("otherCrawlStartFinished_" + showedCrawl + "_peername", peername);
prop.putHTML("otherCrawlStartFinished_" + showedCrawl + "_startURL", record.attributes().get("startURL").toString());
prop.put("otherCrawlStartFinished_" + showedCrawl + "_intention", record.attributes().get("intention").toString());
prop.putHTML("otherCrawlStartFinished_" + showedCrawl + "_startURL", record.attributes().get("startURL"));
prop.put("otherCrawlStartFinished_" + showedCrawl + "_intention", record.attributes().get("intention"));
prop.put("otherCrawlStartFinished_" + showedCrawl + "_generalDepth", record.attributes().get("generalDepth"));
prop.put("otherCrawlStartFinished_" + showedCrawl + "_crawlingQ", ("true".equals(record.attributes().get("crawlingQ"))) ? "1" : "0");
showedCrawl++;

@ -594,6 +594,9 @@ public class Crawler_p {
m.remove("generalFilter");
m.remove("specificFilter");
m.put("intention", post.get("intention", "").replace(',', '/'));
if (successurls.size() > 0) { // just include at least one of the startURL's in case of multiple for the news service
m.put("startURL", successurls.iterator().next().toNormalform(true));
}
sb.peers.newsPool.publishMyNews(sb.peers.mySeed(), NewsPool.CATEGORY_CRAWL_START, m);
}
} else {

@ -18,8 +18,8 @@
<form action="IndexExport_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<fieldset><legend>Loaded URL Export</legend>
<dl>
<dt class="TableCellDark">Export File</dt>
<dd><input type="text" name="exportfile" value="#[exportfile]#" size="80" maxlength="250" />
<dt class="TableCellDark">Export Path</dt>
<dd><input type="text" name="exportfilepath" value="#[exportfilepath]#" size="120" maxlength="250" />
</dd>
<dt class="TableCellDark">URL Filter</dt>
<dd><input type="text" name="exportfilter" value=".*.*" size="20" maxlength="250" />
@ -27,6 +27,9 @@
<dt class="TableCellDark">query</dt>
<dd><input type="text" name="exportquery" value="*:*" size="20" maxlength="250" />
</dd>
<dt class="TableCellDark">maximum age (seconds, -1 = unlimited)</dt>
<dd><input type="text" name="exportmaxseconds" value="-1" size="20" maxlength="250" />
</dd>
<dt class="TableCellDark">Export Format</dt>
<dd>
<dl>

@ -22,10 +22,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import java.io.File;
import java.io.IOException;
import java.util.List;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.data.WorkTables;
import net.yacy.search.Switchboard;
import net.yacy.search.index.Fulltext;
import net.yacy.search.index.Segment;
@ -53,9 +54,10 @@ public class IndexExport_p {
List<File> dumpFiles = segment.fulltext().dumpFiles();
prop.put("dumprestore_dumpfile", dumpFiles.size() == 0 ? "" : dumpFiles.get(dumpFiles.size() - 1).getAbsolutePath());
prop.put("dumprestore_optimizemax", 10);
prop.putNum("ucount", ucount);
// show export messages
final Fulltext.Export export = segment.fulltext().export();
Fulltext.Export export = segment.fulltext().export();
if ((export != null) && (export.isAlive())) {
// there is currently a running export
prop.put("lurlexport", 2);
@ -66,7 +68,7 @@ public class IndexExport_p {
prop.put("reload", 1);
} else {
prop.put("lurlexport", 1);
prop.put("lurlexport_exportfile", sb.getDataPath() + "/DATA/EXPORT/" + GenericFormatter.SHORT_SECOND_FORMATTER.format());
prop.put("lurlexport_exportfilepath", sb.getDataPath() + "/DATA/EXPORT/");
if (export == null) {
// there has never been an export
prop.put("lurlexportfinished", 0);
@ -87,7 +89,6 @@ public class IndexExport_p {
}
if (post == null || env == null) {
prop.putNum("ucount", ucount);
return prop; // nothing to do
}
@ -102,23 +103,28 @@ public class IndexExport_p {
if (fname.endsWith("rss")) format = Fulltext.ExportFormat.rss;
if (fname.endsWith("solr")) format = Fulltext.ExportFormat.solr;
// extend export file name
String s = post.get("exportfile", "");
if (s.indexOf('.',0) < 0) {
if (format == Fulltext.ExportFormat.text) s = s + ".txt";
if (format == Fulltext.ExportFormat.html) s = s + ".html";
if (format == Fulltext.ExportFormat.rss ) s = s + "_rss.xml";
if (format == Fulltext.ExportFormat.solr) s = s + "_full.xml";
}
final File f = new File(s);
f.getParentFile().mkdirs();
final String filter = post.get("exportfilter", ".*");
final String query = post.get("exportquery", "*:*");
final Fulltext.Export running = segment.fulltext().export(f, filter, query, format, dom, text);
final int maxseconds = post.getInt("exportmaxseconds", -1);
final String path = post.get("exportfilepath", "");
prop.put("lurlexport_exportfile", s);
prop.put("lurlexport_urlcount", running.count());
if ((running != null) && (running.failed() == null)) {
// store this call as api call: we do this even if there is a chance that it fails because recurring calls may do not fail
if (maxseconds != -1) sb.tables.recordAPICall(post, "IndexExport_p.html", WorkTables.TABLE_API_TYPE_DUMP, format + "-dump, q=" + query + ", maxseconds=" + maxseconds);
// start the export
try {
export = sb.index.fulltext().export(format, filter, query, maxseconds, new File(path), dom, text);
} catch (IOException e) {
prop.put("lurlexporterror", 1);
prop.put("lurlexporterror_exportfile", "-no export-");
prop.put("lurlexporterror_exportfailmsg", e.getMessage());
return prop;
}
// show result
prop.put("lurlexport_exportfile", export.file().toString());
prop.put("lurlexport_urlcount", export.count());
if ((export != null) && (export.failed() == null)) {
prop.put("lurlexport", 2);
}
prop.put("reload", 1);
@ -144,4 +150,4 @@ public class IndexExport_p {
return prop;
}
}
}

@ -41,16 +41,12 @@ public class Load_MediawikiWiki {
// define visible variables
String a;
Set<String> ips = sb.peers.mySeed().getIPs();
/* There may eventually have no registered ip in mySeed, for example in Robinson mode : this shouldn't prevent crawling a MediaWiki */
if(ips != null && !ips.isEmpty()) {
a = sb.peers.mySeed().getPublicAddress(ips.iterator().next());
if (sb.peers.myIPs().isEmpty()) {
a = "localhost:" + sb.getLocalPort();
} else {
a = "localhost:" + sb.getLocalPort();
a = sb.peers.mySeed().getPublicAddress(sb.peers.mySeed().getIP());
}
final boolean intranet = sb.getConfig(SwitchboardConstants.NETWORK_NAME, "").equals("intranet");
final String repository = "http://" + a + "/repository/";
prop.put("starturl", (intranet) ? repository : "http://");
prop.put("starturl", "http://");
prop.put("address", a);
// return rewrite properties

@ -40,14 +40,8 @@ public class Load_PHPBB3 {
final serverObjects prop = new serverObjects();
// define visible variables
String a;
Set<String> ips = sb.peers.mySeed().getIPs();
/* There may eventually have no registered ip in mySeed, for example in Robinson mode : this shouldn't prevent crawling a MediaWiki */
if(ips != null && !ips.isEmpty()) {
a = sb.peers.mySeed().getPublicAddress(ips.iterator().next());
} else {
a = "localhost:" + sb.getLocalPort();
}
String a = sb.peers.mySeed().getIP() == null ? null : sb.peers.mySeed().getPublicAddress(sb.peers.mySeed().getIP());
if (a == null) a = "localhost:" + sb.getLocalPort();
final boolean intranet = sb.getConfig(SwitchboardConstants.NETWORK_NAME, "").equals("intranet");
final String repository = "http://" + a + "/repository/";
prop.put("starturl", (intranet) ? repository : "http://");

@ -7,48 +7,48 @@
<body id="MessageSend">
#%env/templates/header.template%#
#(mode)#
<!-- =========================== write message =========================== -->
<!-- (mode=0) =========================== write message =========================== -->
<h2>Send message</h2>
#(permission)#
<!-- we have no permission to send the message -->
<p>You cannot send a message to <strong>#[peerName]#</strong>.<br />
The peer does not respond. It was now removed from the peer-list.
</p>
::
<!-- we have the permission to send the message -->
<p>The peer <b>#[peerName]#</b> is alive and responded:</p>
<p><tt class="MessageBackground">#[response]#
You are allowed to send me a message &le; #[messagesize]# kb and an
attachment &le; #[attachmentsize]#.</tt>
</p>
#(permission)#
<!-- we have no permission to send the message -->
<p>You cannot send a message to <strong>#[peerName]#</strong>.<br />
The peer does not respond. It was now removed from the peer-list.
</p>
::
<!-- we have the permission to send the message -->
<p>The peer <b>#[peerName]#</b> is alive and responded:</p>
<p><tt class="MessageBackground">#[response]#
You are allowed to send me a message &le; #[messagesize]# kb and an
attachment &le; #[attachmentsize]#.</tt>
</p>
<form action="MessageSend_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<form action="MessageSend_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<fieldset>
<legend>Your Message</legend>
<dl>
<dt>
<label for="subject">Subject:</label>
</dt>
<dd>
<input name="subject" id="subject" type="text" size="80" maxlength="80" value="#[subject]#" />
</dd>
<dt>
<label for="message">Text:</label>
</dt>
<dd>
<textarea name="message" id="message" cols="80" rows="8">#[message]#</textarea>
<p class="help">
You can use <a href="WikiHelp.html" onclick="window.open('WikiHelp.html','WikiHelp','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=640,height=480');return false;">Wiki Code</a> here.
</p>
</dd>
</dl>
<legend>Your Message</legend>
<dl>
<dt>
<label for="subject">Subject:</label>
</dt>
<dd>
<input name="subject" id="subject" type="text" size="80" maxlength="80" value="#[subject]#" />
</dd>
<dt>
<label for="message">Text:</label>
</dt>
<dd>
<textarea name="message" id="message" cols="80" rows="8">#[message]#</textarea>
<p class="help">
You can use <a href="WikiHelp.html" onclick="window.open('WikiHelp.html','WikiHelp','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=640,height=480');return false;">Wiki Code</a> here.
</p>
</dd>
</dl>
<input type="hidden" name="hash" value="#[hash]#" />
<input type="hidden" name="messagesize" value="#[messagesize]#" />
<input type="hidden" name="attachmentsize" value="#[attachmentsize]#" />
<input name="new" type="submit" value="Enter" />
<input type="submit" name="preview" value="Preview" />
</fieldset>
</form>
</form>
::
<!-- peer cannot respond -->
<p>
@ -57,19 +57,19 @@
</p>
#(/permission)#
::
<!-- =========================== preview message =========================== -->
<!-- (mode=1) =========================== preview message =========================== -->
<h2>Preview message</h2>
#(permission)#
<!-- we have no permission to send the message -->
<p>You cannot send a message to <strong>#[peerName]#</strong>.<br />
The peer does not respond. It was now removed from the peer-list.
The peer does not respond. It was now removed from the peer-list.
</p>
::
<!-- we have the permission to send the message -->
<p>The peer <b>#[peerName]#</b> is alive and responded:</p>
<p><tt class="MessageBackground">#[response]#
You are allowed to send me a message &le; #[messagesize]# kb and an
attachment &le; #[attachmentsize]#.</tt>
You are allowed to send me a message &le; #[messagesize]# kb and an
attachment &le; #[attachmentsize]#.</tt>
</p>
<p>The message has not been sent yet!</p>
@ -91,24 +91,24 @@
<form action="MessageSend_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<fieldset>
<legend>Your Message</legend>
<dl>
<dt>
<label for="subject">Subject:</label>
</dt>
<dd>
<input name="subject" id="subject" type="text" size="80" maxlength="80" value="#[subject]#" />
</dd>
<dt>
<label for="message">Text:</label>
</dt>
<dd>
<textarea name="message" id="message" cols="80" rows="8">#[message]#</textarea>
<p class="help">
You can use <a href="WikiHelp.html" onclick="window.open('WikiHelp.html','WikiHelp','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=640,height=480');return false;">Wiki Code</a> here.
</p>
</dd>
</dl>
<legend>Your Message</legend>
<dl>
<dt>
<label for="subject">Subject:</label>
</dt>
<dd>
<input name="subject" id="subject" type="text" size="80" maxlength="80" value="#[subject]#" />
</dd>
<dt>
<label for="message">Text:</label>
</dt>
<dd>
<textarea name="message" id="message" cols="80" rows="8">#[message]#</textarea>
<p class="help">
You can use <a href="WikiHelp.html" onclick="window.open('WikiHelp.html','WikiHelp','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=640,height=480');return false;">Wiki Code</a> here.
</p>
</dd>
</dl>
<input type="hidden" name="hash" value="#[hash]#" />
<input type="hidden" name="messagesize" value="#[messagesize]#" />
<input type="hidden" name="attachmentsize" value="#[attachmentsize]#" />
@ -124,16 +124,16 @@
</p>
#(/permission)#
::
<!-- =========================== send message =========================== -->
<!-- (mode=2) =========================== send message =========================== -->
<h2>Send message</h2>
#(status)#
<!-- Message send successfully -->
<p>Your message has been sent. The target peer responded:</p>
<p class="Message"><tt>#[response]#</tt></p>
:: <!-- Message could not be send -->
<p>The target peer is alive but did not receive your message. Sorry.</p>
<p>
Here is a copy of your message, so you can copy it to save it for further attempts:
@ -142,12 +142,12 @@
<tt>#[message]#</tt>
</p>
#(/status)#
::
<!-- illegal usage of this page -->
<p>You cannot call this page directly. Instead, use a link on the <a href="Network.html">Network</a> page.</p>
<!-- (mode=3) ==== illegal usage of this page ==== -->
<p>You cannot call this page directly. Instead, use a link on the <a href="Network.html?page=1&maxCount=1000">Network</a> page.</p>
#(/mode)#
#%env/templates/footer.template%#
</body>
</html>

@ -60,7 +60,7 @@ public class MessageSend_p {
final serverObjects prop = new serverObjects();
if ((post == null) || (post.get("hash","").isEmpty())) {
prop.put("mode", "2");
prop.put("mode", "3");
return prop;
}
@ -78,52 +78,58 @@ public class MessageSend_p {
// open an editor page for the message
// first ask if the other peer is online, and also what kind of document it accepts
Seed seed = sb.peers.getConnected(ASCII.getBytes(hash));
for(String ip: seed.getIPs()) {
final Map<String, String> result = Protocol.permissionMessage(seed.getPublicAddress(ip), hash);
//System.out.println("DEBUG: permission request result = " + result.toString());
String peerName;
Seed targetPeer = null;
if (hash.equals(sb.peers.mySeed().hash)) {
peerName = sb.peers.mySeed().get(Seed.NAME,"nameless");
} else {
targetPeer = sb.peers.getConnected(hash);
if (targetPeer == null)
peerName = "nameless";
else
peerName = targetPeer.get(Seed.NAME,"nameless");
}
prop.putXML("mode_permission_peerName", peerName);
final String response = (result == null) ? null : result.get("response");
if (response == null || result == null) {
// we don't have permission or other peer does not exist
prop.put("mode_permission", "0");
if (targetPeer != null) {
sb.peers.peerActions.interfaceDeparture(targetPeer, ip);
if (seed != null) {
for (String ip : seed.getIPs()) {
final Map<String, String> result = Protocol.permissionMessage(seed.getPublicAddress(ip), hash);
//System.out.println("DEBUG: permission request result = " + result.toString());
String peerName;
Seed targetPeer = null;
if (hash.equals(sb.peers.mySeed().hash)) {
peerName = sb.peers.mySeed().get(Seed.NAME, "nameless");
} else {
targetPeer = sb.peers.getConnected(hash);
if (targetPeer == null) {
peerName = "nameless";
} else {
peerName = targetPeer.get(Seed.NAME, "nameless");
}
}
} else {
prop.put("mode_permission", "1");
// write input form
try {
final int messagesize = Integer.parseInt(result.get("messagesize"));
final int attachmentsize = Integer.parseInt(result.get("attachmentsize"));
prop.putXML("mode_permission_response", response);
prop.put("mode_permission_messagesize", messagesize);
prop.put("mode_permission_attachmentsize", attachmentsize);
prop.putXML("mode_permission_subject", subject);
prop.putXML("mode_permission_message", message);
prop.putHTML("mode_permission_hash", hash);
if (post.containsKey("preview")) {
prop.putWiki(sb.peers.mySeed().getPublicAddress(ip), "mode_permission_previewmessage", message);
prop.putXML("mode_permission_peerName", peerName);
final String response = (result == null) ? null : result.get("response");
if (response == null || result == null) {
// we don't have permission or other peer does not exist
prop.put("mode_permission", "0");
if (targetPeer != null) {
sb.peers.peerActions.interfaceDeparture(targetPeer, ip);
}
} else {
prop.put("mode_permission", "1");
// write input form
try {
final int messagesize = Integer.parseInt(result.get("messagesize"));
final int attachmentsize = Integer.parseInt(result.get("attachmentsize"));
prop.putXML("mode_permission_response", response);
prop.put("mode_permission_messagesize", messagesize);
prop.put("mode_permission_attachmentsize", attachmentsize);
prop.putXML("mode_permission_subject", subject);
prop.putXML("mode_permission_message", message);
prop.putHTML("mode_permission_hash", hash);
if (post.containsKey("preview")) {
prop.putWiki(sb.peers.mySeed().getPublicAddress(ip), "mode_permission_previewmessage", message);
}
} catch (final NumberFormatException e) {
// "unresolved pattern", the remote peer is alive but had an exception
prop.put("mode_permission", "2");
}
} catch (final NumberFormatException e) {
// "unresolved pattern", the remote peer is alive but had an exception
prop.put("mode_permission", "2");
}
}
} else { // seed == null
prop.put("mode_permission", "0");
prop.putXML("mode_permission_peerName", "a passive peer");
}
} else {
prop.put("mode", "2");
@ -140,7 +146,7 @@ public class MessageSend_p {
SeedDB seedDB = sb.peers;
// prepare request
final String salt = crypt.randomSalt();
// send request
final Map<String, ContentBody> parts = Protocol.basicRequestParts(Switchboard.getSwitchboard(), hash, salt);
parts.put("process", UTF8.StringBody("post"));

@ -127,6 +127,7 @@ document.getElementById("apilink").setAttribute("href", "Network.xml?" + window.
<td><strong>Received DHT<br/>Word Chunks</strong></td>
<td><strong>Received<br/>URLs</strong></td>
<td><strong>Location</strong><br/></td>
<td><strong>JRE</strong><br/></td>
#(c)#::<td><strong>user agent<br/></strong></td>#(/c)#
<td>send&nbsp;<strong>M</strong>essage/<br/>show&nbsp;<strong>P</strong>rofile/<br/>edit&nbsp;<strong>W</strong>iki/<br/>browse&nbsp;<strong>B</strong>log</td>
</tr>
@ -153,6 +154,7 @@ document.getElementById("apilink").setAttribute("href", "Network.xml?" + window.
<td align="right">#[rI]#</td>
<td align="right">#[rU]#</td>
<td align="right">#[location]#</td>
<td align="right">#[jre]#</td>
#(c)#::<td align="right">#[userAgent]#</td>#(/c)#
<td><nobr>
<a href="MessageSend_p.html?hash=#[hash]#" title="Send message to peer #[fullname]#">m</a>&nbsp;

@ -503,6 +503,7 @@ public class Network {
prop.putNum(STR_TABLE_LIST + conCount + "_rU", seed.getLong(Seed.URL_IN, 0));
prop.putNum(STR_TABLE_LIST + conCount + "_ppm", PPM);
prop.putNum(STR_TABLE_LIST + conCount + "_qph", Math.round(6000d * QPM) / 100d);
prop.putHTML(STR_TABLE_LIST + conCount + "_jre", seed.get(Seed.JRE, ""));
conCount++;
} // seed != null
} // while

@ -50,7 +50,7 @@
<dl>
<dt style="width:260px;margin:0;padding:0;height:1.8em;"><label for="bq" id="bq_label">bq=</label></dt>
<dd style="width:360px;margin:0;padding:0;float:left;display:inline;" id="bq_dd">
<textarea name="bq" id="bq" align="left" cols="96" rows="1"/>#[bq]#</textarea>
<textarea name="bq" id="bq" align="left" cols="96" rows="5"/>#[bq]#</textarea>
</dd>
<dt style="width:260px;margin:0;padding:0;height:1.8em;"></dt>
<dd style="width:360px;margin:0;padding:0;height:1.8em;float:left;display:inline;">

@ -97,7 +97,7 @@ public class RankingSolr_p {
}
}
if (post != null && post.containsKey("ResetBQ")) {
String bq = "crawldepth_i:0^0.8 crawldepth_i:1^0.4";
String bq = "crawldepth_i:0^0.8\ncrawldepth_i:1^0.4";
if (bq != null) {
sb.setConfig(SwitchboardConstants.SEARCH_RANKING_SOLR_COLLECTION_BOOSTQUERY_ + profileNr, bq);
sb.index.fulltext().getDefaultConfiguration().getRanking(profileNr).setBoostQuery(bq);

@ -190,7 +190,13 @@
<p>the change will take effect after restart.</p>
<p>Note: the SSL option must be switched on, see <a href="ConfigBasic.html">Basic Configuration</a></p>
#(/info)#
<p></p>
#(needsRestart)#
<p>You can now go back to the <a href="#[referer]#">Settings</a> page if you want to make more changes.</p>
::
<p class="warning">Your need to restart YaCy to activate the changes.</p>
<p>or go back to the <a href="#[referer]#">Settings</a> page to make more changes.</p>
#(/needsRestart)#
#%env/templates/footer.template%#
</body>
</html>

@ -57,7 +57,8 @@ public class SettingsAck_p {
// get referer for backlink
final MultiProtocolURL referer = header.referer();
prop.put("referer", (referer == null) ? "Settings_p.html" : referer.toNormalform(true));
prop.put("needsRestart_referer", (referer == null) ? "Settings_p.html" : referer.toNormalform(true));
prop.put("needsRestart", false);
//if (post == null) System.out.println("POST: NULL"); else System.out.println("POST: " + post.toString());
if (post == null) {
@ -152,8 +153,9 @@ public class SettingsAck_p {
// set transparent proxy flag
boolean isTransparentProxy = post.containsKey("isTransparentProxy");
env.setConfig("isTransparentProxy", isTransparentProxy);
env.setConfig(SwitchboardConstants.PROXY_TRANSPARENT_PROXY, isTransparentProxy);
prop.put("info_isTransparentProxy", isTransparentProxy ? "on" : "off");
if (isTransparentProxy) prop.put("needsRestart", isTransparentProxy);
// set proxyAlwaysFresh flag
boolean proxyAlwaysFresh = post.containsKey("proxyAlwaysFresh");

@ -32,7 +32,7 @@
<td>Specifies if the proxy should send the X-Forwarded-For http header.</td>
</tr>
<tr valign="top">
<td colspan="3"><input type="submit" class="btn btn-primary btn-sm" name="httpNetworking" value="Submit" /> <em>Changes will take effect immediately.</em></td>
<td colspan="3"><input type="submit" class="btn btn-primary btn-sm" name="httpNetworking" value="Submit" /></td>
</tr>
</table>
</fieldset>

@ -31,6 +31,7 @@ import net.yacy.peers.Network;
import net.yacy.peers.Seed;
import net.yacy.peers.operation.yacySeedUploader;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@ -83,7 +84,7 @@ public final class Settings_p {
prop.putHTML("peerLang", peerLang);
// http networking settings
prop.put("isTransparentProxy", env.getConfigBool("isTransparentProxy", false) ? "1" : "0");
prop.put("isTransparentProxy", env.getConfigBool(SwitchboardConstants.PROXY_TRANSPARENT_PROXY, false) ? "1" : "0");
prop.put("proxyAlwaysFresh", env.getConfigBool("proxyAlwaysFresh", false) ? "1" : "0");
prop.put("proxy.sendViaHeader", env.getConfigBool("proxy.sendViaHeader", false) ? "1" : "0");
prop.put("proxy.sendXForwardedForHeader", env.getConfigBool("proxy.sendXForwardedForHeader", true) ? "1" : "0");

@ -170,6 +170,15 @@
</dd>
#(/hintCrawlMonitor)#
#(hintJREVersion)#::
<dt class="hintIcon"><img src="env/grafics/idea.png" width="32" height="32" alt="idea"/></dt>
<dd class="hint">
Your Java version is old. YaCy currently needs Java 1.7 but we want to migrate to Java 1.8 in the future.
Migration to 1.8 won't happen until end of 2016, but we want to join code with YaCy's sister project <a href="http://loklak.org">loklak.org</a>
and with a possible re-construction of YaCy in the <a href="http://kaskelix.de">kaskelix</a> architecture which will be using Java 1.8
</dd>
#(/hintJREVersion)#
#(hintSupport)#::
<dt class="hintIcon"><img src="env/grafics/idea.png" width="32" height="32" alt="idea"/></dt>
<dd class="hint">If you need professional support, please write to <tt>support@yacy.net</tt><br>For community support, please visit our <a href="http://forum.yacy.de" target="_blank">forum</a>.

@ -173,6 +173,10 @@ public class Status
prop.put("hintCrawlMonitor", "1");
}
if (!System.getProperty("java.version").startsWith("1.8")) {
prop.put("hintJREVersion", "1");
}
if (adminaccess && "intranet|webportal|allip".indexOf(env.getConfig(SwitchboardConstants.NETWORK_NAME, "unspecified")) >= 0) {
prop.put("hintSupport", "1");
}
@ -207,7 +211,7 @@ public class Status
} else {
prop.put("remoteProxy", "0"); // not used
}
prop.put("info_isTransparentProxy", sb.getConfigBool("isTransparentProxy", false) ? "0" : "1");
prop.put("info_isTransparentProxy", sb.getConfigBool(SwitchboardConstants.PROXY_TRANSPARENT_PROXY, false) ? "0" : "1");
prop.put("info_proxyURL", sb.getConfigBool("proxyURL", false) ? "0" : "1");
// peer information
@ -221,14 +225,6 @@ public class Status
final long uptime = 60000 * sb.peers.mySeed().getLong(Seed.UPTIME, 0L);
prop.put("peerStatistics", "1");
prop.put("peerStatistics_uptime", PeerActions.formatInterval(uptime));
prop.putNum("peerStatistics_pagesperminute", sb.peers.mySeed().getPPM());
prop.putNum(
"peerStatistics_queriesperhour",
Math.round(6000d * sb.peers.mySeed().getQPM()) / 100d);
prop.putNum("peerStatistics_links", sb.peers.mySeed().getLinkCount());
prop.put("peerStatistics_words", Formatter.number(sb.peers.mySeed().getWordCount()));
prop.putNum("peerStatistics_disconnects", sb.peers.peerActions.disconnects);
prop.put("peerStatistics_connects", Formatter.number(sb.peers.mySeed().get(Seed.CCOUNT, "0")));
thisHash = sb.peers.mySeed().hash;
if ( sb.peers.mySeed().getIPs().size() == 0 ) {
prop.put("peerAddress", "0"); // not assigned + instructions

@ -4,7 +4,7 @@
<dl>
<dt>System</dt>
<dd>YaCy version #[versionpp]#
<dd>YaCy version: #[versionpp]#
#(peerStatistics)#
Unknown
::

@ -0,0 +1,52 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title>YaCy '#[clientname]#': Translation Editor</title>
#%env/templates/metas.template%#
</head>
<body id="Translator">
#%env/templates/header.template%#
#%env/templates/submenuDesign.template%#
<h2>Translation Editor</h2>
<p>Translate untranslated text of the user interface (current language). The modified translation file is stored in DATA/LOCALE directory.</p>
<form id="Translation" method="post" action="Translator_p.html" enctype="multipart/form-data" accept-charset="UTF-8">
<fieldset>
<legend>
<label>UI Translation</label>
</legend>
<p>Target Language: <b>#[targetlang]#</b></p><p class="error">#[errmsg]#</p>
<label for="sourcefile">Source File</label>
<select name="sourcefile" onchange="submit();">
#{filelist}#
<option value="#[filename]#" #(selected)#::selected="selected"#(/selected)#>#[filename]#</option>
#{/filelist}#
</select> <a href="#[sourcefile]#" target="sourcefilewindow" >view it</a>
<label for="filteruntranslated">filter untranslated</label>
<input type="checkbox" name="filteruntranslated" id="filteruntranslated" value="true" onclick="submit();" #(filter.checked)#::checked="checked"#(/filter.checked)# />
<table>
<tr><th style="border-bottom: solid gray; border-bottom-width: 1px;">Source Text</th>
<th style="border-bottom: solid gray; border-bottom-width: 1px;">Translated Text ( #[targetlang]# )</th></tr>
#{textlist}#
<tr>
<td style="border-bottom: solid gray; border-bottom-width: 1px;" valign="top">
<!--<input type="text" name="sourcetxt" id="sourcetxt#[tokenid]#" size="80" disabled="true" value="#[sourcetxt]#"/>-->
<label for="targettxt#[tokenid]#" >#[sourcetxt]#</label>
</td>
<td style="border-bottom: solid gray; border-bottom-width: 1px;" valign="top" nowrap>
<input type="text" name="targettxt#[tokenid]#" id="targettxt#[tokenid]#" size="80" value="#[targettxt]#" #(filteruntranslated)#disabled::#(/filteruntranslated)#/>#(filteruntranslated)#<button name="editapproved" type="submit" value="#[tokenid]#" class="btn btn-sm"><span class="glyphicon glyphicon-pencil"/></button>::<button name="approve" type="submit" value="#[tokenid]#" class="btn btn-sm"><span class="glyphicon glyphicon-ok-sign" style="color: green"/></button>#(/filteruntranslated)#
</td>
</tr>
#{/textlist}#
</table>
<input type="submit" name="savetranslationlist" value="Save translation" class="btn btn-primary"/>
</fieldset>
</form>
#%env/templates/footer.template%#
</body>
</html>

@ -0,0 +1,160 @@
/**
* Translator_p
* Copyright 2012 by Michael Peter Christen, mc@yacy.net, Frankfurt am Main, Germany
* First released 14.09.2011 at http://yacy.net
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program in the file lgpl21.txt
* If not, see <http://www.gnu.org/licenses/>.
*/
import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
import net.yacy.server.servletProperties;
import net.yacy.utils.translation.CreateTranslationMasters;
public class Translator_p {
public static servletProperties respond(@SuppressWarnings("unused") final RequestHeader requestHeader, @SuppressWarnings("unused") final serverObjects post, @SuppressWarnings("unused") final serverSwitch env) {
try {
final servletProperties prop = new servletProperties();
final Switchboard sb = (Switchboard) env;
String langcfg = env.getConfig("locale.language", "default");
prop.put("targetlang", langcfg);
if ("default".equals(langcfg)) {
prop.put("errmsg", "activate a different language");
return prop;
} else {
prop.put("errmsg", "");
}
File lngfile = new File("locales", langcfg + ".lng");
CreateTranslationMasters ctm = new CreateTranslationMasters(/*new File ("locales","master.lng.xlf")*/);
File masterxlf = new File("locales", "master.lng.xlf");
if (!masterxlf.exists()) ctm.createMasterTranslationLists(masterxlf);
Map<String, Map<String, String>> origTrans = ctm.joinMasterTranslationLists(masterxlf, lngfile);
final File locallngfile = ctm.getScratchFile(lngfile);
Map<String, Map<String, String>> localTrans = ctm.loadTranslationsLists(locallngfile); // TODO: this will read file twice
int i = 0;
if (origTrans.size() > 0) {
String filename = origTrans.keySet().iterator().next();
if (post != null && post.containsKey("sourcefile")) {
filename = post.get("sourcefile", filename);
}
// prepare filename list for drop-down list
Iterator<String> filenameit = origTrans.keySet().iterator();
final boolean filteruntranslated = post == null ? false : post.getBoolean("filteruntranslated");
while (filenameit.hasNext()) {
String tmp = filenameit.next();
if (filteruntranslated) { // filter filenames with untranslated entries
Map<String, String> tmptrans = origTrans.get(tmp);
boolean hasuntrans = false;
for (String x : tmptrans.values()) {
if (x == null || x.isEmpty()) {
hasuntrans = true;
break;
}
}
if (!hasuntrans) continue;
}
prop.put("filelist_" + i + "_filename", tmp);
prop.put("filelist_" + i + "_selected", tmp.equals(filename));
i++;
}
prop.put("filelist", i);
prop.add("sourcefile", filename);
Map<String, String> origTextList = origTrans.get(filename);
i = 0;
boolean editapproved = false; // to switch already approved translation in edit mode
int textlistid = -1;
if (post != null) {
prop.put("filter.checked", filteruntranslated); // remember filter setting
textlistid = post.getInt("approve", -1);
if (post.containsKey("editapproved")) {
textlistid = post.getInt("editapproved", -1);
editapproved = true;
}
}
boolean changed = false;
for (String sourcetext : origTextList.keySet()) {
String targettxt = origTextList.get(sourcetext);
boolean existinlocalTrans = localTrans.containsKey(filename) && localTrans.get(filename).containsKey(sourcetext);
if (editapproved) existinlocalTrans |= (i == textlistid); // if edit of approved requested handle as/like existing in local to allow edit
if (targettxt == null || targettxt.isEmpty() || existinlocalTrans) {
prop.put("textlist_" + i + "_filteruntranslated", true);
} else if (filteruntranslated) {
continue;
}
// handle (modified) input text
if (i == textlistid && post != null) {
if (editapproved) { // switch already translated in edit mode by copying to local translation
// not saved here as not yet modified/approved
ctm.addTranslation(localTrans, filename, sourcetext, targettxt);
} else {
String t = post.get("targettxt" + Integer.toString(textlistid));
// correct common partial html markup (part of text identification for words also used as html parameter)
if (!t.isEmpty()) {
if (sourcetext.startsWith(">") && !t.startsWith(">")) t=">"+t;
if (sourcetext.endsWith("<") && !t.endsWith("<")) t=t+"<";
}
targettxt = t;
// add changes to original (for display) and local (for save)
origTextList.put(sourcetext, targettxt);
changed = ctm.addTranslation(localTrans, filename, sourcetext, targettxt);
}
}
prop.putHTML("textlist_" + i + "_sourcetxt", sourcetext);
prop.putHTML("textlist_" + i + "_targettxt", targettxt);
prop.put("textlist_" + i + "_tokenid", Integer.toString(i));
prop.put("textlist_" + i + "_filteruntranslated_tokenid", Integer.toString(i));
i++;
}
if (post != null && post.containsKey("savetranslationlist")) {
changed = true;
}
if (changed) {
ctm.saveAsLngFile(langcfg, locallngfile, localTrans);
// adhoc translate this file
// 1. get/calc the path
final String htRootPath = env.getConfig(SwitchboardConstants.HTROOT_PATH, SwitchboardConstants.HTROOT_PATH_DEFAULT);
final File sourceDir = new File(env.getAppPath(), htRootPath);
final File destDir = new File(env.getDataPath("locale.translated_html", "DATA/LOCALE/htroot"), locallngfile.getName().substring(0, locallngfile.getName().length() - 4));// cut .lng
// get absolute file by adding relative filename from translationlist
final File sourceFile = new File(sourceDir, filename);
final File destFile = new File(destDir, filename);
ctm.translateFile(sourceFile, destFile, origTextList); // do the translation
}
}
prop.put("textlist", i);
return prop;
} catch (IOException ex) {
ConcurrentLog.logException(ex);
}
return null;
}
}

@ -42,16 +42,26 @@
</dl>
<dl class="pairs">
#(icq)#::
<dt>ICQ</dt>
<dd>#(icq)#&nbsp;::<a href="http://www.icq.com/people/#[value]#/" target="_blank">#[value]#</a> <img src="http://status.icq.com/online.gif?icq=#[value]#&amp;img=5" alt="Onlinestatus" />#(/icq)#</dd>
<dd>&nbsp;<a href="http://www.icq.com/people/#[value]#/" target="_blank">#[value]#</a> <img src="http://status.icq.com/online.gif?icq=#[value]#&amp;img=5" alt="Onlinestatus" /></dd>
#(/icq)#
#(jabber)#::
<dt>Jabber</dt>
<dd>#(jabber)#&nbsp;::#[value]##(/jabber)#</dd>
<dd>&nbsp;#[value]#</dd>
#(/jabber)#
#(yahoo)#::
<dt>Yahoo!</dt>
<dd>#(yahoo)#&nbsp;::#[value]# <img src="http://opi.yahoo.com/online?u=#[value]#&amp;m=g&amp;t=0&amp;zzz=.png" alt="Onlinestatus" />#(/yahoo)#</dd>
<dd>&nbsp;#[value]# <img src="http://opi.yahoo.com/online?u=#[value]#&amp;m=g&amp;t=0&amp;zzz=.png" alt="Onlinestatus" /></dd>
#(/yahoo)#
#(msn)#::
<dt>MSN</dt>
<dd>#(msn)#&nbsp;::#[value]##(/msn)#</dd>
<dd>&nbsp;#[value]#</dd>
#(/msn)#
#(skype)#::
<dt>Skype</dt>
<dd>#(skype)#&nbsp;::#[value]##(/skype)#</dd>
<dd>&nbsp;#[value]#</dd>
#(/skype)#
</dl>
<dl class="pairs">

@ -30,6 +30,7 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
@ -83,7 +84,7 @@ public class Vocabulary_p {
final boolean discoverFromAuthor = post.get("discovermethod", "").equals("author");
final boolean discoverFromCSV = post.get("discovermethod", "").equals("csv");
final String discoverFromCSVPath = post.get("discoverpath", "").replaceAll("%20", " ");
final String discoverFromCSVCharset = post.get("charset", StandardCharsets.UTF_8.name());
String discoverFromCSVCharset = post.get("charset", StandardCharsets.UTF_8.name());
final int discovercolumnliteral = post.getInt("discovercolumnliteral", 0);
final int discovercolumnsynonyms = post.getInt("discovercolumnsynonyms", -1);
final int discovercolumnobjectlink = post.getInt("discovercolumnobjectlink", -1);
@ -95,46 +96,51 @@ public class Vocabulary_p {
if (!discoverNot) {
if (discoverFromCSV && discoverFromCSVFile != null && discoverFromCSVFile.exists()) {
// auto-detect charset, used code from http://jchardet.sourceforge.net/; see also: http://www-archive.mozilla.org/projects/intl/chardet.html
FileUtils.checkCharset(discoverFromCSVFile, discoverFromCSVCharset, true);
// read file
BufferedReader r = new BufferedReader(new InputStreamReader(new FileInputStream(discoverFromCSVFile), discoverFromCSVCharset));
String line = null;
Pattern semicolon = Pattern.compile(";");
Map<String, String> synonym2literal = new HashMap<>(); // helper map to check if there are double synonyms
while ((line = r.readLine()) != null) {
if (line.length() == 0) continue;
String[] l = semicolon.split(line);
if (l.length == 0) l = new String[]{line};
String literal = discovercolumnliteral < 0 || l.length <= discovercolumnliteral ? null : l[discovercolumnliteral].trim();
if (literal == null) continue;
literal = normalizeLiteral(literal);
String objectlink = discovercolumnobjectlink < 0 || l.length <= discovercolumnobjectlink ? null : l[discovercolumnobjectlink].trim();
if (literal.length() > 0) {
String synonyms = "";
if (discoverenrichsynonyms) {
Set<String> sy = SynonymLibrary.getSynonyms(literal);
if (sy != null) {
for (String s: sy) synonyms += "," + s;
if (discoverFromCSVCharset.equals("autodetect")) {
List<String> charsets = FileUtils.detectCharset(discoverFromCSVFile);
discoverFromCSVCharset = charsets.get(0);
ConcurrentLog.info("FileUtils", "detected charset: " + discoverFromCSVCharset + " used to read " + discoverFromCSVFile.toString());
}
// read file (try-with-resource to close inputstream automatically)
try (BufferedReader r = new BufferedReader(new InputStreamReader(new FileInputStream(discoverFromCSVFile), discoverFromCSVCharset))) {
String line = null;
Pattern semicolon = Pattern.compile(";");
Map<String, String> synonym2literal = new HashMap<>(); // helper map to check if there are double synonyms
while ((line = r.readLine()) != null) {
if (line.length() == 0) continue;
String[] l = semicolon.split(line);
if (l.length == 0) l = new String[]{line};
String literal = discovercolumnliteral < 0 || l.length <= discovercolumnliteral ? null : l[discovercolumnliteral].trim();
if (literal == null) continue;
literal = normalizeLiteral(literal);
String objectlink = discovercolumnobjectlink < 0 || l.length <= discovercolumnobjectlink ? null : l[discovercolumnobjectlink].trim();
if (literal.length() > 0) {
String synonyms = "";
if (discoverenrichsynonyms) {
Set<String> sy = SynonymLibrary.getSynonyms(literal);
if (sy != null) {
for (String s: sy) synonyms += "," + s;
}
} else if (discoverreadcolumn) {
synonyms = discovercolumnsynonyms < 0 || l.length <= discovercolumnsynonyms ? null : l[discovercolumnsynonyms].trim();
synonyms = normalizeLiteral(synonyms);
} else {
synonyms = Tagging.normalizeTerm(literal);
}
} else if (discoverreadcolumn) {
synonyms = discovercolumnsynonyms < 0 || l.length <= discovercolumnsynonyms ? null : l[discovercolumnsynonyms].trim();
synonyms = normalizeLiteral(synonyms);
} else {
synonyms = Tagging.normalizeTerm(literal);
}
// check double synonyms
if (synonyms.length() > 0) {
String oldliteral = synonym2literal.get(synonyms);
if (oldliteral != null && !literal.equals(oldliteral)) {
// replace old entry with combined new
table.remove(oldliteral);
String newliteral = oldliteral + "," + literal;
literal = newliteral;
// check double synonyms
if (synonyms.length() > 0) {
String oldliteral = synonym2literal.get(synonyms);
if (oldliteral != null && !literal.equals(oldliteral)) {
// replace old entry with combined new
table.remove(oldliteral);
String newliteral = oldliteral + "," + literal;
literal = newliteral;
}
synonym2literal.put(synonyms, literal);
}
synonym2literal.put(synonyms, literal);
// store term
table.put(literal, new Tagging.SOTuple(synonyms, objectlink == null ? "" : objectlink));
}
// store term
table.put(literal, new Tagging.SOTuple(synonyms, objectlink == null ? "" : objectlink));
}
}
} else {
@ -304,10 +310,12 @@ public class Vocabulary_p {
}
// make charset list for import method selector
int c = 0;
prop.putHTML("create_charset_" + 0 + "_name", "autodetect");
prop.put("create_charset_" + 0 + "_selected", 1);
int c = 1;
for (String cs: Charset.availableCharsets().keySet()) {
prop.putHTML("create_charset_" + c + "_name", cs);
prop.put("create_charset_" + c + "_selected", cs.equals("windows-1252") ? 1 : 0);
prop.put("create_charset_" + c + "_selected", 0);
c++;
}
prop.put("create_charset", c);

@ -117,7 +117,11 @@ public class WebStructurePicture_p {
for (int i = 0; i < hostlist.length; i++) {
String host = hostlist[i];
String hash = null;
try {hash = ASCII.String((new DigestURL("http://" + host)).hash(), 6, 6);} catch (final MalformedURLException e) {ConcurrentLog.logException(e);}
try {
hash = ASCII.String((new DigestURL("http://" + host)).hash(), 6, 6);
} catch (final MalformedURLException e) {
continue;
}
Map.Entry<String, String> centernode = new AbstractMap.SimpleEntry<String, String>(hash, host);
double angle = 2.0d * i * Math.PI / hostlist.length;
if (hostlist.length == 3) angle -= Math.PI / 2;

@ -116,13 +116,15 @@ public class citation {
ArrayList<String> sentences = new ArrayList<String>();
if (title != null) for (String s: title) if (s.length() > 0) sentences.add(s);
SentenceReader sr = new SentenceReader(text);
StringBuilder line;
while (sr.hasNext()) {
line = sr.next();
if (line.length() > 0) sentences.add(line.toString());
if (text != null && !text.isEmpty()) {
SentenceReader sr = new SentenceReader(text);
StringBuilder line;
while (sr.hasNext()) {
line = sr.next();
if (line.length() > 0) sentences.add(line.toString());
}
}
// for each line make a statistic about the number of occurrences somewhere else
OrderedScoreMap<String> scores = new OrderedScoreMap<String>(null); // accumulates scores for citating urls
LinkedHashMap<String, Set<DigestURL>> sentenceOcc = new LinkedHashMap<String, Set<DigestURL>>();

@ -74,7 +74,7 @@ public class push_p {
String collection = post.get("collection-" + i, "");
String lastModified = post.get("lastModified-" + i, ""); // must be in RFC1123 format
String contentType = post.get("contentType-" + i, "");
String data64 = post.get("data-" + i, ""); // file uploads are base64encoded in YaCyDefaultServlet.parseMultipart
String data64 = post.get("data-" + i + "$file", ""); // multi-file uploads are all base64-encoded in YaCyDefaultServlet.parseMultipart
byte[] data = Base64Order.standardCoder.decode(data64);
if ((data == null || data.length == 0) && data64.length() > 0) data = UTF8.getBytes(data64); // for test cases

@ -0,0 +1,47 @@
<html>
<head>
</head>
<body>
<h1>File Share</h1>
#(mode)#
<!-- mode = 0 - display an upload form -->
<p>This form can be used to share a (index) file</p>
<form id="push" action="share.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<dl>
<dt>Files to process:<dt>
<dt>&nbsp;<dt><dd>&nbsp;</dd>
<dd>
<dl>
<dt>data=</dt>
<dd><input name="data" type="file"></dd>
</dl>
</dd>
</dl>
<input type="submit" value="Submit">
</form>
::
<!-- mode 1 - display the push results -->
Result for the recently submitted file(s). You can also submit the same form using the servlet share.json to get push confirmations in json format.
<dl>
<dt>successall</dt><dd>#(successall)#false::true#(/successall)#</dd>
<dt>countsuccess</dt><dd>#[countsuccess]#</dd>
<dt>countfail</dt><dd>#[countfail]#</dd>
</dl>
<table border="1">
<tr><th>Item</th><th>URL</th><th>Success</th><th>Message</th></tr>
<tr>
<td>#[item]#</td>
<td><a href="#[url]#">#[url]#</a></td>
<td>#(success)#fail::ok#(/success)#</td>
<td>#(success)##[message]#::<a href="#[message]#" target="_blank">#[message]#</a>#(/success)#</td>
</tr>
</table>
<p>
If you want to push again files, use this form to pre-define a number of upload forms:
<form id="push" action="share.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<input name="c" type="text" value="1" size="4" maxlength="8"><input type="submit" value="Submit">
</form>
</p>
#(/mode)#
</body>
</html>

@ -0,0 +1,106 @@
/**
* share
* Copyright 2016 by Michael Peter Christen, mc@yacy.net, Frankfurt a. M., Germany
* First released 24.02.2016 at http://yacy.net
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program in the file lgpl21.txt
* If not, see <http://www.gnu.org/licenses/>.
*/
import java.io.File;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import net.yacy.yacy;
import net.yacy.cora.document.encoding.UTF8;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.search.Switchboard;
import net.yacy.search.index.Fulltext;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
public class share {
/**
* Servlet to share any kind of binary to this peer.
* That mean you can upload 'things'. While this is the generic view,
* it will operate in the beginning only for full solr export files.
* The servlet will decide if it wants that kind of data and if the sender is valid,
* i.e. if the sender is within the own network and known.
* Index dumps which are uploaded are placed to a specific folder
* where they can be downloaded again by peers.
* An optional operation is the immediate indexing of the shared index.
* @param header
* @param post
* @param env
* @return
*/
public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
final serverObjects prop = new serverObjects();
// display mode: this only helps to display a nice input form for test cases
int c = post == null ? 1 : post.getInt("c", 0);
if (c > 0) {
prop.put("mode", 0);
return prop;
}
// push mode: this does a document upload
prop.put("mode", 1);
prop.put("success", 0);
if (post == null) return prop;
// check file name
String filename = post.get("data", "");
if (!filename.startsWith(Fulltext.yacy_dump_prefix) || !filename.endsWith(".xml.gz")) return prop;
// check data
String dataString = post.get("data$file", "");
if (dataString.length() == 0) return prop;
byte[] data;
if (filename.endsWith(".base64")) {
data = Base64Order.standardCoder.decode(dataString);
filename = filename.substring(0, filename.length() - 7);
} else {
data = UTF8.getBytes(dataString);
}
if (data == null || data.length == 0) return prop;
// modify the file name; ignore and replace the used transaction token
int ttp = filename.indexOf("_t");
if (ttp < 0) return prop;
if (filename.charAt(ttp + 3) != '.') return prop;
filename = filename.substring(0, ttp) + "_ts" + filename.substring(ttp + 3); // transaction token: 's' as 'shared'.
// process the data
File tmpFile = new File(yacy.shareDumpDefaultPath, filename + ".tmp");
File finalFile = new File(yacy.shareDumpDefaultPath, filename);
try {
Files.copy(new ByteArrayInputStream(data), tmpFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
tmpFile.renameTo(finalFile);
} catch (IOException e) {
ConcurrentLog.logException(e);
return prop;
}
prop.put("success", 1);
return prop;
}
}

@ -50,6 +50,7 @@ import net.yacy.document.ImageParser;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.peers.graphics.EncodedImage;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@ -257,10 +258,10 @@ public class snapshot {
SolrDocument sd = sb.index.fulltext().getMetadata(durl.hash());
boolean success = false;
if (sd == null) {
success = Transactions.store(durl, new Date(), 99, false, true, sb.getConfigBool("isTransparentProxy", false) ? "http://127.0.0.1:" + sb.getConfigInt("port", 8090) : null, sb.getConfig("crawler.http.acceptLanguage", null));
success = Transactions.store(durl, new Date(), 99, false, true, sb.getConfigBool(SwitchboardConstants.PROXY_TRANSPARENT_PROXY, false) ? "http://127.0.0.1:" + sb.getConfigInt("port", 8090) : null, sb.getConfig("crawler.http.acceptLanguage", null));
} else {
SolrInputDocument sid = sb.index.fulltext().getDefaultConfiguration().toSolrInputDocument(sd);
success = Transactions.store(sid, false, true, true, sb.getConfigBool("isTransparentProxy", false) ? "http://127.0.0.1:" + sb.getConfigInt("port", 8090) : null, sb.getConfig("crawler.http.acceptLanguage", null));
success = Transactions.store(sid, false, true, true, sb.getConfigBool(SwitchboardConstants.PROXY_TRANSPARENT_PROXY, false) ? "http://127.0.0.1:" + sb.getConfigInt("port", 8090) : null, sb.getConfig("crawler.http.acceptLanguage", null));
}
if (success) {
pdfSnapshots = Transactions.findPaths(durl, "pdf", Transactions.State.ANY);

@ -101,7 +101,7 @@
<ul class="nav nav-sidebar menugroup">
<li><h3>Administration</h3></li>
<li><a href="IndexControlURLs_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Index Administration</a></li>
<li><a href="Tables_p.html?table=robots&count=100" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">System Administration</a></li>
<li><a href="Settings_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">System Administration</a></li>
<li><a href="Blacklist_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Filter &amp; Blacklists</a></li>
<li><a href="Table_API_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Process Scheduler</a></li>
</ul>

@ -5,6 +5,9 @@
<meta name="description" content="Software HTTP Freeware Home Page" />
<meta name="copyright" content="Michael Christen et al." />
<!-- Ensure proper rendering and touch zooming on mobile devices -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap core CSS -->
<link href="/env/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="/env/bootstrap/css/bootstrap-switch.min.css" rel="stylesheet">

@ -1,9 +1,9 @@
<div class="SubMenu">
<h3>System Administration</h3>
<ul class="SubMenu">
<li><a href="Tables_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Viewer and administration for database tables</a></li>
<li><a href="PerformanceQueues_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Performance Settings of Busy Queues</a></li>
<li><a href="Settings_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Advanced Settings</a></li>
<li><a href="PerformanceQueues_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Performance Settings of Busy Queues</a></li>
<li><a href="Tables_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Viewer and administration for database tables</a></li>
<li><a href="ConfigProperties_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Advanced Properties</a></li>
</ul>
</div>

@ -215,6 +215,5 @@
::
#%env/templates/simplefooter.template%#
#(/topmenu)#
<img src="cytag.png?icon=invisible&amp;nick=yacyh_#[clientid]#&amp;tag=search" alt=""/>
</body>
</html>

@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta charset="UTF-8">
<title>rss terminal</title>
<style type="text/css">
@ -172,8 +172,8 @@ function init() {
<body onload="self.getURLparameters();init();">
<div id="feedbox">
<p id="content"></p>
<p id="content" role="marquee"></p>
</div>
</body>
</html>
</html>

@ -184,7 +184,6 @@ public final class transferRWI {
byte[] urlHash;
WordReferenceRow iEntry;
final HandleSet unknownURL = new RowHandleSet(Word.commonHashLength, Word.commonHashOrder, 0);
final HandleSet knownURL = new RowHandleSet(Word.commonHashLength, Word.commonHashOrder, 0);
final ArrayList<String> wordhashes = new ArrayList<String>();
int received = 0;
int blocked = 0;
@ -206,9 +205,9 @@ public final class transferRWI {
iEntry = new WordReferenceRow(estring.substring(p));
urlHash = iEntry.urlhash();
// block blacklisted entries
// block blacklisted entries
if ((blockBlacklist) && (Switchboard.urlBlacklist.hashInBlacklistedCache(BlacklistType.DHT, urlHash))) {
Network.log.fine("transferRWI: blocked blacklisted URLHash '" + ASCII.String(urlHash) + "' from peer " + otherPeerName);
Network.log.fine("transferRWI: blocked blacklisted URLHash '" + ASCII.String(urlHash) + "' from peer " + otherPeerName);
blocked++;
continue;
}
@ -236,9 +235,7 @@ public final class transferRWI {
for (String id: testids) {
try {
try {
if (sb.index.fulltext().getLoadTime(id) >= 0) {
knownURL.put(ASCII.getBytes(id));
} else {
if (sb.index.fulltext().getLoadTime(id) < 0) {
unknownURL.put(ASCII.getBytes(id));
}
} catch (IOException e) {

@ -60,9 +60,7 @@ import net.yacy.data.BookmarksDB.Bookmark;
import net.yacy.data.DidYouMean;
import net.yacy.data.UserDB;
import net.yacy.data.ymark.YMarkTables;
import net.yacy.document.Document;
import net.yacy.document.LibraryProvider;
import net.yacy.document.Parser;
import net.yacy.document.Tokenizer;
import net.yacy.kelondro.data.meta.URIMetadataNode;
import net.yacy.kelondro.util.Bitfield;
@ -73,7 +71,6 @@ import net.yacy.kelondro.util.SetTools;
import net.yacy.peers.EventChannel;
import net.yacy.peers.NewsPool;
import net.yacy.peers.graphics.ProfilingGraph;
import net.yacy.repository.Blacklist.BlacklistType;
import net.yacy.search.EventTracker;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
@ -195,6 +192,7 @@ public class yacysearch {
prop.put("geoinfo", "0");
prop.put("rss_queryenc", "");
prop.put("meanCount", 5);
prop.put("eventID",""); // mandatory parameter for yacysearchtrailer/yacysearchitem includes
return prop;
}
@ -556,31 +554,18 @@ public class yacysearch {
}
final String recommendHash = post.get("recommendref", ""); // urlhash
final URIMetadataNode urlentry = indexSegment.fulltext().getMetadata(UTF8.getBytes(recommendHash));
if ( urlentry != null ) {
Document[] documents = null;
try {
documents =
sb.loader.loadDocuments(
sb.loader.request(urlentry.url(), true, false),
CacheStrategy.IFEXIST,
Integer.MAX_VALUE, BlacklistType.SEARCH, ClientIdentification.yacyIntranetCrawlerAgent);
} catch (final IOException e ) {
} catch (final Parser.Failure e ) {
}
if ( documents != null ) {
// create a news message
final Map<String, String> map = new HashMap<String, String>();
map.put("url", urlentry.url().toNormalform(true).replace(',', '|'));
map.put("title", urlentry.dc_title().replace(',', ' '));
map.put("description", documents[0].dc_title().replace(',', ' '));
map.put("author", documents[0].dc_creator());
map.put("tags", documents[0].dc_subject(' '));
sb.peers.newsPool.publishMyNews(
if (urlentry != null) {
// create a news message
final Map<String, String> map = new HashMap<String, String>();
map.put("url", urlentry.url().toNormalform(true).replace(',', '|'));
map.put("title", urlentry.dc_title().replace(',', ' '));
map.put("description", urlentry.getDescription().isEmpty() ? urlentry.dc_title().replace(',', ' ') : urlentry.getDescription().get(0).replace(',', ' '));
map.put("author", urlentry.dc_creator());
map.put("tags", urlentry.dc_subject().replace(',', ' '));
sb.peers.newsPool.publishMyNews(
sb.peers.mySeed(),
NewsPool.CATEGORY_SURFTIPP_ADD,
map);
documents[0].close();
}
}
}

@ -138,7 +138,7 @@ public class yacysearchitem {
if (authenticated) { // only needed if authorized
boolean bookmarkexists;
// check url exists in bookkmarks
bookmarkexists = sb.bookmarksDB.getBookmark(urlhash) != null;
bookmarkexists = sb.bookmarksDB.getBookmark(urlhash) != null;
prop.put("content_authorized_bookmark", !bookmarkexists);
// bookmark icon check for YMarks
//prop.put("content_authorized_bookmark", sb.tables.bookmarks.hasBookmark("admin", urlhash) ? "0" : "1");
@ -183,7 +183,6 @@ public class yacysearchitem {
prop.putXML("content_link", resultUrlstring); // putXML for rss
}
// prop.putHTML("content_value", Interaction.TripleGet(result.urlstring(), "http://virtual.x/hasvalue", "anonymous"));
// END interaction
boolean isAtomFeed = header.get(HeaderFramework.CONNECTION_PROP_EXT, "").equals("atom");
@ -301,7 +300,7 @@ public class yacysearchitem {
boolean stealthmode = p2pmode && theSearch.query.isLocal();
if ((sb.getConfigBool(SwitchboardConstants.HEURISTIC_SEARCHRESULTS, false) ||
(sb.getConfigBool(SwitchboardConstants.GREEDYLEARNING_ACTIVE, false) && sb.getConfigBool(SwitchboardConstants.GREEDYLEARNING_ENABLED, false) && Memory.load() < 1.0)) &&
!stealthmode) sb.heuristicSearchResults(resultUrlstring);
!stealthmode) sb.heuristicSearchResults(result);
theSearch.query.transmitcount = item + 1;
return prop;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -1,45 +0,0 @@
list of library-dependencies:
* jetty (these files were taken from the solr 3.6.0 example)
jetty-6.1.26-patched-JETTY-1340.jar
jetty-util-6.1.26-patched-JETTY-1340.jar
servlet-api-2.5-20081211.jar
* apache-solr-solrj-3.4.0.jar depends on:
commons-codec-1.4.jar
commons-httpclient-3.1.jar
commons-io-1.4.jar
geronimo-stax-api_1.0_spec-1.0.1.jar
jcl-over-slf4j-1.6.1.jar
slf4j-api-1.6.1.jar
wstx-asl-3.2.7.jar
* apache-solr-core-3.6.0.jar depends on
commons-codec-1.6.jar
commons-fileupload-1.2.1.jar
commons-httpclient-3.1.jar
commons-io-2.1.jar
commons-lang-2.6.jar
geronimo-stax-api_1.0_spec-1.0.1.jar
guava-r05.jar
httpclient-4.3.6.jar
httpcore-4.3.3.jar
jcl-over-slf4j-1.6.1.jar
log4j-over-slf4j-1.6.1.jar
lucene-analyzers-3.6.0.jar
lucene-core-3.6.0.jar
lucene-highlighter-3.6.0.jar
lucene-phonetic-3.6.0.jar
lucene-spatial-3.6.0.jar
lucene-spellchecker-3.6.0.jar
slf4j-api-1.6.1.jar
slf4j-jdk14-1.6.1.jar
wstx-asl-3.2.7.jar
* pdfbox-1.8.5.jar depends on:
(see http://pdfbox.apache.org/dependencies.html)
fontbox-1.8.5.jar
jempbox-1.8.5.jar
bcprov-jdk15-1.44.jar
bcmail-jdk15-1.44.jar
icu4j.jar

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save