Merge branch 'master' of git@github.com:yacy/yacy_search_server.git

pull/461/head
Michael Peter Christen 3 years ago
commit 52fe2ed8ba

2
.gitignore vendored

@ -27,4 +27,6 @@ source/net/yacy/peers/operation/yacyBuildProperties.java
*.iws
/out/
/.settings/
/.classpath
/.project

@ -1 +0,0 @@
yacycore

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="1.8" />
</component>
</project>

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenRepo" />
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
</component>
</project>

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
</component>
</project>

@ -1,100 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=ignore
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.8

@ -1,54 +0,0 @@
cleanup.add_default_serial_version_id=true
cleanup.add_generated_serial_version_id=false
cleanup.add_missing_annotations=true
cleanup.add_missing_deprecated_annotations=true
cleanup.add_missing_methods=true
cleanup.add_missing_nls_tags=false
cleanup.add_missing_override_annotations=true
cleanup.add_missing_override_annotations_interface_methods=true
cleanup.add_serial_version_id=false
cleanup.always_use_blocks=true
cleanup.always_use_parentheses_in_expressions=false
cleanup.always_use_this_for_non_static_field_access=true
cleanup.always_use_this_for_non_static_method_access=true
cleanup.convert_to_enhanced_for_loop=true
cleanup.correct_indentation=false
cleanup.format_source_code=false
cleanup.format_source_code_changes_only=false
cleanup.make_local_variable_final=true
cleanup.make_parameters_final=true
cleanup.make_private_fields_final=true
cleanup.make_type_abstract_if_missing_method=false
cleanup.make_variable_declarations_final=true
cleanup.never_use_blocks=false
cleanup.never_use_parentheses_in_expressions=true
cleanup.organize_imports=false
cleanup.qualify_static_field_accesses_with_declaring_class=true
cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
cleanup.qualify_static_member_accesses_with_declaring_class=true
cleanup.qualify_static_method_accesses_with_declaring_class=true
cleanup.remove_private_constructors=true
cleanup.remove_trailing_whitespaces=true
cleanup.remove_trailing_whitespaces_all=true
cleanup.remove_trailing_whitespaces_ignore_empty=false
cleanup.remove_unnecessary_casts=true
cleanup.remove_unnecessary_nls_tags=true
cleanup.remove_unused_imports=true
cleanup.remove_unused_local_variables=false
cleanup.remove_unused_private_fields=true
cleanup.remove_unused_private_members=false
cleanup.remove_unused_private_methods=true
cleanup.remove_unused_private_types=true
cleanup.sort_members=false
cleanup.sort_members_all=false
cleanup.use_blocks=true
cleanup.use_blocks_only_for_return_and_throw=false
cleanup.use_parentheses_in_expressions=false
cleanup.use_this_for_non_static_field_access=true
cleanup.use_this_for_non_static_field_access_only_if_necessary=false
cleanup.use_this_for_non_static_method_access=true
cleanup.use_this_for_non_static_method_access_only_if_necessary=false
cleanup_profile=_yacy
cleanup_settings_version=2
eclipse.preferences.version=1

@ -1,11 +0,0 @@
DELEGATES_PREFERENCE=delegateValidatorList
USER_BUILD_PREFERENCE=enabledBuildValidatorList
USER_MANUAL_PREFERENCE=enabledManualValidatorList
USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.800.v201904082137
eclipse.preferences.version=1
override=true
suspend=false
vals/org.eclipse.wst.dtd.core.dtdDTDValidator/global=FF01
vals/org.eclipse.wst.xml.core.xml/global=FF03
vals/org.eclipse.wst.xsd.core.xsd/global=FF02162org.eclipse.wst.xsd.core.internal.validation.eclipse.Validator
vf.version=3

@ -183,7 +183,7 @@ git clone https://github.com/yacy/yacy_search_server
```
Compiling YaCy:
- You need Java 1.8 or later and [Gradle](https://gradle.org/).
- You need Java 1.8 or later and [Gradle](https://gradle.org/) (Gradle is downloaded automatically on first build if not present).
- Compile: `gradlew build` - then you can `./startYACY.sh` or `./startYACY.bat`.
- Create a release tarball and zip archive: `gradlew packageDist`.
- Create a Windows installer release exe: `gradlew distWinInstaller`.

@ -51,7 +51,7 @@ java.sourceCompatibility = JavaVersion.VERSION_1_8
java.targetCompatibility = JavaVersion.VERSION_1_8
mainClassName = "net.yacy.yacy"
applicationDefaultJvmArgs = ["-Xmx1024m"]
// applicationDefaultJvmArgs = ["-Xmx1024m"] // // limit memory use (below gradle default)
// create property store for filterTokens (here, to make sure it exist)
project.ext.filterTokens = new Properties()
@ -92,8 +92,8 @@ dependencies {
implementation group: 'com.google.guava', name: 'guava', version: '31.0.1-jre'
implementation group: 'com.hazelcast', name: 'hazelcast', version: '4.2'
implementation group: 'com.ibm.icu', name: 'icu4j', version: '63.1'
implementation group: 'com.twelvemonkeys.imageio', name: 'imageio-bmp', version: '3.3.2'
implementation group: 'com.twelvemonkeys.imageio', name: 'imageio-tiff',version: '3.3.2'
implementation group: 'com.twelvemonkeys.imageio', name: 'imageio-bmp', version: '3.8.1'
implementation group: 'com.twelvemonkeys.imageio', name: 'imageio-tiff',version: '3.8.1'
implementation group: 'net.jthink', name: 'jaudiotagger', version: '2.2.5'
implementation group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'
implementation group: 'net.sourceforge.jchardet', name: 'jchardet', version: '1.0'
@ -139,7 +139,6 @@ configurations.implementation {
// output to lib/yacycore.jar (like with ant with downside by determine class-path)
jar {
archiveFileName = 'yacycore.jar'
destinationDirectory = new File('lib')
manifest {
attributes(
"Main-Class": mainClassName ,
@ -187,7 +186,7 @@ compileJava.dependsOn(prepYaCyProperties) // must be executed before compile (du
// implement ant task to simulate old Ant build for htroot,
// to avoid import of complete build.xml (as currently used)
task compileHtrootServlets (dependsOn: ['jar']) {
if (file('lib/yacycore.jar').exists()) { // prevent buildscript failing on prime build with fresh git clone due to javac error during gradle init
if (file(jar.archiveFile).exists()) { // prevent buildscript failing on prime build with fresh git clone due to javac error during gradle init
ant {
path(id:'project.class.path') {
// place yacycore.jar on classpath (not automatically done)
@ -263,7 +262,7 @@ distributions {
contents { // fyi: content completed by copyFilesToDistDir
from "${buildDir}/RELEASE/MAIN"
exclude 'lib/*.jar'
exclude "lib/**" // lib dir is only for packageDist created
// define unix/linux file permission
eachFile { file ->
if(file.getName().endsWith(".sh")) {
@ -314,7 +313,7 @@ task packageDistZip (type : Zip, dependsOn : ['copyDependenciesForDistribution',
String Dst = project.ext.filterTokens.get('REPL_DATE')
String rNr = project.ext.filterTokens.get('REPL_REVISION_NR')
String branch = project.ext.filterTokens.get('branch')
String destName = 'yacy' + branch + '_v' + version + '_' + Dst + '_' + rNr + '.' + archiveExtension.get()
String destName = 'yacy' + branch + '_v' + project.version + '_' + Dst + '_' + rNr + '.' + archiveExtension.get()
archiveFileName = destName
destinationDirectory = layout.buildDirectory.dir('distributions/legacyDistFiles')
@ -345,7 +344,7 @@ task packageDistTar (type : Tar, dependsOn : ['copyDependenciesForDistribution',
}
// wrapper to create legacy distribution archives
task packageDist (dependsOn : ['copyDependenciesForDistribution','packageDistZip','packageDistTar'],group:'distribution') {
task packageDist (dependsOn : ['packageDistZip','packageDistTar'],group:'distribution') {
description 'Create legacy distribution tar.gz and zip archives'
// do a late copy of dependencies to dist lib directory to not interfere with standard distZip
// which includes the lib (and bin) directory by default (task copyDependenciesForDistribution)

@ -240,7 +240,7 @@ public class Blacklist_p {
WorkTables.TABLE_API_TYPE_CONFIGURATION,
"add to blacklist '" + blacklistToUse + "': " + blentry);
if(!BlacklistHelper.addBlacklistEntry(blacklistToUse, blentry, header)) {
if(!BlacklistHelper.addBlacklistEntry(blacklistToUse, blentry)) {
prop.put(DISABLED + EDIT + "addError", true);
prop.put(DISABLED + EDIT + "addError_entry", blentry);
}
@ -281,7 +281,7 @@ public class Blacklist_p {
return prop;
}
if (!BlacklistHelper.addBlacklistEntry(targetBlacklist, selectedBlacklistEntry, header)) {
if (!BlacklistHelper.addBlacklistEntry(targetBlacklist, selectedBlacklistEntry)) {
prop.put(DISABLED + EDIT + "moveError", true);
break;
}
@ -322,7 +322,7 @@ public class Blacklist_p {
if (!normalizeEntry(selectedEntry.getValue()).equals(preparedNewEntry)) {
/* Add first, to detect any eventual syntax errors before removing the old entry */
if (!BlacklistHelper.addBlacklistEntry(blacklistToUse, editedEntryValue, header)) {
if (!BlacklistHelper.addBlacklistEntry(blacklistToUse, editedEntryValue)) {
selected2EditedErrors.put(selectedEntry.getValue(), editedEntryValue);
} else if ((temp = BlacklistHelper.deleteBlacklistEntry(blacklistToUse, selectedEntry.getValue(), header)) != null) {
prop.put(serverObjects.ACTION_LOCATION, temp);

@ -166,9 +166,17 @@ var solr= $.getJSON("solr/collection1/select?q=*:*&start=0&rows=0&wt=json&facet=
#(/hostanalysis)#
#(files)#::
<fieldset><legend>Browser for <a href="#[path]#" target="_blank">#[path]#</a></legend>
<p>documents stored for host: #[hostsize]#; documents stored for subpath: #[subpathloadsize]#; unloaded documents detected in subpath: #[subpathdetectedsize]# <!-- #(complete)#;<a href="IndexBrowser_p.html?complete=true&path=#[path]#">get complete list</a>::<a href="IndexBrowser_p.html?path=#[path]#">directory view</a>#(/complete)#-->
</p>
<fieldset>
<legend style="display: inline">Browser for <a href="#[path]#" target="_blank">#[path]#</a>
<span style="padding-left: 25px">
<form style="display: inline" action="IndexBrowser_p.html?path=#[path]#" id="searchform" method="get" role="search">
<button type="submit" name="addtoblacklist" class="btn btn-xs btn-default">Add to blacklist</button>
<input type="text" name="path" value="#[path]#" hidden="true"/>
</form>
</span>
</legend>
<p>documents stored for host: #[hostsize]#; documents stored for subpath: #[subpathloadsize]#; unloaded documents detected in subpath: #[subpathdetectedsize]# <!-- #(complete)#;<a href="IndexBrowser_p.html?complete=true&path=#[path]#">get complete list</a>::<a href="IndexBrowser_p.html?path=#[path]#">directory view</a>#(/complete)#-->
</p>
<table class="sortable" style="float:left; border-width: 0">
<thead>
<tr>

@ -18,6 +18,7 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;
@ -58,6 +59,8 @@ import net.yacy.crawler.data.NoticedURL.StackType;
import net.yacy.crawler.retrieval.Request;
import net.yacy.kelondro.data.meta.URIMetadataNode;
import net.yacy.peers.graphics.WebStructureGraph.StructureEntry;
import net.yacy.repository.Blacklist;
import static net.yacy.repository.BlacklistHelper.addBlacklistEntry;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.search.index.Fulltext;
@ -653,6 +656,17 @@ public class IndexBrowser_p {
} catch (final Throwable e) {
ConcurrentLog.logException(e);
}
// for addtoblacklist button
if (post.containsKey("addtoblacklist") && sb != null) {
final File blacklistsPath = sb.getDataPath(SwitchboardConstants.LISTS_PATH, SwitchboardConstants.LISTS_PATH_DEFAULT);
String blacklistname = Blacklist.defaultBlacklist(blacklistsPath);
if (blacklistname != null) {
addBlacklistEntry(
blacklistname,
"*." + pathURI.getHost());
}
}
}
// return rewrite properties

@ -31,7 +31,7 @@ public class add_entry_p {
WorkTables.TABLE_API_TYPE_CONFIGURATION,
"add to blacklist '" + blacklistToUse + "': " + entry);
if (BlacklistHelper.addBlacklistEntry(blacklistToUse, entry, header)) {
if (BlacklistHelper.addBlacklistEntry(blacklistToUse, entry)) {
prop.put(XML_ITEM_STATUS, RESULT_SUCCESS);
Switchboard.urlBlacklist.clear();

@ -21,13 +21,13 @@
<form action="" method="get" accept-charset="UTF-8">
<p><input type="text" class="searchinput" name="query" value="#[search_query]#" size="40" onFocus="this.select()"/> <input type="submit" class="btn btn-primary" value="Compare" />
Left Search Engine
<select name="left">
<select id="selforobjleft" name="left">
#{searchengines}#
<option #(leftengine)#::selected="selected"#(/leftengine)#>#[searchengine]#</option>
#{/searchengines}#
</select>
&nbsp;&nbsp;Right Search Engine
<select name="right">
<select id="selforobjright" name="right">
#{searchengines}#
<option #(rightengine)#::selected="selected"#(/rightengine)#>#[searchengine]#</option>
#{/searchengines}#
@ -40,8 +40,16 @@
::
<fieldset>
<legend>Search Result</legend>
<object type="text/html" data="#[left]##[query]#" style="width:49%;height:1600px;overflow:scroll;"></object>
<object type="text/html" data="#[right]##[query]#" style="width:49%;height:1600px;overflow:scroll;"></object>
<object id="objleft" onerror="loadErrorFunction('objleft')" type="text/html" data="#[left]##[query]#" style="width:49%;height:1600px;overflow:scroll;min-width:30%;"></object>
<object id="objright" onerror="loadErrorFunction('objright')" type="text/html" data="#[right]##[query]#" style="width:49%;height:1600px;overflow:scroll;">loading....</object>
<script>
function loadErrorFunction(theObject) {
var htobj = document.getElementById(theObject);
htobj.innerHTML = "&nbsp;&nbsp;&nbsp;Error: no results received... from " + document.getElementById("selfor"+theObject).value + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
htobj.style.verticalAlign = "top";
htobj.style.color = "red";
}
</script>
</fieldset>
#(/search)#
#%env/templates/footer.template%#

@ -44,9 +44,7 @@ public class compare_yacy {
//searchengines.put("google.com", "https://www.google.com/#q=");
searchengines.put("startpage.com", "https://startpage.com/do/search?cat=web&query=");
searchengines.put("bing.com", "https://www.bing.com/search?q=");
searchengines.put("metager.de", "https://www.metager.de/meta/cgi-bin/meta.ger1?eingabe=");
searchengines.put("metager2.de (web)", "https://www.metager2.de/search.php?ses=web&q=");
searchengines.put("metager2.de (international)", "https://www.metager2.de/search.php?ses=international&q=");
searchengines.put("metager.de", "https://metager.de/meta/meta.ger3?eingabe="); // see https://gitlab.metager.de/open-source/MetaGer/-/blob/development/resources/lang/de/help/help-functions.php#L37
//searchengines.put("yahoo.com", "https://search.yahoo.com/search?p="); // no search service in iframe 2016-08-17 : "Load denied by X-Frame-Options: does not permit cross-origin framing."
//searchengines.put("romso.de", "http://romso.de/?q="); // no search service 2016-01-02
searchengines.put("Wikipedia English", "https://en.wikipedia.org/wiki/");

Binary file not shown.

@ -35,7 +35,8 @@ jar {
}
*/
// copy fat-jar to deploy location ..
task installJar (type:Copy) {
task installJar (type:Copy, group: 'distribution') {
description 'Install jar in libbuild directory'
from 'build/libs'
include 'GitComInf-all.jar'
into project.projectDir.getParent()

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

@ -41,6 +41,7 @@ public class GitComInf extends Properties {
final File src = new File(this.repoPath);
repo = new FileRepositoryBuilder().readEnvironment()
.findGitDir(src).build();
branch = repo.getBranch();
branch = "master".equals(branch) ? "" : "_" + branch;
this.setProperty(this.BRANCHPROP_LABEL, branch);
@ -80,12 +81,20 @@ public class GitComInf extends Properties {
} else {
revision = Integer.toString(distance + 9000);
}
this.setProperty(this.BRANCHPROP_LABEL, branch);
this.setProperty(this.REVPROP_LABEL, revision);
this.setProperty("REPL_REVISION_NR", revision);
this.setProperty(this.DATEPROP_LABEL, commitDate);
this.setProperty("REPL_DATE", commitDate);
} catch (final IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (GitAPIException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e) {
} finally {
/* In all cases, properly release resources */
if (walk != null) {
@ -97,14 +106,8 @@ public class GitComInf extends Properties {
if (repo != null) {
repo.close();
}
}
this.setProperty(this.BRANCHPROP_LABEL, branch);
//this.setProperty(branch, branch)
this.setProperty(this.REVPROP_LABEL, revision);
this.setProperty("REPL_REVISION_NR", revision);
this.setProperty(this.DATEPROP_LABEL, commitDate);
this.setProperty("REPL_DATE", commitDate);
}
}
/**
@ -121,29 +124,33 @@ public class GitComInf extends Properties {
} else {
gitRevTask.setRepoPath(args[0]);
}
gitRevTask.execute();
System.out.println("Git Commit Info: " + gitRevTask.toString());
// output result to property file
File f;
if (args.length > 1) {
f = new File(args[1]);
if (gitRevTask.isEmpty()) {
System.err.println("no Git repository found" + (args.length == 0 ? "" : " in " + args[0]));
} else {
f = new File("gitbuildnumber.properties");
}
try {
if (!f.exists()) {
f.getParentFile().mkdirs();
// Files.createDirectories(f.getParentFile().toPath()); // just make sure missing dir is not a problem
System.out.println("Git Commit Info: " + gitRevTask.toString());
// output result to property file
File f;
if (args.length > 1) {
f = new File(args[1]);
} else {
f = new File("gitbuildnumber.properties");
}
try {
if (!f.exists()) {
f.getParentFile().mkdirs();
// Files.createDirectories(f.getParentFile().toPath()); // just make sure missing dir is not a problem
}
f.createNewFile();
FileWriter w = new FileWriter(f);
gitRevTask.store(w, "");
w.close();
} catch (final IOException ex) {
System.out.println(ex.toString());
System.out.println(args[1]);
}
f.createNewFile();
FileWriter w = new FileWriter(f);
gitRevTask.store(w, "");
w.close();
} catch (final IOException ex) {
System.out.println(ex.toString());
System.out.println (args[1]);
}
}
}

@ -3,8 +3,6 @@ package net.yacy.peers.operation;
import java.util.Locale;
import java.util.regex.Pattern;
import net.yacy.peers.operation.yacyBuildProperties;
/**
* Properties set when compiling this release/version
@ -71,4 +69,4 @@ public final class yacyBuildProperties {
}
return "@REPL_RESTARTCMD@";
}
}
}

@ -789,11 +789,24 @@ public class Blacklist {
return BlacklistError.NO_ERROR;
}
/**
* Returns the default blacklist name default is the first name which
* contains ".default." (standard default list name is 'url.default.black')
* or if no the first blacklist if no name containing ".default." exists.
*
* @param listsPath directory containig the blacklists
* @return String blacklist name
*/
public static String defaultBlacklist(final File listsPath) {
final List<String> dirlist = FileUtils.getDirListing(listsPath, Blacklist.BLACKLIST_FILENAME_FILTER);
if (dirlist.isEmpty()) {
return null;
}
for (String name : dirlist) {
if (name.contains(".default.")) {
return name;
}
}
return dirlist.get(0);
}

@ -58,18 +58,16 @@ public final class BlacklistHelper {
* Adds a new entry to the chosen blacklist.
* @param blacklistToUse the name of the blacklist the entry is to be added to
* @param entry the entry that is to be added
* @param header the current HTTP request headers
* @return true when no error occurred and the entry was successfully added
*/
public static boolean addBlacklistEntry(
final String blacklistToUse,
final String entry,
final RequestHeader header) {
String newEntry = entry;
public static boolean addBlacklistEntry(
final String blacklistToUse,
final String entry) {
String newEntry = entry;
if (blacklistToUse == null || blacklistToUse.isEmpty() || newEntry == null || newEntry.isEmpty()) {
return false;
}
if (blacklistToUse == null || blacklistToUse.isEmpty() || newEntry == null || newEntry.isEmpty()) {
return false;
}
newEntry = prepareEntry(newEntry);
@ -77,7 +75,7 @@ public final class BlacklistHelper {
String host = newEntry.substring(0, pos);
String path = newEntry.substring(pos + 1);
boolean success = false;
boolean success = false;
for (final BlacklistType supportedBlacklistType : BlacklistType.values()) {
if (ListManager.listSetContains(supportedBlacklistType + ".BlackLists", blacklistToUse)) {
try {

Loading…
Cancel
Save