Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

- removed unused network oanet - added new network definition 'allip' which can be used in networks where intranet and internet-addresses shall be indexed - added a auto-switch-off for global search if there are no global peers

orbiter171f2bd84ee5
diff --git a/defaults/yacy.network.allip.unit b/defaults/yacy.network.allip.unit
new file mode 100644
index 000000000..521e78195
--- /dev/null
+++ b/defaults/yacy.network.allip.unit
@@ -0,0 +1,26 @@
+# Network definition file to grant all IPs as search domain
+
+# general network definition
+network.unit.name = allip
+network.unit.description = Intranet and Internet Search Portal
+network.unit.domain = any
+network.unit.dht = false
+network.unit.dhtredundancy.junior = 1
+network.unit.dhtredundancy.senior = 1
+network.unit.dht.partitionExponent = 0
+network.unit.remotecrawl.speed = 600
+
+# each network may use different yacy distributions.
+# the auto-updater can access network-specific update locations
+network.unit.update.location0 = http://yacy.net/index.html
+network.unit.update.location1 = http://latest.yacy.de
+network.unit.update.location2 = http://www.yacystats.de/yacybuild/
+network.unit.update.location2.key = MIIBtTCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BYHPUCgYEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYIAAn8bzmhk8EWOj9h+7zng1o3OlgI+LsG7lI7kVsDxyzMB/WYTpO+NKWoibFjQDFN92TKBQVAA8DQciHfolqcFfVAot9/3ipamXVGz29OAxz8i0Wty6KI6w50YrL2xAkWjx7jSBghJKlnKx3V0PaDCWqz37ogQvuxLKBFORyAjbv3O
+network.unit.update.location3 = https://latestyacy.f1ori.de/
+
+# 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 =
\ No newline at end of file
diff --git a/defaults/yacy.network.oanet.unit b/defaults/yacy.network.oanet.unit
deleted file mode 100644
index 242590c3a..000000000
--- a/defaults/yacy.network.oanet.unit
+++ /dev/null
@@ -1,20 +0,0 @@
-# Network definition file for the oanet network
-
-network.unit.name = oanet
-network.unit.description = Open Access Community
-network.unit.domain = global
-network.unit.search.time = 4
-network.unit.dht = false
-network.unit.dhtredundancy.junior = 1
-network.unit.dhtredundancy.senior = 1
-network.unit.dht.partitionExponent = 0
-network.unit.remotecrawl.speed = 6
-network.unit.bootstrap.seedlist0 = http://yacy.dyndns.org:1519/www/seed.txt
-
-network.unit.update.location0 = http://yacy.net/index.html
-network.unit.update.location1 = http://latest.yacy.de
-
-network.unit.protocol.control = uncontrolled
-
-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 =
\ No newline at end of file
diff --git a/defaults/yacy.network.webportal.unit b/defaults/yacy.network.webportal.unit
index 8eefc5349..681d1eacc 100644
--- a/defaults/yacy.network.webportal.unit
+++ b/defaults/yacy.network.webportal.unit
@@ -4,7 +4,7 @@
# general network definition
network.unit.name = webportal
-network.unit.description = Personal Web Portal
+network.unit.description = Personal Web Search Portal
network.unit.domain = global
network.unit.search.time = 4
network.unit.dht = false
diff --git a/defaults/yacy.networks b/defaults/yacy.networks
index a5054c660..371700566 100644
--- a/defaults/yacy.networks
+++ b/defaults/yacy.networks
@@ -1,4 +1,4 @@
defaults/yacy.network.freeworld.unit
defaults/yacy.network.webportal.unit
defaults/yacy.network.intranet.unit
-defaults/yacy.network.oanet.unit
\ No newline at end of file
+defaults/yacy.network.allip.unit
\ No newline at end of file
diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java
index 803b64dbf..f221a9e21 100644
--- a/htroot/yacysearch.java
+++ b/htroot/yacysearch.java
@@ -168,7 +168,7 @@ public class yacysearch {
int itemsPerPage = Math.min((authenticated) ? (snippetFetchStrategy.isAllowedToFetchOnline() ? 100 : 1000) : (snippetFetchStrategy.isAllowedToFetchOnline() ? 10 : 100), post.getInt("maximumRecords", post.getInt("count", 10))); // SRU syntax with old property as alternative
int offset = (newsearch) ? 0 : post.getInt("startRecord", post.getInt("offset", 0));
- boolean global = post.get("resource", "local").equals("global");
+ boolean global = post.get("resource", "local").equals("global") && sb.peers.sizeConnected() > 0;
final boolean indexof = (post != null && post.get("indexof","").equals("on"));
String urlmask = null;
diff --git a/source/de/anomic/crawler/CrawlStacker.java b/source/de/anomic/crawler/CrawlStacker.java
index 6395b56fe..6feccccf8 100644
--- a/source/de/anomic/crawler/CrawlStacker.java
+++ b/source/de/anomic/crawler/CrawlStacker.java
@@ -362,8 +362,8 @@ public final class CrawlStacker {
//boolean local = hostAddress.isSiteLocalAddress() || hostAddress.isLoopbackAddress();
//assert local == yacyURL.isLocalDomain(url.hash()); // TODO: remove the dnsResolve above!
return (local) ?
- ("the host '" + host + "' is local, but local addresses are not accepted") :
- ("the host '" + host + "' is global, but global addresses are not accepted");
+ ("the host '" + host + "' is local, but local addresses are not accepted: " + Domains.dnsResolve(host).getHostAddress()) :
+ ("the host '" + host + "' is global, but global addresses are not accepted: " + Domains.dnsResolve(host).getHostAddress());
}
public String urlInAcceptedDomainHash(final byte[] urlhash) {
diff --git a/source/de/anomic/search/SearchEvent.java b/source/de/anomic/search/SearchEvent.java
index 7816611ae..2e1dbae11 100644
--- a/source/de/anomic/search/SearchEvent.java
+++ b/source/de/anomic/search/SearchEvent.java
@@ -108,10 +108,10 @@ public final class SearchEvent {
this.IAneardhthash = null;
this.localSearchThread = null;
this.order = new ReferenceOrder(query.ranking, query.targetlang);
-
+ boolean remote = (query.domType == QueryParams.SEARCHDOM_GLOBALDHT) || (query.domType == QueryParams.SEARCHDOM_CLUSTERALL);
+ if (remote && peers.sizeConnected() == 0) remote = false;
final long start = System.currentTimeMillis();
- if ((query.domType == QueryParams.SEARCHDOM_GLOBALDHT) ||
- (query.domType == QueryParams.SEARCHDOM_CLUSTERALL)) {
+ if (remote) {
final int fetchpeers = 12;
// initialize a ranking process that is the target for data
diff --git a/source/net/yacy/yacy.java b/source/net/yacy/yacy.java
index c62e5d3fc..3a7020acc 100644
--- a/source/net/yacy/yacy.java
+++ b/source/net/yacy/yacy.java
@@ -405,6 +405,7 @@ public final class yacy {
server.terminate(false);
server.interrupt();
server.close();
+ /*
if (server.isAlive()) try {
// TODO only send request, don't read response (cause server is already down resulting in error)
final DigestURI u = new DigestURI((server.withSSL()?"https":"http")+"://localhost:" + serverCore.getPortNr(port), null);
@@ -413,6 +414,7 @@ public final class yacy {
} catch (final IOException ee) {
Log.logConfig("SHUTDOWN", "termination signal to server socket missed (server shutdown, ok)");
}
+ */
Client.closeAllConnections();
MultiThreadedHttpConnectionManager.shutdownAll();