Skip to content

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

in IntranetMode allow intranet hosted seedlist with Network_Domain "any" - so far intranet seedlist hosts are always denied but need to be allowed in intranet mode

reger350c6b8250b9
diff --git a/source/net/yacy/peers/Seed.java b/source/net/yacy/peers/Seed.java
index 5581dd65b..8493d24ed 100644
--- a/source/net/yacy/peers/Seed.java
+++ b/source/net/yacy/peers/Seed.java
@@ -581,7 +581,7 @@ public class Seed implements Cloneable, Comparable<Seed>, Comparator<Seed>
public final String getPublicAddress() {
String ip = getIP();
if (ip == null) ip = Domains.LOCALHOST; // that should not happen
-
+
int p = ip.lastIndexOf(':');
if (p > 0 && (ip.indexOf(':') == p || "]:".equals(ip.substring(p - 1, p + 1)))) return ip; // includes already the port
@@ -1117,7 +1117,15 @@ public class Seed implements Cloneable, Comparable<Seed>, Comparator<Seed>
final URL url = new URL(seedURL);
final String host = url.getHost();
if (Domains.isIntranet(host)) {
- return "seedURL in local network rejected";
+ // network.unit.domain = any returns isIntranet() always true (because noLocalCheck is set true)
+ // but seedlist on intranet host must be allowed -> check for intranet mode and deny "localhost" or loopback IP
+ if (Switchboard.getSwitchboard().isIntranetMode() ) {
+ if (Domains.isLocalhost(host)) {
+ return "seedURL on local host rejected ("+host+")";
+ }
+ } else {
+ return "seedURL in local network rejected ("+host+")";
+ }
}
} catch (final MalformedURLException e ) {
return "seedURL malformed";