updated libraries

pull/584/head
Michael Peter Christen 2 years ago
parent a348146d8f
commit 5afcba162b

@ -62,11 +62,10 @@ network.unit.bootstrap.seedlist3 = http://yacy.v16.de/seed/seed.txt
network.unit.bootstrap.seedlist4 = https://frank-siebert.de/seed.txt
network.unit.bootstrap.seedlist5 = http://seedlist.wertewesten.net/seed.txt
network.unit.bootstrap.seedlist6 = https://search.joestr.at/www/seed.txt
network.unit.bootstrap.seedlist7 = https://www.gumx.de:8091/seed.txt
network.unit.bootstrap.seedlist8 = https://aahso.net/yacyseed
network.unit.bootstrap.seedlist9 = https://lodwich.net/static/seeds/seed.txt
network.unit.bootstrap.seedlist10 = https://tonibot.ddns.net:8892/other/seed.txt
network.unit.bootstrap.seedlist11 = https://s1002.xpcom-online.de/yacy/seed2.txt
network.unit.bootstrap.seedlist7 = https://aahso.net/yacyseed
network.unit.bootstrap.seedlist8 = https://lodwich.net/static/seeds/seed.txt
network.unit.bootstrap.seedlist9 = https://tonibot.ddns.net:8892/other/seed.txt
network.unit.bootstrap.seedlist10 = https://s1002.xpcom-online.de/yacy/seed2.txt
# each network may use different yacy distributions.
# the auto-updater can access network-specific update locations

@ -16,9 +16,9 @@
<dependency org="com.google.guava" name="guava" rev="25.1-jre" conf="compile->master"/>
<dependency org="com.ibm.icu" name="icu4j" rev="63.1"/>
<dependency org="com.jcraft" name="jsch" rev="0.1.54" />
<dependency org="com.twelvemonkeys.imageio" name="imageio-core" rev="3.8.3"/>
<dependency org="com.twelvemonkeys.imageio" name="imageio-bmp" rev="3.8.3" />
<dependency org="com.twelvemonkeys.imageio" name="imageio-tiff" rev="3.8.3"/>
<dependency org="com.twelvemonkeys.imageio" name="imageio-core" rev="3.9.4"/>
<dependency org="com.twelvemonkeys.imageio" name="imageio-bmp" rev="3.9.4" />
<dependency org="com.twelvemonkeys.imageio" name="imageio-tiff" rev="3.9.4"/>
<dependency org="commons-codec" name="commons-codec" rev="1.15" />
<dependency org="commons-io" name="commons-io" rev="2.8.0" />
<dependency org="commons-logging" name="commons-logging" rev="1.2" />
@ -65,22 +65,22 @@
<dependency org="org.codehaus.woodstox" name="woodstox-core-asl" rev="4.4.1">
<exclude module="stax-api" />
</dependency>
<dependency org="org.eclipse.jetty" name="jetty-client" rev="9.4.41.v20210516" />
<dependency org="org.eclipse.jetty" name="jetty-deploy" rev="9.4.41.v20210516" conf="compile->master" />
<dependency org="org.eclipse.jetty" name="jetty-jmx" rev="9.4.41.v20210516" conf="compile->master"/>
<dependency org="org.eclipse.jetty" name="jetty-http" rev="9.4.41.v20210516"/>
<dependency org="org.eclipse.jetty" name="jetty-proxy" rev="9.4.41.v20210516"/>
<dependency org="org.eclipse.jetty" name="jetty-security" rev="9.4.41.v20210516"/>
<dependency org="org.eclipse.jetty" name="jetty-server" rev="9.4.41.v20210516"/>
<dependency org="org.eclipse.jetty" name="jetty-servlets" rev="9.4.41.v20210516"/>
<dependency org="org.eclipse.jetty" name="jetty-servlet" rev="9.4.41.v20210516">
<dependency org="org.eclipse.jetty" name="jetty-client" rev="9.4.51.v20230217" />
<dependency org="org.eclipse.jetty" name="jetty-deploy" rev="9.4.51.v20230217" conf="compile->master" />
<dependency org="org.eclipse.jetty" name="jetty-jmx" rev="9.4.51.v20230217" conf="compile->master"/>
<dependency org="org.eclipse.jetty" name="jetty-http" rev="9.4.51.v20230217"/>
<dependency org="org.eclipse.jetty" name="jetty-proxy" rev="9.4.51.v20230217"/>
<dependency org="org.eclipse.jetty" name="jetty-security" rev="9.4.51.v20230217"/>
<dependency org="org.eclipse.jetty" name="jetty-server" rev="9.4.51.v20230217"/>
<dependency org="org.eclipse.jetty" name="jetty-servlets" rev="9.4.51.v20230217"/>
<dependency org="org.eclipse.jetty" name="jetty-servlet" rev="9.4.51.v20230217">
<exclude module="jetty-util-ajax" />
</dependency>
<dependency org="org.eclipse.jetty" name="jetty-util" rev="9.4.41.v20210516" />
<dependency org="org.eclipse.jetty" name="jetty-webapp" rev="9.4.41.v20210516" />
<dependency org="org.eclipse.jetty.http2" name="http2-client" rev="9.4.41.v20210516" conf="compile->master"/>
<dependency org="org.eclipse.jetty.http2" name="http2-common" rev="9.4.41.v20210516" conf="compile->master"/>
<dependency org="org.eclipse.jetty.http2" name="http2-http-client-transport" rev="9.4.41.v20210516" conf="compile->master"/>
<dependency org="org.eclipse.jetty" name="jetty-util" rev="9.4.51.v20230217" />
<dependency org="org.eclipse.jetty" name="jetty-webapp" rev="9.4.51.v20230217" />
<dependency org="org.eclipse.jetty.http2" name="http2-client" rev="9.4.51.v20230217" conf="compile->master"/>
<dependency org="org.eclipse.jetty.http2" name="http2-common" rev="9.4.51.v20230217" conf="compile->master"/>
<dependency org="org.eclipse.jetty.http2" name="http2-http-client-transport" rev="9.4.51.v20230217" conf="compile->master"/>
<dependency org="org.jsoup" name="jsoup" rev="1.15.3" />
<dependency org="org.jwat" name="jwat-warc" rev="1.1.3" />
<dependency org="org.locationtech.spatial4j" name="spatial4j" rev="0.8"/>

@ -81,7 +81,7 @@ public class Domains {
private static Class<?> InetAddressLocatorClass;
private static Method InetAddressLocatorGetLocaleInetAddressMethod;
private static final Set<String> ccSLD_TLD = new HashSet<String>();
private static final Set<String> ccSLD_TLD = new HashSet<>();
private static final String PRESENT = "";
private static final String LOCALHOST_IPv4_PATTERN = "(127\\..*)";
private static final String LOCALHOST_IPv6_PATTERN = "((\\[?fe80\\:.*)|(\\[?0\\:0\\:0\\:0\\:0\\:0\\:0\\:1.*)|(\\[?\\:\\:1))(/.*|%.*|\\z)";
@ -103,11 +103,11 @@ public class Domains {
public static long cacheMiss_Hit = 0, cacheMiss_Miss = 0, cacheMiss_Insert = 0; // for statistics only; do not write
private static AtomicLong dnsRequests = new AtomicLong(0);
private static Set<InetAddress> myHostAddresses = new HashSet<InetAddress>();
private static Set<InetAddress> localHostAddresses = new HashSet<InetAddress>(); // subset of myHostAddresses
private static Set<InetAddress> publicIPv4HostAddresses = new HashSet<InetAddress>(); // subset of myHostAddresses
private static Set<InetAddress> publicIPv6HostAddresses = new HashSet<InetAddress>(); // subset of myHostAddresses
private static Set<String> localHostNames = new HashSet<String>(); // subset of myHostNames
private static Set<InetAddress> myHostAddresses = new HashSet<>();
private static Set<InetAddress> localHostAddresses = new HashSet<>(); // subset of myHostAddresses
private static Set<InetAddress> publicIPv4HostAddresses = new HashSet<>(); // subset of myHostAddresses
private static Set<InetAddress> publicIPv6HostAddresses = new HashSet<>(); // subset of myHostAddresses
private static Set<String> localHostNames = new HashSet<>(); // subset of myHostNames
private static Thread domaininit = null;
static {
localHostNames.add(LOCALHOST);
@ -118,7 +118,7 @@ public class Domains {
localHostNames.add(LOCALHOST_NAME);
try {
InetAddress localHostAddress = InetAddress.getLocalHost();
final InetAddress localHostAddress = InetAddress.getLocalHost();
if (localHostAddress != null) myHostAddresses.add(localHostAddress);
} catch (final UnknownHostException e) {}
try {
@ -126,7 +126,7 @@ public class Domains {
if (moreAddresses != null) myHostAddresses.addAll(Arrays.asList(moreAddresses));
} catch (final UnknownHostException e) {}
for (InetAddress a: myHostAddresses) {
for (final InetAddress a: myHostAddresses) {
if (a.isAnyLocalAddress() || a.isLinkLocalAddress() || a.isLoopbackAddress() || a.isSiteLocalAddress()) {
localHostAddresses.add(a);
}
@ -163,8 +163,8 @@ public class Domains {
// fill a cache of local host names
for (final InetAddress a: myHostAddresses) {
String hostaddressP = chopZoneID(a.getHostAddress());
Set<String> hns = new LinkedHashSet<>();
final String hostaddressP = chopZoneID(a.getHostAddress());
final Set<String> hns = new LinkedHashSet<>();
// generate alternative representations of IPv6 addresses which are needed to check access on the interface (i.e. localhost check)
if (hostaddressP.indexOf("::") < 0) {
hns.add(hostaddressP.replaceFirst(":0:0:0:0:0:0:", "::"));
@ -176,13 +176,13 @@ public class Domains {
}
hns.add(hostaddressP);
final String hostname = getHostName(a);
for (String hostaddress: hns) {
for (final String hostaddress: hns) {
if (hostaddress.contains("::0:") || hostaddress.contains(":0::")) continue; // not common (but possible); we skip that
// we write the local tests into variables to be able to debug these values
boolean isAnyLocalAddress = a.isAnyLocalAddress();
boolean isLinkLocalAddress = a.isLinkLocalAddress(); // true i.e. for localhost/fe80:0:0:0:0:0:0:1%1, myhost.local/fe80:0:0:0:223:dfff:fedf:30ce%7
boolean isLoopbackAddress = a.isLoopbackAddress(); // true i.e. for localhost/0:0:0:0:0:0:0:1, localhost/127.0.0.1
boolean isSiteLocalAddress = a.isSiteLocalAddress(); // true i.e. for myhost.local/192.168.1.33
final boolean isAnyLocalAddress = a.isAnyLocalAddress();
final boolean isLinkLocalAddress = a.isLinkLocalAddress(); // true i.e. for localhost/fe80:0:0:0:0:0:0:1%1, myhost.local/fe80:0:0:0:223:dfff:fedf:30ce%7
final boolean isLoopbackAddress = a.isLoopbackAddress(); // true i.e. for localhost/0:0:0:0:0:0:0:1, localhost/127.0.0.1
final boolean isSiteLocalAddress = a.isSiteLocalAddress(); // true i.e. for myhost.local/192.168.1.33
if (isAnyLocalAddress || isLinkLocalAddress || isLoopbackAddress || isSiteLocalAddress) {
ConcurrentLog.info("Domain Init", "local host address: " + hostaddress + " (local)");
localHostAddresses.add(a);
@ -197,6 +197,7 @@ public class Domains {
}
}
}
ConcurrentLog.info("Domain Init", "finished");
}
};
domaininit.start();
@ -681,7 +682,7 @@ public class Domains {
/**
* Map top-level domains (lower caes) to TLD category identifiers.
*/
private static Map<String, Integer> TLDID = new ConcurrentHashMap<String, Integer>();
private static Map<String, Integer> TLDID = new ConcurrentHashMap<>();
//private static HashMap<String, String> TLDName = new HashMap<String, String>();
private static void insertTLDProps(final String[] TLDList, final int id) {
@ -720,7 +721,7 @@ public class Domains {
insertTLDProps(TLD_MiddleEastWestAsia, TLD_MiddleEastWestAsia_ID);
insertTLDProps(TLD_NorthAmericaOceania, TLD_NorthAmericaOceania_ID);
insertTLDProps(TLD_Africa, TLD_Africa_ID);
for(GenericTLD tld : GenericTLD.values()) {
for(final GenericTLD tld : GenericTLD.values()) {
TLDID.put(tld.getDomainName(), TLD_Generic_ID);
}
/*
@ -729,12 +730,12 @@ public class Domains {
* be modified
*/
insertTLDProps(TLD_RecentCountryCodes, TLD_Generic_ID);
for(InternationalizedCountryCodeTLD tld : InternationalizedCountryCodeTLD.values()) {
for(final InternationalizedCountryCodeTLD tld : InternationalizedCountryCodeTLD.values()) {
TLDID.put(tld.getDomainName(), TLD_Generic_ID);
}
insertTLDProps(TLD_GenericRestricted, TLD_Generic_ID);
insertTLDProps(TLD_Infrastructure, TLD_Generic_ID);
for(SponsoredTLD tld : SponsoredTLD.values()) {
for(final SponsoredTLD tld : SponsoredTLD.values()) {
TLDID.put(tld.getDomainName(), TLD_Generic_ID);
}
@ -787,7 +788,7 @@ public class Domains {
host = host.toLowerCase(Locale.ROOT).trim();
// trying to resolve host by doing a name cache lookup
InetAddress ip = NAME_CACHE_HIT.get(host);
final InetAddress ip = NAME_CACHE_HIT.get(host);
if (ip != null) {
cacheHit_Hit++;
return ip;
@ -808,7 +809,7 @@ public class Domains {
public static List<Pattern> makePatterns(final String patternList) throws PatternSyntaxException {
final String[] entries = (patternList != null) ? CommonPattern.COMMA.split(patternList) : new String[0];
final List<Pattern> patterns = new ArrayList<Pattern>(entries.length);
final List<Pattern> patterns = new ArrayList<>(entries.length);
for (final String entry : entries) {
patterns.add(Pattern.compile(entry.trim()));
}
@ -902,7 +903,7 @@ public class Domains {
// extract the address (host:port) part (applies if this is an url)
int p = target.indexOf("://");
if (p > 0) {
String protocol = target.substring(0, p);
final String protocol = target.substring(0, p);
target = target.substring(p + 3);
if ("https".equals(protocol)) port = 443;
if ("ftp".equals(protocol)) port = 21;
@ -984,7 +985,7 @@ public class Domains {
//if (!matchesList(host, nameCacheNoCachingPatterns)) System.out.println("DNSLOOKUP " + host);
try {
//final long t = System.currentTimeMillis();
String oldName = Thread.currentThread().getName();
final String oldName = Thread.currentThread().getName();
Thread.currentThread().setName("Domains: DNS resolve of '" + host + "'"); // thread dump show which host is resolved
if (InetAddresses.isInetAddress(host)) {
try {
@ -996,10 +997,10 @@ public class Domains {
}
Thread.currentThread().setName(oldName);
if (ip == null) {
long activeRequests = dnsRequests.incrementAndGet();
final long activeRequests = dnsRequests.incrementAndGet();
if (activeRequests > 50) {
// throttle requests to remote DNS
try {Thread.sleep(10 * (activeRequests - 50));} catch (InterruptedException e) {}
try {Thread.sleep(10 * (activeRequests - 50));} catch (final InterruptedException e) {}
}
try {
ip = timeLimiter.callWithTimeout(new Callable<InetAddress>() {
@ -1094,9 +1095,9 @@ public class Domains {
public static Set<String> myPublicIPs() {
// use a LinkedHashSet to get an order of IPs where the IPv4 are preferred to get a better compatibility with older implementations
Set<String> h = new LinkedHashSet<>(publicIPv4HostAddresses.size() + publicIPv6HostAddresses.size());
for (InetAddress i: publicIPv4HostAddresses) h.add(i.getHostAddress());
for (InetAddress i: publicIPv6HostAddresses) h.add(i.getHostAddress());
final Set<String> h = new LinkedHashSet<>(publicIPv4HostAddresses.size() + publicIPv6HostAddresses.size());
for (final InetAddress i: publicIPv4HostAddresses) h.add(i.getHostAddress());
for (final InetAddress i: publicIPv6HostAddresses) h.add(i.getHostAddress());
return h;
}
@ -1128,14 +1129,14 @@ public class Domains {
}
public static Set<InetAddress> myIPv4IntranetIPs() {
Set<InetAddress> in = new HashSet<>();
for (InetAddress a: myIntranetIPs()) if (a instanceof Inet4Address) in.add(a);
final Set<InetAddress> in = new HashSet<>();
for (final InetAddress a: myIntranetIPs()) if (a instanceof Inet4Address) in.add(a);
return in;
}
public static Set<InetAddress> myIPv4IntranetNonLocalhostIPs() {
Set<InetAddress> in = new HashSet<>();
for (InetAddress a: myIPv4IntranetIPs()) if (((Inet4Address) a).getAddress()[0] != 127) in.add(a);
final Set<InetAddress> in = new HashSet<>();
for (final InetAddress a: myIPv4IntranetIPs()) if (((Inet4Address) a).getAddress()[0] != 127) in.add(a);
return in;
}
@ -1159,7 +1160,7 @@ public class Domains {
*/
public static boolean isThisHostIP(final Set<String> hostNames) {
if ((hostNames == null) || (hostNames.isEmpty())) return false;
for (String hostName: hostNames) {
for (final String hostName: hostNames) {
if (hostName.indexOf(':') > 0) return false; // IPv6 addresses do not count because they are always host IPs
if (isThisHostIP(Domains.dnsResolve(hostName))) return true;
}
@ -1182,8 +1183,8 @@ public class Domains {
return (isLocal(host, hostaddress)) ? TLD_Local_ID : TLD_Generic_ID;
}
public static String chopZoneID(String ip) {
int i = ip.indexOf('%');
public static String chopZoneID(final String ip) {
final int i = ip.indexOf('%');
return i < 0 ? ip : ip.substring(0, i);
}
@ -1305,11 +1306,7 @@ public class Domains {
if (isLocal(address.getHostAddress(), address, false)) return null;
try {
return (Locale) InetAddressLocatorGetLocaleInetAddressMethod.invoke(null, new Object[]{address});
} catch (final IllegalArgumentException e) {
return null;
} catch (final IllegalAccessException e) {
return null;
} catch (final InvocationTargetException e) {
} catch (final IllegalArgumentException | IllegalAccessException | InvocationTargetException e) {
return null;
}
}
@ -1323,11 +1320,11 @@ public class Domains {
*/
public static String getDNC(final String host) {
if (host == null || host.length() == 0) return "";
int p0 = host.lastIndexOf('.');
final int p0 = host.lastIndexOf('.');
if (p0 < 0) return host.toLowerCase(Locale.ROOT);
int p1 = host.lastIndexOf('.', p0 - 1);
final int p1 = host.lastIndexOf('.', p0 - 1);
if (p1 < 0) return host.substring(p0 + 1).toLowerCase(Locale.ROOT);
String ccSLDTLD = host.substring(p1 + 1).toLowerCase(Locale.ROOT);
final String ccSLDTLD = host.substring(p1 + 1).toLowerCase(Locale.ROOT);
return ccSLD_TLD.contains(ccSLDTLD) ? ccSLDTLD : host.substring(p0 + 1).toLowerCase(Locale.ROOT);
}
@ -1337,16 +1334,16 @@ public class Domains {
* @param host
* @return the SLD or the Third Level Domain, if the SLD is a ccSLD
*/
public static String getSmartSLD(String host) {
public static String getSmartSLD(final String host) {
if (host == null || host.length() == 0) return "";
int p0 = host.lastIndexOf('.');
final int p0 = host.lastIndexOf('.');
if (p0 < 0) return host.toLowerCase(Locale.ROOT); // no subdomain present
int p1 = host.lastIndexOf('.', p0 - 1);
final int p1 = host.lastIndexOf('.', p0 - 1);
if (p1 < 0) return host.substring(0, p0).toLowerCase(Locale.ROOT); // no third-level domain present, just use the second level
String ccSLDTLD = host.substring(p1 + 1).toLowerCase(Locale.ROOT);
final String ccSLDTLD = host.substring(p1 + 1).toLowerCase(Locale.ROOT);
if (!ccSLD_TLD.contains(ccSLDTLD)) return host.substring(p1 + 1, p0).toLowerCase(Locale.ROOT); // because the ccSLDTLD is not contained in the list of knwon ccSDL, we use the SLD from p1 to p0
// the third level domain is the correct one
int p2 = host.lastIndexOf('.', p1 - 1);
final int p2 = host.lastIndexOf('.', p1 - 1);
if (p2 < 0) return host.substring(0, p1).toLowerCase(Locale.ROOT);
return host.substring(p2 + 1, p1);
}

Loading…
Cancel
Save