diff --git a/addon/yacyInit.sh b/addon/yacyInit.sh index 31b2477f0..2fb33aca5 100755 --- a/addon/yacyInit.sh +++ b/addon/yacyInit.sh @@ -26,16 +26,16 @@ NICE_VAL=0 JAVA_ARGS="-Djava.awt.headless=true" #get javastart args -if [ -f DATA/SETTINGS/httpProxy.conf ] +if [ -f DATA/SETTINGS/yacy.conf ] then # startup memory for i in Xmx Xms; do - j="`grep javastart_$i DATA/SETTINGS/httpProxy.conf | sed 's/^[^=]*=//'`"; + j="`grep javastart_$i DATA/SETTINGS/yacy.conf | sed 's/^[^=]*=//'`"; if [ -n $j ]; then JAVA_ARGS="-$j $JAVA_ARGS"; fi; done # Priority - j="`grep javastart_priority DATA/SETTINGS/httpProxy.conf | sed 's/^[^=]*=//'`"; + j="`grep javastart_priority DATA/SETTINGS/yacy.conf | sed 's/^[^=]*=//'`"; if [ ! -z "$j" ];then if [ -n $j ]; then NICE_VAL=$j; fi; diff --git a/build.xml b/build.xml index c01249837..bf8115f54 100644 --- a/build.xml +++ b/build.xml @@ -390,19 +390,22 @@ - - - - + + + + + + diff --git a/yacy.init b/defaults/yacy.init similarity index 97% rename from yacy.init rename to defaults/yacy.init index 6b6a146aa..659bfcaa4 100644 --- a/yacy.init +++ b/defaults/yacy.init @@ -4,7 +4,7 @@ # These properties will be loaded upon installation. # They are used only once for set-up. # If you make changes to this file and want these to make any effect, -# you must delete the httpProxy.conf file in DATA/SETTINGS +# you must delete the yacy.conf file in DATA/SETTINGS # ---------------------------------------------------------------------------- # the HTTP service configurations @@ -70,8 +70,8 @@ server.maxTrackingTime = 3600000 # The property here can also be a url where the definition can be loaded. # In case of privately managed networks, this configuration must be changed BEFORE it is released # to the members of the separated network peers. -network.unit.definition = yacy.network.unit -network.group.definition = yacy.network.group +network.unit.definition = defaults/yacy.network.freeworld.unit +network.group.definition = defaults/yacy.network.group # Update process properties # The update server location is given in the network.unit.definition, diff --git a/defaults/yacy.network.freeworld.unit b/defaults/yacy.network.freeworld.unit new file mode 100644 index 000000000..0c85027b5 --- /dev/null +++ b/defaults/yacy.network.freeworld.unit @@ -0,0 +1,31 @@ +# Network definition file for the freeworld network +# this is the default standard network for fresh YaCy Peers + +# -----------------------------------------------------------------# +# for an explanation please see the file yacy.network.readme # +# this is a work in progress. disabled properties are not yet used # +# -----------------------------------------------------------------# + +# general network definition +network.unit.name = freeworld +network.unit.description = Public YaCy Community +network.unit.domain = global +network.unit.search.time = 4 +network.unit.dht = true +network.unit.dhtredundancy.junior = 1 +network.unit.dhtredundancy.senior = 3 +network.unit.bootstrap.seedlist0 = http://www.yacy.net/seed.txt +network.unit.bootstrap.seedlist1 = http://home.arcor.de/hermens/yacy/seed.txt +network.unit.bootstrap.seedlist2 = http://low.audioattack.de/yacy/seed.txt +network.unit.bootstrap.seedlist3 = http://www.lulabad.de/seed.txt +network.unit.bootstrap.seedlist4 = http://www.marcelhenseler.de/yacy/seed.txt + +# 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.findenstattsuchen.info/YaCy/latest/index.php +network.unit.update.location3 = http://www.yacystats.de/yacybuild/ + +# properties for in-protocol response authentification: +network.unit.protocol.control = uncontrolled \ No newline at end of file diff --git a/yacy.network.group b/defaults/yacy.network.group similarity index 98% rename from yacy.network.group rename to defaults/yacy.network.group index 2b1d57746..f5a6698fe 100644 --- a/yacy.network.group +++ b/defaults/yacy.network.group @@ -1,7 +1,7 @@ # YaCy Network Group Definition # ----------------------------- # This is an addition to the yacy.network.unit configuration file. -# This file is addressed by the network.group.definition property in yacy.init +# This file is addressed by the network.group.definition property in defaults/yacy.init # The purpose of a group within a network is that some parts of a network may be managed independently, # while the content of the network stays private for the whole network, mostly for a special purpose. # This file needs to be configured if someone wants to participate with several peers to the network, diff --git a/defaults/yacy.network.intranet.unit b/defaults/yacy.network.intranet.unit new file mode 100644 index 000000000..5ef5d5220 --- /dev/null +++ b/defaults/yacy.network.intranet.unit @@ -0,0 +1,25 @@ +# Network definition file for the freeworld network +# this is the default standard network for fresh YaCy Peers + +# -----------------------------------------------------------------# +# for an explanation please see the file yacy.network.readme # +# this is a work in progress. disabled properties are not yet used # +# -----------------------------------------------------------------# + +# general network definition +network.unit.name = intranet +network.unit.description = Private Intranet +network.unit.domain = local +network.unit.dht = false +network.unit.dhtredundancy.junior = 1 +network.unit.dhtredundancy.senior = 1 + +# 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.findenstattsuchen.info/YaCy/latest/index.php +network.unit.update.location3 = http://www.yacystats.de/yacybuild/ + +# properties for in-protocol response authentification: +network.unit.protocol.control = uncontrolled \ No newline at end of file diff --git a/yacy.network.unit b/defaults/yacy.network.readme similarity index 62% rename from yacy.network.unit rename to defaults/yacy.network.readme index b785355c7..eda000c3d 100644 --- a/yacy.network.unit +++ b/defaults/yacy.network.readme @@ -6,7 +6,7 @@ # To distinguish between index areas where the shared web index is for a intranet or the public internet, # we distinguish local and global networks. Each network type can have different user groups. # Groups can be uncontrolled, moderated or controlled. The whole network may also have a global master. -# This file is adressed by the network.unit.definition property in yacy.init. If necessary this +# This file is adressed by the network.unit.definition property in defaults/yacy.init. If necessary this # property can also address a URL where a network definition file can be hosted, so that a network # can easily be moderated from a single central. In case of the public network of all independent peers # for global indexing, the network definition is attached to the release and defines no network master or @@ -42,42 +42,3 @@ # network.unit.administration.manager = # network.unit.administration.request.authentification.method = 'salted-magic' # network.unit.administration.request.authentification.essentials = - - -# -----------------------------------------------------------------# -# this is a work in progress. disabled properties are not yet used # -# -----------------------------------------------------------------# - -# general network definition -network.unit.name = freeworld -network.unit.description = Public YaCy Community -network.unit.domain = global -network.unit.search.time = 4 -network.unit.dht = true -network.unit.dhtredundancy.junior = 1 -network.unit.dhtredundancy.senior = 3 -network.unit.bootstrap.seedlist0 = http://www.yacy.net/seed.txt -network.unit.bootstrap.seedlist1 = http://home.arcor.de/hermens/yacy/seed.txt -network.unit.bootstrap.seedlist2 = http://low.audioattack.de/yacy/seed.txt -network.unit.bootstrap.seedlist3 = http://www.lulabad.de/seed.txt -network.unit.bootstrap.seedlist4 = http://www.marcelhenseler.de/yacy/seed.txt - -# 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.findenstattsuchen.info/YaCy/latest/index.php -network.unit.update.location3 = http://www.yacystats.de/yacybuild/ - -# properties for in-protocol response authentification: -network.unit.protocol.control = uncontrolled -#network.unit.protocol.request.authentification.method = salted-magic-sim -#network.unit.protocol.request.authentification.essentials = -#network.unit.protocol.response.authentification.method = challenge-pwresponse -#network.unit.protocol.response.authentification.essentials = - -# properties for unit access administrator-authentification: -#network.unit.administration.control = uncontrolled -#network.unit.administration.manager = -#network.unit.administration.request.authentification.method = salted-magic -#network.unit.administration.request.authentification.essentials = diff --git a/htroot/ConfigProperties_p.html b/htroot/ConfigProperties_p.html index 8764eafbe..94cee5c81 100644 --- a/htroot/ConfigProperties_p.html +++ b/htroot/ConfigProperties_p.html @@ -44,7 +44,7 @@ You can change anything, but some options need a restart, and some options can crash YaCy, if wrong values are used.

- For explanation please look into yacy.init + For explanation please look into defaults/yacy.init

#{options}# diff --git a/htroot/IndexImport_p.java b/htroot/IndexImport_p.java index fa4e693ff..490f70156 100644 --- a/htroot/IndexImport_p.java +++ b/htroot/IndexImport_p.java @@ -50,7 +50,6 @@ import java.io.PrintStream; import java.util.Date; -import java.util.HashMap; import de.anomic.http.httpHeader; import de.anomic.plasma.plasmaSwitchboard; @@ -72,19 +71,10 @@ public final class IndexImport_p { if (post != null) { if (post.containsKey("startIndexDbImport")) { try { - // getting the import path - String importPlasmaPath = (String) post.get("importPlasmaPath"); - //String importIndexPrimaryPath = (String) post.get("importIndexPrimaryPath"); - //String importIndexSecondaryPath = (String) post.get("importIndexSecondaryPath"); String importType = (String) post.get("importType"); - String cacheSizeStr = (String) post.get("cacheSize"); + int cacheSize = post.getInt("cacheSize", 0); boolean startImport = true; - HashMap initParams = new HashMap(); - initParams.put("plasmaPath",importPlasmaPath); - initParams.put("cacheSize",cacheSizeStr); - initParams.put("preloadTime","100"); - // // check if there is an already running thread with the same import path // Thread[] importThreads = new Thread[plasmaDbImporter.runningJobs.activeCount()*2]; // activeCount = plasmaDbImporter.runningJobs.enumerate(importThreads); @@ -101,7 +91,7 @@ public final class IndexImport_p { if (startImport) { dbImporter importerThread = switchboard.dbImportManager.getNewImporter(importType); if (importerThread != null) { - importerThread.init(initParams); + importerThread.init(switchboard, cacheSize); importerThread.startIt(); } prop.put("LOCATION",""); diff --git a/htroot/PerformanceMemory_p.java b/htroot/PerformanceMemory_p.java index 6588b8b64..4e8e83a59 100644 --- a/htroot/PerformanceMemory_p.java +++ b/htroot/PerformanceMemory_p.java @@ -70,7 +70,7 @@ public class PerformanceMemory_p { // return variable that accumulates replacements serverObjects prop = new serverObjects(); if (defaultSettings == null) { - defaultSettings = serverFileUtils.loadHashMap(new File(env.getRootPath(), "yacy.init")); + defaultSettings = serverFileUtils.loadHashMap(new File(env.getRootPath(), "defaults/yacy.init")); } prop.put("gc", "0"); if (post != null) { diff --git a/htroot/PerformanceQueues_p.java b/htroot/PerformanceQueues_p.java index ff843c691..ed3101c11 100644 --- a/htroot/PerformanceQueues_p.java +++ b/htroot/PerformanceQueues_p.java @@ -62,7 +62,7 @@ public class PerformanceQueues_p { // return variable that accumulates replacements plasmaSwitchboard switchboard = (plasmaSwitchboard) sb; serverObjects prop = new serverObjects(); - File defaultSettingsFile = new File(switchboard.getRootPath(), "yacy.init"); + File defaultSettingsFile = new File(switchboard.getRootPath(), "defaults/yacy.init"); Map defaultSettings = ((post == null) || (!(post.containsKey("submitdefault")))) ? null : serverFileUtils.loadHashMap(defaultSettingsFile); Iterator threads = switchboard.threadNames(); String threadName; diff --git a/htroot/Settings_p.html b/htroot/Settings_p.html index f06dee48a..447044d6c 100644 --- a/htroot/Settings_p.html +++ b/htroot/Settings_p.html @@ -26,7 +26,7 @@

Advanced Settings

If you want to restore all settings to the default values, but forgot your administration password, you must stop the proxy, - delete the file 'DATA/SETTINGS/httpProxy.conf' in the YaCy application root folder and start YaCy again. + delete the file 'DATA/SETTINGS/yacy.conf' in the YaCy application root folder and start YaCy again.

  • Server Access Settings
  • diff --git a/htroot/Threaddump_p.html b/htroot/Threaddump_p.html index e78f96c9b..4689c70d3 100644 --- a/htroot/Threaddump_p.html +++ b/htroot/Threaddump_p.html @@ -1,7 +1,7 @@ - YaCy '#[clientname]#': Threaddump + YaCy '#[clientname]#': Thread Dump #%env/templates/metas.template%# @@ -15,7 +15,7 @@
    - #(dump)#::#[content]##(/dump)# + #(dump)#::#[content]##(/dump)#
    #%env/templates/footer.template%# diff --git a/htroot/Threaddump_p.java b/htroot/Threaddump_p.java index 597a095e4..38cdb7a45 100644 --- a/htroot/Threaddump_p.java +++ b/htroot/Threaddump_p.java @@ -65,11 +65,9 @@ public class Threaddump_p { public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) { - prop = new serverObjects(); sb = (plasmaSwitchboard) env; - StringBuffer buffer = new StringBuffer(); - + StringBuffer buffer = new StringBuffer(1000); if (post != null && post.containsKey("createThreaddump")) { prop.put("dump", "1"); @@ -81,17 +79,17 @@ public class Threaddump_p { buffer.append("************* Start Thread Dump " + dt + " *******************").append("
    "); buffer.append("
    YaCy Version: " + versionstring + "
    "); buffer.append("Total Memory = " + (Runtime.getRuntime().totalMemory())).append("
    "); - buffer.append("Used Memory = " + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())).append("
    "); - buffer.append("Free Memory = " + (Runtime.getRuntime().freeMemory())).append("
    "); - buffer.append(" --- --- --- ---
    "); - for (Thread thread: stackTraces.keySet()) { - StackTraceElement[] stackTraceElement = (StackTraceElement[]) stackTraces.get(thread); - buffer.append("Thread= " + thread.getName() + " " + (thread.isDaemon()?"daemon":"") + " id=" + thread.getId() + " " + thread.getState()).append("
    "); - for(int i = 0; i <= (stackTraceElement.length -1); i++) { - buffer.append(stackTraceElement[i]).append("
    "); - } - buffer.append("
    "); - } + buffer.append("Used  Memory = " + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())).append("
    "); + buffer.append("Free  Memory = " + (Runtime.getRuntime().freeMemory())).append("
    "); + buffer.append(" --- --- --- ---

    "); + + appendStackTraces(buffer, stackTraces, Thread.State.BLOCKED); + appendStackTraces(buffer, stackTraces, Thread.State.RUNNABLE); + appendStackTraces(buffer, stackTraces, Thread.State.TIMED_WAITING); + appendStackTraces(buffer, stackTraces, Thread.State.WAITING); + appendStackTraces(buffer, stackTraces, Thread.State.NEW); + appendStackTraces(buffer, stackTraces, Thread.State.TERMINATED); + buffer.append("************* End Thread Dump " + dt + " *******************").append("
    "); prop.put("dump_content", buffer.toString()); @@ -102,5 +100,19 @@ public class Threaddump_p { return prop; // return from serverObjects respond() } - + private static void appendStackTraces(StringBuffer buffer, Map stackTraces, Thread.State stateIn) { + buffer.append("THREADS WITH STATES: " + stateIn.toString()).append("
    ").append("
    "); + + for (Thread thread: stackTraces.keySet()) { + StackTraceElement[] stackTraceElement = stackTraces.get(thread); + if (stateIn.equals(thread.getState())) { + buffer.append("Thread= " + thread.getName() + " " + (thread.isDaemon()?"daemon":"") + " id=" + thread.getId() + " " + thread.getState().toString()).append("
    "); + for (int i = 0; i < stackTraceElement.length; i++) { + buffer.append("at " + stackTraceElement[i]).append("
    "); + } + buffer.append("
    "); + } + } + buffer.append("
    "); + } } diff --git a/htroot/WatchCrawler_p.java b/htroot/WatchCrawler_p.java index 597d91b2c..adbf2fa22 100644 --- a/htroot/WatchCrawler_p.java +++ b/htroot/WatchCrawler_p.java @@ -41,7 +41,7 @@ import de.anomic.http.httpHeader; import de.anomic.plasma.plasmaCrawlProfile; import de.anomic.plasma.plasmaCrawlZURL; import de.anomic.plasma.plasmaSwitchboard; -import de.anomic.plasma.dbImport.dbImporter; +import de.anomic.plasma.dbImport.SitemapImporter; import de.anomic.server.serverFileUtils; import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch; @@ -325,13 +325,10 @@ public class WatchCrawler_p { storeHTCache, true, crawlOrder, xsstopw, xdstopw, xpstopw); // create a new sitemap importer - dbImporter importerThread = switchboard.dbImportManager.getNewImporter("sitemap"); + SitemapImporter importerThread = (SitemapImporter) switchboard.dbImportManager.getNewImporter("sitemap"); if (importerThread != null) { - HashMap initParams = new HashMap(); - initParams.put("sitemapURL", sitemapURLStr); - initParams.put("crawlingProfile", pe.handle()); - - importerThread.init(initParams); + importerThread.init(switchboard, 0); + importerThread.initSitemap(new yacyURL(sitemapURLStr, null), pe); importerThread.startIt(); } } catch (Exception e) { diff --git a/htroot/env/templates/header.template b/htroot/env/templates/header.template index 052cbbd12..0f72ba887 100644 --- a/htroot/env/templates/header.template +++ b/htroot/env/templates/header.template @@ -6,7 +6,8 @@

    Search & Browse