Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fix "add to blacklist" button style in IndexControlRWIs_p - added default filename filter to select field (as only addition to *.black list is permanent)
regerdd8ea0cdd670
diff --git a/htroot/Blacklist_p.html b/htroot/Blacklist_p.htmlindex dc2440f21..b12af348d 100644--- a/htroot/Blacklist_p.html+++ b/htroot/Blacklist_p.html@@ -26,11 +26,14 @@You may also provide your blacklist to other peers by sharing them; in return you maycollect blacklist entries from other peers.</p>- <h3>Active list: #(disabled)#<em>#[currentBlacklist]#</em>::<span class="error">No blacklist selected</span>#(/disabled)#</h3>- <p>Used Blacklist engine: <span class="settingsValue">#[blacklistEngine]#</span></p>+ <h3>Active list: #(disabled)#+ #{blackLists}#+ [ <em>#[name]#</em> ] + #{/blackLists}#+ ::<span class="error">No blacklist selected</span>#(/disabled)#</h3><!-- blacklist selection --><fieldset class="selectList">- <legend>Select list:</legend>+ <legend>Select list to edit:</legend>#(disabled)#<form id="selectListName" action="Blacklist_p.html" method="post" enctype="multipart/form-data"><fieldset><select name="selectedListName" size="1" onchange="document.getElementById('selectListName').submit();">@@ -63,7 +66,7 @@<br /><br />#(disabled)#<fieldset class="editList">- <legend>Edit this list</legend>+ <legend>Edit list <b><em>#[currentBlacklist]#</em></b></legend><!-- Blacklist configuration -->#(edit)#diff --git a/htroot/Blacklist_p.java b/htroot/Blacklist_p.javaindex 0f1fb8f56..caec70a9b 100644--- a/htroot/Blacklist_p.java+++ b/htroot/Blacklist_p.java@@ -31,11 +31,9 @@import java.io.File;import java.io.IOException;-import java.net.MalformedURLException;import java.util.Arrays;import java.util.List;-import net.yacy.cora.document.id.DigestURL;import net.yacy.cora.protocol.HeaderFramework;import net.yacy.cora.protocol.RequestHeader;import net.yacy.cora.util.ConcurrentLog;@@ -64,53 +62,12 @@ public class Blacklist_p {String blacklistToUse = null;final serverObjects prop = new serverObjects();- prop.putHTML("blacklistEngine", Blacklist.getEngineInfo());// do all post operationsif (post != null) {final String action = post.get("action", "");- if(post.containsKey("testList")) {- prop.put("testlist", "1");- String urlstring = post.get("testurl", "");- if (!urlstring.startsWith("http://") &&- !urlstring.startsWith("https://") &&- !urlstring.startsWith("ftp://") &&- !urlstring.startsWith("smb://") &&- !urlstring.startsWith("file://")) {- urlstring = "http://"+urlstring;- }- DigestURL testurl;- try {- testurl = new DigestURL(urlstring);- } catch (final MalformedURLException e) {- testurl = null;- }- if(testurl != null) {- prop.putHTML("testlist_url",testurl.toString());- if (Switchboard.urlBlacklist.isListed(BlacklistType.CRAWLER, testurl)) {- prop.put("testlist_listedincrawler", "1");- }- if (Switchboard.urlBlacklist.isListed(BlacklistType.DHT, testurl)) {- prop.put("testlist_listedindht", "1");- }- if (Switchboard.urlBlacklist.isListed(BlacklistType.NEWS, testurl)) {- prop.put("testlist_listedinnews", "1");- }- if (Switchboard.urlBlacklist.isListed(BlacklistType.PROXY, testurl)) {- prop.put("testlist_listedinproxy", "1");- }- if (Switchboard.urlBlacklist.isListed(BlacklistType.SEARCH, testurl)) {- prop.put("testlist_listedinsearch", "1");- }- if (Switchboard.urlBlacklist.isListed(BlacklistType.SURFTIPS, testurl)) {- prop.put("testlist_listedinsurftips", "1");- }- } else {- prop.put("testlist_url","not valid");- }- }if (post.containsKey("selectList")) {blacklistToUse = post.get("selectedListName");if (blacklistToUse != null && blacklistToUse.isEmpty()) {diff --git a/htroot/IndexControlRWIs_p.html b/htroot/IndexControlRWIs_p.htmlindex 4091bbb9c..4637e5e61 100644--- a/htroot/IndexControlRWIs_p.html+++ b/htroot/IndexControlRWIs_p.html@@ -255,8 +255,8 @@</select></dt><dd>- <input type="submit" value="Add selected URLs to blacklist" name="blacklisturls class="submitready" style="width:240px;"/><br />- <input type="submit" value="Add selected domains to blacklist" name="blacklistdomains" class="submitready" style="width:240px;"/>+ <input type="submit" value="Add selected URLs to blacklist" name="blacklisturls" class="submitready" style="width:240px;"/><br />+ <input type="submit" value="Add selected domains to blacklist" name="blacklistdomains" class="submitready" style="width:240px; margin-top: 5px;"/></dd></dl></fieldset>diff --git a/htroot/IndexControlRWIs_p.java b/htroot/IndexControlRWIs_p.javaindex 2f298d08c..7dead7440 100644--- a/htroot/IndexControlRWIs_p.java+++ b/htroot/IndexControlRWIs_p.java@@ -58,6 +58,7 @@ import net.yacy.kelondro.util.FileUtils;import net.yacy.peers.DHTSelection;import net.yacy.peers.Protocol;import net.yacy.peers.Seed;+import net.yacy.repository.Blacklist;import net.yacy.repository.Blacklist.BlacklistType;import net.yacy.search.Switchboard;import net.yacy.search.SwitchboardConstants;@@ -524,7 +525,7 @@ public class IndexControlRWIs_p {prop.put("genUrlList_urlList", i);prop.putHTML("genUrlList_keyString", keystring);prop.put("genUrlList_count", i);- putBlacklists(prop, FileUtils.getDirListing(ListManager.listsPath));+ putBlacklists(prop, FileUtils.getDirListing(ListManager.listsPath, Blacklist.BLACKLIST_FILENAME_FILTER));}}diff --git a/locales/de.lng b/locales/de.lngindex 92cee0f6a..093f41de3 100644--- a/locales/de.lng+++ b/locales/de.lng@@ -82,9 +82,9 @@ This function provides an URL filter to the proxy; any blacklisted URL is blockefrom being loaded. You can define several blacklists and activate them separately.==Sie können mehrere Blacklists anlegen und getrennt aktivieren.You may also provide your blacklist to other peers by sharing them; in return you may==Sie können ebenfalls Ihre Blacklist einem anderen Peer zum Download anbieten.collect blacklist entries from other peers.==Im Gegenzug können Sie sich selber von anderen Peers Blacklists runterladen.-Active list:==Aktivierte Liste:+Active list:==Aktive Liste(n):No blacklist selected==Keine Blacklist gewählt-Select list:==Liste auswählen:+Select list to edit:==Liste auswählen:not shared::shared==nicht freigegeben::freigegeben"select"=="wählen"Create new list:==Neue Liste anlegen:@@ -93,7 +93,7 @@ Settings for this list==Einstellungen dieser Liste"Save"=="Speichern"Share/don't share this list==Liste freigeben/nicht freigebenDelete this list==Liste löschen-Edit this list==Diese Liste bearbeiten+Edit list==Bearbeite ListeThese are the domain name/path patterns in==Dies sind die Domainnamen/-pfade inBlacklist Pattern==BlacklisteintragEdit selected pattern\(s\)==Bearbeite gewählten Eintragdiff --git a/source/net/yacy/peers/Protocol.java b/source/net/yacy/peers/Protocol.javaindex 4d7534c5a..aa9619390 100644--- a/source/net/yacy/peers/Protocol.java+++ b/source/net/yacy/peers/Protocol.java@@ -759,7 +759,7 @@ public final class Protocol {if ( urlEntry.hash().length != 12 ) {continue; // bad url hash}- if ( blacklist.isListed(BlacklistType.SEARCH, urlEntry) ) {+ if ( blacklist.isListed(BlacklistType.SEARCH, urlEntry.url()) ) {if ( Network.log.isInfo() ) {Network.log.info("remote search: filtered blacklisted url " + urlEntry.url() + " from peer " + target.getName());}@@ -1122,7 +1122,7 @@ public final class Protocol {}URIMetadataNode urlEntry = new URIMetadataNode(doc);- if ( blacklist.isListed(BlacklistType.SEARCH, urlEntry) ) {+ if ( blacklist.isListed(BlacklistType.SEARCH, urlEntry.url()) ) {if ( Network.log.isInfo() ) {if (localsearch) {Network.log.info("local search (solr): filtered blacklisted url " + urlEntry.url());diff --git a/source/net/yacy/search/query/SearchEvent.java b/source/net/yacy/search/query/SearchEvent.javaindex 483b1aab1..f0f538cfd 100644--- a/source/net/yacy/search/query/SearchEvent.java+++ b/source/net/yacy/search/query/SearchEvent.java@@ -1059,7 +1059,7 @@ public final class SearchEvent {}// Check for blacklist- if (Switchboard.urlBlacklist.isListed(BlacklistType.SEARCH, page)) {+ if (Switchboard.urlBlacklist.isListed(BlacklistType.SEARCH, page.url())) {if (log.isFine()) log.fine("dropped RWI: url is blacklisted in url blacklist");if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet();continue;