luccioman 9 years ago
commit 893a40995a

@ -3,7 +3,7 @@ javacSource=1.7
javacTarget=1.7
# Release Configuration
releaseVersion=1.83
releaseVersion=1.91
stdReleaseFile=yacy${branch}_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
sourceReleaseFile=yacy_src_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
releaseFileParentDir=yacy

@ -64,7 +64,7 @@ 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
network.unit.bootstrap.seedlist9 = http://gw.knyshov.net/seed.txt
# each network may use different yacy distributions.
# the auto-updater can access network-specific update locations

@ -1,46 +1,49 @@
# 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
# Base image : latest stable official jdk image from Docker (Debian based)
FROM java:latest
# Install needed packages not in base image
RUN apt-get update && apt-get install -yq curl
# trace java version
RUN java -version
# 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
# All in one step to reduce image size growth :
# - install ant and git packages
# - clone main YaCy git repository (we need to clone git repository to generate correct version when building from source)
# - Compile with ant
# - remove unnecessary and size consuming .git directory
# - remove ant and git packages
RUN apt-get update && \
apt-get install -yq ant git && \
git clone https://github.com/yacy/yacy_search_server.git && \
ant compile -f /opt/yacy_search_server/build.xml && \
rm -rf /opt/yacy_search_server/.git && \
apt-get purge -yq --auto-remove ant git && \
apt-get clean
# 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
# Create user and group yacy : this user will be used to run YaCy main process
RUN adduser --system --group --no-create-home --disabled-password yacy
# Set ownership of yacy install directory to yacy user/group
RUN chown yacy:yacy -R /opt/yacy_search_server
# Expose port 8090
EXPOSE 8090
# Set data volume : can be used to persist yacy data and configuration
# Set data volume : yacy data and configuration will persist aven after container stop or destruction
VOLUME ["/opt/yacy_search_server/DATA"]
# Start yacy ind debug mode (-d) to display console logs and to wait for yacy process
# Next commands run as yacy as non-root user for improved security
USER yacy
# Start yacy in 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,81 @@
# Build a docker image from latest YaCy sources on Alpine Linux
# Base image : latest stable official jdk image from Docker based on Alpine Linux
FROM java:alpine
# trace java version
RUN java -version
# Install needed packages not in base image
RUN apk update && \
apk add --no-cache curl
# set current working dir
WORKDIR /tmp
# --- Begin of apache ant install : from binary distribution because ant is not in alpine packages
# set ant version once in a environment variable
ENV ANT_VERSION 1.9.7
# All in one step to reduce image size growth :
# - add gnupg package
# - get ant binary file from a mirror and PGP file signature from main repository
# - import gpg keys from main repository and verify binary file signature
# - extract binary, make /opt directory, move extracted ant to /opt/ant
# - remove archive and gnupg package
RUN apk update && \
apk add --no-cache gnupg && \
curl -fSL http://www.eu.apache.org/dist//ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz -o apache-ant-${ANT_VERSION}-bin.tar.gz && \
curl -fSL https://www.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz.asc -o apache-ant-${ANT_VERSION}-bin.tar.gz.asc && \
curl -fSL https://www.apache.org/dist/ant/KEYS | gpg --import && \
gpg --verify apache-ant-${ANT_VERSION}-bin.tar.gz.asc && \
tar xzf apache-ant-${ANT_VERSION}-bin.tar.gz && \
mkdir /opt && \
mv apache-ant-${ANT_VERSION} /opt/ant && \
rm -f apache-ant-${ANT_VERSION}-bin.tar.gz && \
apk del gnupg
# set ant required environment variables
ENV ANT_HOME /opt/ant
ENV PATH ${PATH}:/opt/ant/bin
# --- End of apache ant install
# set current working dir
WORKDIR /opt
# All in one step to reduce image size growth :
# - add git package
# - clone main YaCy git repository (we need to clone git repository to generate correct version when building from source)
# - compile with apache ant
# - remove unnecessary and size consuming .git directory
# - delete git package and ant binary install
RUN apk update && \
apk add --no-cache git && \
git clone https://github.com/yacy/yacy_search_server.git && \
ant compile -f /opt/yacy_search_server/build.xml && \
rm -rf /opt/yacy_search_server/.git && \
rm -rf /opt/ant && \
apk del git
# 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
# Create user and group yacy : this user will be used to run YaCy main process
RUN addgroup yacy && adduser -S -G yacy -H -D yacy
# Set ownership of yacy install directory to yacy user/group
RUN chown yacy:yacy -R /opt/yacy_search_server
# Expose port 8090
EXPOSE 8090
# Set data volume : yacy data and configuration will persist aven after container stop or destruction
VOLUME ["/opt/yacy_search_server/DATA"]
# Next commands run as yacy as non-root user for improved security
USER yacy
# Start yacy in debug mode (-d) to display console logs and to wait for yacy process
CMD sh /opt/yacy_search_server/startYACY.sh -d

@ -2,6 +2,11 @@
[![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)
## Supported tags and respective Dockerfiles
* latest (Dockerfile)
* lastet-alpine (Dockerfile.alpine)
## Getting built image from Docker Hub
docker pull luccioman/yacy
@ -15,6 +20,16 @@ Using yacy_search_server/docker/Dockerfile :
cd yacy_search_server/docker
docker build .
## Image variants
`luccioman/yacy:latest`
This image is based on latest stable official Debian [java](https://hub.docker.com/_/java/) image provided by Docker. Embed Yacy compiled from latest git repository sources.
`luccioman/yacy:latest-alpine`
This image is based on latest stable official Alpine Linux [java](https://hub.docker.com/_/java/) image provided by Docker. Embed Yacy compiled from latest git repository sources.
## Default admin account
login : admin
@ -36,17 +51,32 @@ You can retrieve the container IP address with `docker inspect`.
#### Easier to handle
docker run --name yacy -p 8090:8090 luccioman/yacy
docker run --name yacy -p 8090:8090 --log-opt max-size=100m --log-opt max-file=2 luccioman/yacy
##### Options detail
* --name : allow easier management of your container (without it, docker automatically generate a new name at each startup).
* -p : map host port and container port, allowing web interface access through the usual http://localhost:8090.
* --log-opt max-size : limit maximum docker log file size for this container
* --log-opt max-file : limit number of docker rotated log files for this container
Note : if you do not specify the log related options, when running a YaCy container 24hour a day with default log level, your Docker container log file will grow up to some giga bytes in a few days!
#### Handle persistent data volume
As configured in the Dockerfile, by default yacy data (in /opt/yacy_search_server/DATA) will persist after container stop or deletion, in a volume with an automatically generated id.
But you may map a host directory to hold yacy data in container :
docker run -v [/your_host/data/directory]:/opt/yacy_search_server/DATA luccioman/yacy
--name option allow easier management of your container (without it, docker automatically generate a new name at each startup).
Or just use a volume label to help identify it later
-p option map host port and container port, allowing web interface access through the usual http://localhost:8090.
docker run -v yacy_volume:/opt/yacy_search_server/DATA luccioman/yacy
#### With persistent data volume
Note that you can list all docker volumes with :
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.
docker volume ls
#### As background process
@ -65,3 +95,41 @@ This allow your container to reuse a data directory form the host.
### Shutdown
* Use "Shutdown" button in administration web interface
* OR run :
docker exec [your_container_name] /opt/yacy_search_server/stopYACY.sh
### Upgrade
You can upgrade your YaCy container the Docker way with the following commands sequence.
Get latest Docker image :
docker pull luccioman/yacy:latest
OR
docker pull luccioman/yacy:latest-alpine
Create new container based on pulled image, using volume data from old container :
docker create --name [tmp-container_name] -p 8090:8090 --volumes-from=[container_name] luccioman/yacy:latest
Stop old container :
docker exec [container_name] /opt/yacy_search_server/stopYACY.sh
Start new container :
docker start [tmp-container_name]
Check everything works fine, then you can delete old container :
docker rm [container_name]
Rename new container to reuse same container name :
docker rename [tmp-container_name] [container_name]
## License
View [license](https://github.com/yacy/yacy_search_server/blob/master/COPYRIGHT) information for the software contained in this image.

@ -95,10 +95,10 @@
</legend>
<p>
You can configure if you want to participate at the global YaCy network or if you want to have your
own separate search cluster with or without connection to the global network. You may also define
Enable Peer-to-Peer Mode to participate in the global YaCy network, or if you want your
own separate search cluster with or without connection to the global network. Enable 'Robinson Mode' for
a completely independent search engine instance, without any data exchange between your peer and other
peers, which we call a 'Robinson' peer.
peers.
</p>
<form id="ConfigForm" method="post" action="ConfigNetwork_p.html" enctype="multipart/form-data" accept-charset="UTF-8">
<fieldset>
@ -218,4 +218,4 @@
</fieldset>
#%env/templates/footer.template%#
</body>
</html>
</html>

@ -2,6 +2,7 @@
<!-- This page is only XHTML 1.0 Transitional and not Strict because iframes are in use -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
#%env/templates/metas.template%#
<script type="text/javascript">
//<![CDATA[
function xmlhttpPost() {
@ -53,7 +54,6 @@ function updatepage(str) {
//]]>
</script>
<title>YaCy '#[clientname]#': View URL Content</title>
#%env/templates/metas.template%#
<script type="text/javascript" src="js/highslide/highslide.js"></script>
</head>
<body>

@ -40,6 +40,7 @@
<ul class="dropdown-menu">
<li id="header_profile"><a href="ViewProfile.html?hash=localhash">About This Page</a></li>
<li id="header_tutorial"><a href="http://yacy.net/tutorials/">YaCy Tutorials</a></li>
<li id="header_jslicense"><a href="jslicense.html" data-jslicense="1">JavaScript information</a></li>
<li class="divider"></li>
<li id="header_tutorial"><a href="http://yacy.net" target="_blank"><i>external</i>&nbsp;&nbsp;&nbsp;Download YaCy</a></li>
<li id="header_tutorial"><a href="http://forum.yacy.de" target="_blank"><i>external</i>&nbsp;&nbsp;&nbsp;Community (Web Forums)</a></li>

@ -11,6 +11,34 @@
<!-- Bootstrap core CSS -->
<link href="/env/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="/env/bootstrap/css/bootstrap-switch.min.css" rel="stylesheet">
<script>
/*
@licstart The following is the entire license notice for the
JavaScript code in this page.
Copyright (C) 2005-2016 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
and other YaCy developers (see http://yacy.net/en/Join.html)
first published 07.04.2005 on http://yacy.net
The JavaScript code in this page is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@licend The above is the entire license notice
for the JavaScript code in this page.
*/
</script>
<script src="/env/bootstrap/js/jquery.min.js"></script>
<script src="/env/bootstrap/js/bootstrap.min.js"></script>

@ -39,6 +39,7 @@
<ul class="dropdown-menu">
<li id="header_profile"><a href="ViewProfile.html?hash=localhash">About This Page</a></li>
<li id="header_tutorial"><a href="http://yacy.net/tutorials/">YaCy Tutorials</a></li>
<li id="header_jslicense"><a href="jslicense.html" data-jslicense="1">JavaScript information</a></li>
<li class="divider"></li>
<li id="header_tutorial"><a href="http://yacy.net" target="_blank"><i>external</i>&nbsp;&nbsp;&nbsp;Download YaCy</a></li>
<li id="header_tutorial"><a href="http://forum.yacy.de" target="_blank"><i>external</i>&nbsp;&nbsp;&nbsp;Community (Web Forums)</a></li>

@ -1,3 +1,23 @@
/*
* Copyright (C) 2005 - 2011 Alexander Schier, Martin Thelian, Stefan Förster,
* Florian Richter, Michael Peter Christen
*
* This file is part of YaCy.
*
* YaCy is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* YaCy 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with YaCy. If not, see <http://www.gnu.org/licenses/>.
*/
var AJAX_OFF="/env/grafics/empty.gif";
var AJAX_ON="/env/grafics/ajax.gif";

@ -1,3 +1,23 @@
/*
* Copyright (C) 2005 - 2014 Alexander Schier, Michael Peter Christen,
* and other YaCy developers (see http://yacy.net/en/Join.html)
*
* This file is part of YaCy.
*
* YaCy is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* YaCy 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with YaCy. If not, see <http://www.gnu.org/licenses/>.
*/
DELETE_STRING="delete";
BAR_IMG1="/env/grafics/green-block.png";
BAR_IMG2="/env/grafics/red-block.png";

@ -1,3 +1,30 @@
/*
* @licstart The following is the entire license notice for the
* JavaScript code in this file.
*
* Copyright (C) 2006 - 2014 Alexander Schier, Martin Thelian, Michael Peter Christen,
* Florian Richter, Stefan Förster, David Wieditz
*
*
* This file is part of YaCy.
*
* YaCy is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* YaCy 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with YaCy. If not, see <http://www.gnu.org/licenses/>.
*
* @licend The above is the entire license notice
* for the JavaScript code in this file.
*/
var AJAX_OFF="/env/grafics/empty.gif";
var AJAX_ON="/env/grafics/ajax.gif";
var timeout="";

@ -1,3 +1,22 @@
/*
* Copyright (C) 2007, 2010 Alexander Schier, Michael Benz
*
* This file is part of YaCy.
*
* YaCy is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* YaCy 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with YaCy. If not, see <http://www.gnu.org/licenses/>.
*/
function changeHost(){
window.location.replace("http://"+window.location.host+":"+window.location.port+"/WatchWebStructure_p.html?host="+document.getElementById("host").value);
}

@ -1,3 +1,22 @@
/*
* Copyright (C) 2005, 2010 Alexander Schier, Marc Nause
*
* This file is part of YaCy.
*
* YaCy is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* YaCy 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with YaCy. If not, see <http://www.gnu.org/licenses/>.
*/
function createRequestObject() {
var ro;
if (window.XMLHttpRequest) {

@ -1,3 +1,31 @@
/*
@licstart The following is the entire license notice for the
JavaScript code in this file.
Copyright (C) 2005-2016 Torstein Hønsi
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@licend The above is the entire license notice
for the JavaScript code in this file.
*/
/**
* Name: Highslide JS
* Version: 4.1.13 (2011-10-06)

@ -1,3 +1,22 @@
/*
* Copyright (C) 2006 - 2008 Alexander Schier, Michael Hamann, David Wieditz
*
* This file is part of YaCy.
*
* YaCy is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* YaCy 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with YaCy. If not, see <http://www.gnu.org/licenses/>.
*/
function createCol(content){
col=document.createElement("td");
text=document.createTextNode(content);
@ -46,4 +65,4 @@ function hide(id) {
function show(id) {
document.getElementById(id).style.display = "inline";
}
}

@ -1,3 +1,22 @@
/*
* Copyright (C) 2014 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
*
* This file is part of YaCy.
*
* YaCy is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* YaCy 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with YaCy. If not, see <http://www.gnu.org/licenses/>.
*/
function linkstructure(hostname, element, width, height, maxtime, maxnodes) {
var nodes = {};
var links = [];

@ -1,3 +1,22 @@
/*
* Copyright (C) 2008, 2013 Michael Peter Christen, Roland Haeder
*
* This file is part of YaCy.
*
* YaCy is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* YaCy 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with YaCy. If not, see <http://www.gnu.org/licenses/>.
*/
var query = new Object();
function getQueryProps() {

File diff suppressed because one or more lines are too long

@ -1,3 +1,22 @@
/*
* Copyright (C) 2008 - 2013 Michael Peter Christen, David Wieditz, Roland Haeder
*
* This file is part of YaCy.
*
* YaCy is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* YaCy 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with YaCy. If not, see <http://www.gnu.org/licenses/>.
*/
// parser for rss2
function RSS2Enclosure(encElement) {

@ -13,6 +13,33 @@
Thanks to many, many people for contributions and suggestions.
Licenced as X11: http://www.kryogenix.org/code/browser/licence.html
This basically means: do what you want with it.
@licstart The following is the entire license notice for the
JavaScript code in this file.
Copyright (c) 1997-2007 Stuart Langridge
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@licend The above is the entire license notice
for the JavaScript code in this file.
*/
@ -169,7 +196,7 @@ sorttable = {
for (var i=0; i<table.tBodies[0].rows.length; i++) {
text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]);
if (text != '') {
if (text.match(/^-?[£$¤]?[\d,.]+%?$/)) {
if (text.match(/^-?[<EFBFBD>$<24>]?[\d,.]+%?$/)) {
return sorttable.sort_numeric;
}
// check for a date: dd/mm/yyyy or dd/mm/yy

@ -1,3 +1,22 @@
/*
* Copyright (C) 2006 Alexander Schier, Michael Peter Christen
*
* This file is part of YaCy.
*
* YaCy is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* YaCy 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with YaCy. If not, see <http://www.gnu.org/licenses/>.
*/
function removeAllChildren(element){
if(element==null){
return;

@ -1,3 +1,22 @@
/*
* Copyright (C) 2011, 2012 Stefan Förster
*
* This file is part of YaCy.
*
* YaCy is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* YaCy 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with YaCy. If not, see <http://www.gnu.org/licenses/>.
*/
/* Initialize Bookmark Actions */
function bm_action(com,grid) {
if (com=='Delete') {

@ -1,3 +1,22 @@
/*
* Copyright (C) 2011 Stefan Förster
*
* This file is part of YaCy.
*
* YaCy is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* YaCy 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with YaCy. If not, see <http://www.gnu.org/licenses/>.
*/
/* Initialize Tag Actions */
function tag_action(com,grid) {
alert("Sorry, the function you have requested is not yet available!");

@ -1,3 +1,22 @@
/*
* Copyright (C) 2011, 2012 Stefan Förster
*
* This file is part of YaCy.
*
* YaCy is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* YaCy 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with YaCy. If not, see <http://www.gnu.org/licenses/>.
*/
HTMLenc = function(s) {
return $('<div/>').text(s).html();
}

@ -1,3 +1,22 @@
/*
* Copyright (C) 2010 - 2015 Michael Benz, Michael Peter Christen
*
* This file is part of YaCy.
*
* YaCy is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* YaCy 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with YaCy. If not, see <http://www.gnu.org/licenses/>.
*/
function xmlhttpPost() {
var searchform = document.forms['searchform'];
var rsslink = document.getElementById("rsslink");

@ -1,3 +1,23 @@
/*
* Copyright (C) 2006 - 2014 Martin Thelian, Alexander Schier, Michael Hamann,
* Michael Peter Christen, Franz Brausse, fuchsi
*
* This file is part of YaCy.
*
* YaCy is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* YaCy 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with YaCy. If not, see <http://www.gnu.org/licenses/>.
*/
function addHover() {
if (document.all&&document.getElementById) {
var divs = document.getElementsByTagName("div");

@ -0,0 +1,233 @@
<!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">
<head>
<title>YaCy JavaScript license information</title>
#%env/templates/metas.template%#
</head>
<body id="jslicense">
#%env/templates/simpleheader.template%#
<h1>YaCy JavaScript files license information</h1>
<table id="jslicense-labels1">
<tr>
<th>Script</th>
<th>License</th>
<th>Source</th>
</tr>
<tr>
<td><a href="/env/bootstrap/js/jquery.min.js">jquery.min.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="https://code.jquery.com/jquery-1.11.0.js">jquery-1.11.0.js</a></td>
</tr>
<tr>
<td><a href="/env/bootstrap/js/bootstrap.min.js">bootstrap.min.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/env/bootstrap/js/bootstrap.js">bootstrap.js</a> (3.3.6)</td>
</tr>
<tr>
<td><a href="/env/bootstrap/js/bootstrap-switch.min.js">bootstrap-switch.min.js</a></td>
<td><a href="http://www.apache.org/licenses/LICENSE-2.0">Apache-2.0</a></td>
<td><a href="/env/bootstrap/js/bootstrap-switch.js">bootstrap-switch.js</a> (3.0.0)</td>
</tr>
<tr>
<td><a href="/env/bootstrap/js/docs.min.js">docs.min.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="https://raw.githubusercontent.com/imsky/holder/v2.3.1/holder.js">holder.js</a> (2.3.1)</td>
</tr>
<tr>
<td><a href="/env/bootstrap/js/html5shiv.js">html5shiv.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="https://raw.githubusercontent.com/aFarkas/html5shiv/3.7.0/src/html5shiv.js">html5shiv.js</a> (3.7.0)</td>
</tr>
<tr>
<td><a href="/env/bootstrap/js/respond.min.js">respond.min.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="https://github.com/scottjehl/Respond/blob/1.4.2/dest/respond.src.js">respond.src.js</a> (1.4.2)</td>
</tr>
<tr>
<td><a href="/env/bootstrap/js/typeahead.jquery.min.js">typeahead.jquery.min.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="https://github.com/twitter/typeahead.js/blob/v0.10.2/dist/typeahead.jquery.js">typeahead.jquery.js</a> (0.10.2)</td>
</tr>
<tr>
<td><a href="/jquery/flexigrid/js/flexigrid.pack.js">flexigrid.pack.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/flexigrid/flexigrid-1.1.zip">flexigrid-1.1.zip</a> (0.10.2)</td>
</tr>
<tr>
<td><a href="/jquery/js/jquery-1.7.min.js">jquery-1.7.min.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="https://code.jquery.com/jquery-1.7.js">jquery-1.7.js</a></td>
</tr>
<tr>
<td><a href="/jquery/js/jquery-ui-1.8.16.custom.min.js">jquery-ui-1.8.16.custom.min.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="https://code.jquery.com/ui/1.8.16/jquery-ui.js">jquery-ui.js</a> (1.8.16)</td>
</tr>
<tr>
<td><a href="/jquery/js/jquery-ui-combobox.js">jquery-ui-combobox.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/jquery/js/jquery-ui-combobox.js">jquery-ui-combobox.js</a></td>
</tr>
<tr>
<td><a href="/jquery/js/jquery.field-0.9.2.min.js">jquery.field-0.9.2.min.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/jquery/js/jquery.field-0.9.2.min.js">jquery.field-0.9.2.min.js</a></td>
</tr>
<tr>
<td><a href="/jquery/js/jquery.form-2.73.js">jquery.form-2.73.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/jquery/js/jquery.form-2.73.js">jquery.form-2.73.js</a></td>
</tr>
<tr>
<td><a href="/jquery/js/jquery.multiselect.filter.min.js">jquery.multiselect.filter.min.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="https://raw.githubusercontent.com/ehynds/jquery-ui-multiselect-widget/1.11/src/jquery.multiselect.filter.js">jquery.multiselect.filter.js</a> (1.3)</td>
</tr>
<tr>
<td><a href="/jquery/js/jquery.multiselect.min.js">jquery.multiselect.min.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="https://raw.githubusercontent.com/ehynds/jquery-ui-multiselect-widget/4e1c524663150108c9c6f446252ebd48e870ab34/src/jquery.multiselect.js">jquery.multiselect.js</a> (1.12pre)</td>
</tr>
<tr>
<td><a href="/jquery/js/jquery.query-2.1.7.js">jquery.query-2.1.7.js</a></td>
<td><a href="http://www.wtfpl.net/txt/copying/">WTFPL</a></td>
<td><a href="/jquery/js/jquery.query-2.1.7.js">jquery.query-2.1.7.js</a></td>
</tr>
<tr>
<td><a href="/jquery/js/jquery.rdfquery.core-1.0.js">jquery.rdfquery.core-1.0.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/jquery/js/jquery.rdfquery.core-1.0.js">jquery.rdfquery.core-1.0.js</a></td>
</tr>
<tr>
<td><a href="/jquery/js/jquery.tagsinput.min.js">jquery.tagsinput.min.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/jquery/js/jquery.tagsinput.min.js">jquery.tagsinput.min.js</a></td>
</tr>
<tr>
<td><a href="/env/bootstrap/js/typeahead.jquery.min.js">typeahead.jquery.min.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/env/bootstrap/js/typeahead.jquery.js">typeahead.jquery.js</a> (0.10.2)</td>
</tr>
<tr>
<td><a href="/js/d3.v3.min.js">d3.v3.min.js</a></td>
<td><a href="http://opensource.org/licenses/BSD-3-Clause">Modified-BSD</a></td>
<td><a href="https://raw.githubusercontent.com/d3/d3.github.com/b3382f60bf721923c7c649709adcfb4c8b66d994/d3.v3.js">d3.v3.js</a> (3.4.4)</td>
</tr>
<tr>
<td><a href="/js/highslide/highslide.js">highslide.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/js/highslide/highslide.js">highslide.js</a> (4.1.13)</td>
</tr>
<tr>
<td><a href="/js/morris.js">morris.js</a></td>
<td><a href="http://www.freebsd.org/copyright/freebsd-license.html">FreeBSD</a></td>
<td><a href="/js/morris.js">morris.js</a> (4.1.13)</td>
</tr>
<tr>
<td><a href="/js/raphael-min.js">raphael-min.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="https://raw.githubusercontent.com/DmitryBaranovskiy/raphael/v2.1.3/raphael.js">raphael.js</a> (2.1.3)</td>
</tr>
<tr>
<td><a href="/js/sorttable.js">sorttable.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/js/sorttable.js">sorttable.js</a> (2.1.3)</td>
</tr>
<tr>
<td><a href="/js/ajax.js">ajax.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU-GPL-2.0-or-later</a></td>
<td><a href="/js/ajax.js">ajax.js</a></td>
</tr>
<tr>
<td><a href="/js/Bookmarks.js">Bookmarks.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU-GPL-2.0-or-later</a></td>
<td><a href="/js/Bookmarks.js">Bookmarks.js</a></td>
</tr>
<tr>
<td><a href="/js/Crawler.js">Crawler.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU-GPL-2.0-or-later</a></td>
<td><a href="/js/Crawler.js">Crawler.js</a></td>
</tr>
<tr>
<td><a href="/js/html.js">html.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU-GPL-2.0-or-later</a></td>
<td><a href="/js/html.js">html.js</a></td>
</tr>
<tr>
<td><a href="/js/hypertree.js">hypertree.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU-GPL-2.0-or-later</a></td>
<td><a href="/js/hypertree.js">hypertree.js</a></td>
</tr>
<tr>
<td><a href="/js/IndexCreate.js">IndexCreate.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU-GPL-2.0-or-later</a></td>
<td><a href="/js/IndexCreate.js">IndexCreate.js</a></td>
</tr>
<tr>
<td><a href="/js/query.js">query.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU-GPL-2.0-or-later</a></td>
<td><a href="/js/query.js">query.js</a></td>
</tr>
<tr>
<td><a href="/js/rss2.js">rss2.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU-GPL-2.0-or-later</a></td>
<td><a href="/js/rss2.js">rss2.js</a></td>
</tr>
<tr>
<td><a href="/js/WatchWebStructure.js">WatchWebStructure.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU-GPL-2.0-or-later</a></td>
<td><a href="/js/WatchWebStructure.js">WatchWebStructure.js</a></td>
</tr>
<tr>
<td><a href="/js/xml.js">xml.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU-GPL-2.0-or-later</a></td>
<td><a href="/js/xml.js">xml.js</a></td>
</tr>
<tr>
<td><a href="/js/yacy-ymarks-bookmark-actions.js">yacy-ymarks-bookmark-actions.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU-GPL-2.0-or-later</a></td>
<td><a href="/js/yacy-ymarks-bookmark-actions.js">yacy-ymarks-bookmark-actions.js</a></td>
</tr>
<tr>
<td><a href="/js/yacy-ymarks-tag-actions.js">yacy-ymarks-tag-actions.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU-GPL-2.0-or-later</a></td>
<td><a href="/js/yacy-ymarks-tag-actions.js">yacy-ymarks-tag-actions.js</a></td>
</tr>
<tr>
<td><a href="/js/yacy-ymarks.js">yacy-ymarks.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU-GPL-2.0-or-later</a></td>
<td><a href="/js/yacy-ymarks.js">yacy-ymarks.js</a></td>
</tr>
<tr>
<td><a href="/js/yacyinteractive.js">yacyinteractive.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU-GPL-2.0-or-later</a></td>
<td><a href="/js/yacyinteractive.js">yacyinteractive.js</a></td>
</tr>
<tr>
<td><a href="/js/yacysearch.js">yacysearch.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU-GPL-2.0-or-later</a></td>
<td><a href="/js/yacysearch.js">yacysearch.js</a></td>
</tr>
<tr>
<td><a href="/portalsearch/yacy-portalsearch.js">yacy-portalsearch.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/portalsearch/yacy-portalsearch.js">yacy-portalsearch.js</a></td>
</tr>
<tr>
<td><a href="/yacy/ui/js/jquery.colorpicker.js">jquery.colorpicker.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/yacy/ui/js/jquery.colorpicker.js">jquery.colorpicker.js</a></td>
</tr>
<tr>
<td><a href="/yacy/ui/js/jquery.dimensions.min.js">jquery.dimensions.min.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="https://raw.githubusercontent.com/johnantoni/jquery.dimensions/master/jquery.dimensions.js">jquery.dimensions.js</a></td>
</tr>
<tr>
<td><a href="/yacy/ui/js/jquery.tagcloud.js">jquery.tagcloud.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/yacy/ui/js/jquery.tagcloud.js">jquery.tagcloud.js</a></td>
</tr>
</table>
</body>
</html>

@ -0,0 +1,49 @@
// jslicense.java
// -----------------------
// (C) 2009 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
// first published 07.04.2005 on http://yacy.net
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// This File is contributed by luc
//
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
/**
* Produces YaCy JavaScript license information page (sse jslicense.html).
* @author luc
*
*/
public class jslicense {
/**
* @param header request headers
* @param post post parameters
* @param env server environment
*/
public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
return new serverObjects();
}
}

@ -99,6 +99,13 @@ http://<remote-server-address>:8090/ConfigAccounts_p.html
and set an administration account.
== CAN I RUN YACY IN A VIRTUAL MACHINE OR A CONTAINER ==
YaCy runs fine in virtual machines managed by software such as VirtualBox or VMware.
Container technology may be more flexible and lightweight and also works fine with YaCy.
More details for YaCy with Docker [[docker/Readme.md|here]].
== PORT 8090 IS BAD, PEOPLE ARE NOT ALLOWED TO ACCESS THAT PORT ==
You can forward port 80 to 8090 with iptables:

@ -67,6 +67,39 @@ public class HTMLResponseWriter implements QueryResponseWriter {
@Override
public void init(@SuppressWarnings("rawtypes") NamedList n) {
}
/**
* Append YaCy JavaScript license information to writer
* @param writer must be non null
* @throws IOException when a write error occured
*/
private void writeJSLicence(final Writer writer) throws IOException {
writer.write("<script>");
writer.write("/*");
writer.write("@licstart The following is the entire license notice for the");
writer.write("JavaScript code in this page.");
writer.write("");
writer.write("Copyright (C) 2013-2015 by Michael Peter Christen and reger");
writer.write("");
writer.write("The JavaScript code in this page is free software: you can redistribute it and/or");
writer.write("modify it under the terms of the GNU General Public License");
writer.write("as published by the Free Software Foundation; either version 2");
writer.write("of the License, or (at your option) any later version.");
writer.write("");
writer.write("This program is distributed in the hope that it will be useful,");
writer.write("but WITHOUT ANY WARRANTY; without even the implied warranty of");
writer.write("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the");
writer.write("GNU General Public License for more details.");
writer.write("");
writer.write("You should have received a copy of the GNU General Public License");
writer.write("along with this program; if not, write to the Free Software");
writer.write("Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.");
writer.write("");
writer.write("@licend The above is the entire license notice");
writer.write("for the JavaScript code in this page.");
writer.write("*/");
writer.write("</script>");
}
@Override
public void write(final Writer writer, final SolrQueryRequest request, final SolrQueryResponse rsp) throws IOException {
@ -84,6 +117,7 @@ public class HTMLResponseWriter implements QueryResponseWriter {
writer.write(" xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n");
writer.write(" xmlns:foaf=\"http://xmlns.com/foaf/0.1/\">\n");
writer.write("<head profile=\"http://www.w3.org/2003/g/data-view\">\n");
this.writeJSLicence(writer);
//writer.write("<link rel=\"transformation\" href=\"http://www-sop.inria.fr/acacia/soft/RDFa2RDFXML.xsl\"/>\n");
writer.write("<!-- Bootstrap core CSS -->\n");

@ -39,6 +39,7 @@ import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicInteger;
import net.yacy.cora.document.encoding.ASCII;
import net.yacy.cora.document.encoding.UTF8;
@ -49,6 +50,7 @@ import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.ResponseHeader;
import net.yacy.cora.protocol.http.HTTPClient;
import net.yacy.cora.util.CommonPattern;
import net.yacy.cora.util.ConcurrentLog;
@ -1093,4 +1095,65 @@ public final class SeedDB implements AlternativeDomainNames {
}
public void loadSeedListConcurrently(final String seedListFileURL, final AtomicInteger scc, final int timeout, final boolean checkAge) {
// uses the superseed to initialize the database with known seeds
Thread seedLoader = new Thread() {
@Override
public void run() {
// load the seed list
try {
DigestURL url = new DigestURL(seedListFileURL);
//final long start = System.currentTimeMillis();
final RequestHeader reqHeader = new RequestHeader();
reqHeader.put(HeaderFramework.PRAGMA, "no-cache");
reqHeader.put(HeaderFramework.CACHE_CONTROL, "no-cache, no-store");
final HTTPClient client = new HTTPClient(ClientIdentification.yacyInternetCrawlerAgent, timeout);
client.setHeader(reqHeader.entrySet());
client.HEADResponse(url.toNormalform(false), false);
int statusCode = client.getHttpResponse().getStatusLine().getStatusCode();
ResponseHeader header = new ResponseHeader(statusCode, client.getHttpResponse().getAllHeaders());
if (checkAge) {
if (header.lastModified() == null) {
Network.log.warn("BOOTSTRAP: seed-list URL " + seedListFileURL + " not usable, last-modified is missing");
return;
} else if ((header.age() > 86400000) && (scc.get() > 0)) {
Network.log.info("BOOTSTRAP: seed-list URL " + seedListFileURL + " too old (" + (header.age() / 86400000) + " days)");
return;
}
}
scc.incrementAndGet();
final byte[] content = client.GETbytes(url, null, null, false);
Iterator<String> enu = FileUtils.strings(content);
int lc = 0;
int uptodatec = 0, outdatedc = 0;
while (enu.hasNext()) {
try {
Seed ys = Seed.genRemoteSeed(enu.next(), false, null);
if ((ys != null) && (!mySeedIsDefined() || !mySeed().hash.equals(ys.hash))) {
final long lastseen = Math.abs((System.currentTimeMillis() - ys.getLastSeenUTC()) / 1000 / 60);
if (lastseen < 240) uptodatec++; else outdatedc++;
if ( lastseen < 240 || lc < 10 ) {
if (peerActions.connectPeer(ys, false) ) lc++;
}
}
} catch (final Throwable e ) {
Network.log.info("BOOTSTRAP: bad seed from " + seedListFileURL + ": " + e.getMessage());
}
}
Network.log.info("BOOTSTRAP: " + lc + " seeds from seed-list URL " + seedListFileURL + ", AGE=" + (header.age() / 3600000) + "h" + ", uptodatec = " + uptodatec + ", outdatedc = " + outdatedc);
} catch (final IOException e ) {
// this is when wget fails, commonly because of timeout
Network.log.info("BOOTSTRAP: failed (1) to load seeds from seed-list URL " + seedListFileURL + ": " + e.getMessage());
} catch (final Exception e ) {
// this is when wget fails; may be because of missing internet connection
Network.log.severe("BOOTSTRAP: failed (2) to load seeds from seed-list URL " + seedListFileURL + ": " + e.getMessage(), e);
}
}
};
seedLoader.start();
}
}

@ -3932,87 +3932,11 @@ public final class Switchboard extends serverSwitch {
}
c++;
if ( seedListFileURL.startsWith("http://") || seedListFileURL.startsWith("https://") ) {
loadSeedListConcurrently(this.peers, seedListFileURL, scc, (int) getConfigLong("bootstrapLoadTimeout", 20000), c > 0);
this.peers.loadSeedListConcurrently(seedListFileURL, scc, (int) getConfigLong("bootstrapLoadTimeout", 20000), c > 0);
}
}
}
private static void loadSeedListConcurrently(final SeedDB peers, final String seedListFileURL, final AtomicInteger scc, final int timeout, final boolean checkAge) {
// uses the superseed to initialize the database with known seeds
Thread seedLoader = new Thread() {
@Override
public void run() {
// load the seed list
try {
DigestURL url = new DigestURL(seedListFileURL);
//final long start = System.currentTimeMillis();
final RequestHeader reqHeader = new RequestHeader();
reqHeader.put(HeaderFramework.PRAGMA, "no-cache");
reqHeader.put(HeaderFramework.CACHE_CONTROL, "no-cache, no-store");
final HTTPClient client = new HTTPClient(ClientIdentification.yacyInternetCrawlerAgent, timeout);
client.setHeader(reqHeader.entrySet());
client.HEADResponse(url.toNormalform(false), false);
int statusCode = client.getHttpResponse().getStatusLine().getStatusCode();
ResponseHeader header = new ResponseHeader(statusCode, client.getHttpResponse().getAllHeaders());
if (checkAge) {
if ( header.lastModified() == null ) {
Network.log.warn("BOOTSTRAP: seed-list URL "
+ seedListFileURL
+ " not usable, last-modified is missing");
return;
} else if ( (header.age() > 86400000) && (scc.get() > 0) ) {
Network.log.info("BOOTSTRAP: seed-list URL "
+ seedListFileURL
+ " too old ("
+ (header.age() / 86400000)
+ " days)");
return;
}
}
scc.incrementAndGet();
final byte[] content = client.GETbytes(url, null, null, false);
Iterator<String> enu = FileUtils.strings(content);
int lc = 0;
while ( enu.hasNext() ) {
try {
Seed ys = Seed.genRemoteSeed(enu.next(), false, null);
if ( (ys != null)
&& (!peers.mySeedIsDefined() || !peers.mySeed().hash.equals(ys.hash)) ) {
final long lastseen = Math.abs((System.currentTimeMillis() - ys.getLastSeenUTC()) / 1000 / 60);
if ( lastseen < 1440 || lc < 10 ) {
if ( peers.peerActions.connectPeer(ys, false) ) {
lc++;
}
}
}
} catch (final Throwable e ) {
Network.log.info("BOOTSTRAP: bad seed from " + seedListFileURL + ": " + e.getMessage());
}
}
Network.log.info("BOOTSTRAP: "
+ lc
+ " seeds from seed-list URL "
+ seedListFileURL
+ ", AGE="
+ (header.age() / 3600000)
+ "h");
} catch (final IOException e ) {
// this is when wget fails, commonly because of timeout
Network.log.info("BOOTSTRAP: failed (1) to load seeds from seed-list URL "
+ seedListFileURL + ": " + e.getMessage());
} catch (final Exception e ) {
// this is when wget fails; may be because of missing internet connection
Network.log.severe("BOOTSTRAP: failed (2) to load seeds from seed-list URL "
+ seedListFileURL + ": " + e.getMessage(), e);
}
}
};
seedLoader.start();
}
public void initRemoteProxy() {
// reading the proxy host name
final String host = getConfig("remoteProxyHost", "").trim();

@ -0,0 +1,87 @@
package net.yacy.crawler;
import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import net.yacy.cora.document.id.DigestURL;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.crawler.retrieval.Request;
import net.yacy.crawler.robots.RobotsTxt;
import net.yacy.data.WorkTables;
import static net.yacy.kelondro.util.FileUtils.deletedelete;
import org.junit.Test;
import static org.junit.Assert.*;
public class HostBalancerTest {
final File queuesRoot = new File("test/DATA/INDEX/QUEUES");
final File datadir = new File("test/DATA");
/**
* Test of reopen existing HostBalancer cache to test/demonstrate issue with
* HostQueue for file: protocol
*/
@Test
public void testReopen() throws IOException, SpaceExceededException, InterruptedException {
boolean exceed134217727 = true;
int onDemandLimit = 1000;
String hostDir = "C:\\filedirectory";
// prepare one urls for push test
String urlstr = "file:///" + hostDir;
DigestURL url = new DigestURL(urlstr);
Request req = new Request(url, null);
deletedelete(queuesRoot); // start clean test
HostBalancer hb = new HostBalancer(queuesRoot, onDemandLimit, exceed134217727);
Thread.sleep(100); // wait for file operation
hb.clear();
Thread.sleep(100);
assertEquals("After clear", 0, hb.size());
WorkTables wt = new WorkTables(datadir);
RobotsTxt rob = new RobotsTxt(wt, null);
String res = hb.push(req, null, rob); // push url
assertNull(res); // should have no error text
assertTrue(hb.has(url.hash())); // check existence
assertEquals("first push of one url", 1, hb.size()); // expected size=1
res = hb.push(req, null, rob); // push same url (should be rejected = double occurence)
assertNotNull(res); // should state double occurrence
assertTrue(hb.has(url.hash()));
assertEquals("second push of same url", 1, hb.size());
hb.close(); // close
Thread.sleep(200); // wait a bit for file operation
hb = new HostBalancer(queuesRoot, onDemandLimit, exceed134217727); // reopen balancer
Thread.sleep(200); // wait a bit for file operation
assertEquals("size after reopen (with one existing url)", 1, hb.size()); // expect size=1 from previous push
assertTrue("check existance of pushed url", hb.has(url.hash())); // check url exists (it fails as after reopen internal queue.hosthash is wrong)
res = hb.push(req, null, rob); // push same url as before (should be rejected, but isn't due to hosthash mismatch afte reopen)
assertNotNull("should state double occurence", res);
assertEquals("first push of same url after reopen", 1, hb.size()); // should stay size=1
assertTrue("check existance of pushed url", hb.has(url.hash()));
res = hb.push(req, null, rob);
assertNotNull("should state double occurence", res);
assertTrue("check existance of pushed url", hb.has(url.hash()));
assertEquals("second push of same url after reopen", 1, hb.size()); // double check, should stay size=1
// list all urls in hostbalancer
Iterator<Request> it = hb.iterator();
while (it.hasNext()) {
Request rres = it.next();
System.out.println(rres.toString());
}
hb.close();
}
}
Loading…
Cancel
Save