From 89c1511738980adfcf3b60b792e03bec526dc2d5 Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 23 Apr 2007 20:47:07 +0000 Subject: [PATCH] - added new Network Configuration menu, can be found in basic settings - new cluster functions will be available in this menu, but currently not enabled, because corresponding interface methods are not ready yet - shifted remote crawl settings to new network configuration menu - shifted DHT distribution/receive to the new network configuration menu - adopted some string constants - added cluster configuration settings to yacy.init git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3589 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/ConfigNetwork_p.html | 98 +++++++++ htroot/ConfigNetwork_p.java | 191 ++++++++++++++++++ htroot/ConfigRobotsTxt_p.html | 2 +- htroot/DetailedSearch.java | 2 +- htroot/IndexControl_p.html | 53 ----- htroot/IndexControl_p.java | 45 ----- htroot/IndexCreate_p.html | 48 +---- htroot/IndexCreate_p.java | 47 +---- htroot/IndexShare_p.java | 2 +- htroot/env/templates/submenuConfig.template | 1 + htroot/index.java | 2 +- htroot/yacysearch.java | 2 +- .../de/anomic/plasma/plasmaSwitchboard.java | 65 +++++- yacy.init | 22 +- 14 files changed, 378 insertions(+), 202 deletions(-) create mode 100644 htroot/ConfigNetwork_p.html create mode 100644 htroot/ConfigNetwork_p.java diff --git a/htroot/ConfigNetwork_p.html b/htroot/ConfigNetwork_p.html new file mode 100644 index 000000000..fa80cb446 --- /dev/null +++ b/htroot/ConfigNetwork_p.html @@ -0,0 +1,98 @@ + + + + YaCy '#[clientname]#': Network Configuration + #%env/templates/metas.template%# + + + #%env/templates/header.template%# + #%env/templates/submenuConfig.template%# +

Network Configuration

+ #(commit)# + ::
Accepted Changes.
+ ::
Inapplicable Setting Combination:
+ #(/commit)# + #(commitCrawlPlea)#::
P2P operation can run without remote indexing, but runs better with remote indexing switched on. Please switch 'Accept Remote Crawl Requests' on.
#(/commitCrawlPlea)# + #(commitDHTIsRobinson)#::
For P2P operation, at least DHT distribution or DHT receive (or both) must be set. You have thus defined a Robinson configuration.
#(/commitDHTIsRobinson)# + #(commitDHTNoGlobalSearch)#::
Global Search in P2P configuration is only allowed, if both, index receive and distribution is switched on. You have a P2P configuration, but are not allowed to search other peers.
#(/commitDHTNoGlobalSearch)# + #(commitRobinson)#::
For Robinson Mode, index distribution and receive is switched off.
#(/commitRobinson)# + #(commitRobinsonWithRemoteIndexing)#::
This Robinson Mode switches remote indexing on, but limits targets to peers within the same cluster. Remote indexing requests from peers within the same cluster are accepted.
#(/commitRobinsonWithRemoteIndexing)# + #(commitRobinsonWithoutRemoteIndexing)#::
This Robinson Mode does not allow any remote indexing (neither requests nor acceptance of other requests).
#(/commitRobinsonWithoutRemoteIndexing)# +

+ You can configure if you want to participate at the global YaCy network or if you want to have your + own separate search cluster with or without connection to the global network. You may also define + a completely independent search engine instance, without any data exchange between your peer and other + peers, which we call a 'Robinson' peer. +

+
+
+ Peer-to-Peer Mode +
+
Index Distribution
+
+ This enables automated, DHT-ruled Index Transmission to other peers.
+ enabled + / + disabled + during crawling. +
+
Index Receive
+
+ Accept remote Index Transmissions.
This works only if you have a senior peer. The DHT-rules do not work without this function.
+ reject + / + accept + transmitted URLs that match your blacklist +
+
Accept Remote Crawl Requests
+
+ Perform web indexing upon request of another peer.
This works only if you are a senior peer.
+ Load with a maximum of pages per minute +
+
+
+ +
+ Robinson Mode +

+ If your peer runs in 'Robinson Mode' you run YaCy as a search engine for your own search portal without data exchange to other peers. + There is no index receive and no index distribution between your peer and any other peer. + In case of Robinson-clustering there can be acceptance of remote crawl requests from peers of that cluster. +

+
+
Private Peer
+
Your search engine will not contact any other peer, and will reject every request. +
+ +
Public Peer
+
You are visible to other peers and contact them to distribute your presence.
+ Your peer does not accept any outside index data, but responds on all remote search requests.
+ List of .yacy or .yacyh - domains of the cluster: (comma-separated)
+ +
+
Peer Tags
+
When you allow access from the YaCy network, your data is recognized using keywords.
+ Please describe your search portal with some keywords (comma-separated).
+ +
+
+
+ + +
+ #%env/templates/footer.template%# + + \ No newline at end of file diff --git a/htroot/ConfigNetwork_p.java b/htroot/ConfigNetwork_p.java new file mode 100644 index 000000000..9f03d7874 --- /dev/null +++ b/htroot/ConfigNetwork_p.java @@ -0,0 +1,191 @@ +// ConfigNetwork_p.java +// -------------------- +// (C) 2007 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany +// first published 20.04.2007 on http://yacy.net +// +// This is a part of YaCy, a peer-to-peer based web search engine +// +// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $ +// $LastChangedRevision: 1986 $ +// $LastChangedBy: orbiter $ +// +// LICENSE +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +import de.anomic.http.httpHeader; +import de.anomic.plasma.plasmaSwitchboard; +import de.anomic.server.serverCodings; +import de.anomic.server.serverObjects; +import de.anomic.server.serverSwitch; +import de.anomic.server.serverThread; +import de.anomic.yacy.yacyCore; + +public class ConfigNetwork_p { + + public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) { + + plasmaSwitchboard sb = (plasmaSwitchboard) env; + serverObjects prop = new serverObjects(); + int commit = 0; + + if (post != null) { + + boolean crawlResponse = post.get("crawlResponse", "off").equals("on"); + + // DHT control + boolean indexDistribute = post.get("indexDistribute", "").equals("on"); + boolean indexReceive = post.get("indexReceive", "").equals("on"); + boolean robinsonmode = post.get("network", "").equals("robinson"); + String clustermode = post.get("cluster.mode", "publicpeer"); + if (robinsonmode) { + indexDistribute = false; + indexReceive = false; + if ((clustermode.equals("privatepeer")) || (clustermode.equals("publicpeer"))) { + prop.put("commitRobinsonWithoutRemoteIndexing", 1); + crawlResponse = false; + } + if ((clustermode.equals("privatecluster")) || (clustermode.equals("publiccluster"))) { + prop.put("commitRobinsonWithRemoteIndexing", 1); + crawlResponse = true; + } + commit = 1; + } else { + if (!indexDistribute && !indexReceive) { + prop.put("commitDHTIsRobinson", 1); + commit = 2; + } else if (indexDistribute && indexReceive) { + commit = 1; + } else { + prop.put("commitDHTNoGlobalSearch", 1); + commit = 1; + } + if (!crawlResponse) { + prop.put("commitCrawlPlea", 1); + } + } + + if (indexDistribute) { + sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, "true"); + } else { + sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, "false"); + } + + if (post.get("indexDistributeWhileCrawling","").equals("on")) { + sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW_WHILE_CRAWLING, "true"); + } else { + sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW_WHILE_CRAWLING, "false"); + } + + if (indexReceive) { + sb.setConfig("allowReceiveIndex", "true"); + yacyCore.seedDB.mySeed.setFlagAcceptRemoteIndex(true); + } else { + sb.setConfig("allowReceiveIndex", "false"); + yacyCore.seedDB.mySeed.setFlagAcceptRemoteIndex(false); + } + + if (post.get("indexReceiveBlockBlacklist", "").equals("on")) { + sb.setConfig("indexReceiveBlockBlacklist", "true"); + } else { + sb.setConfig("indexReceiveBlockBlacklist", "false"); + } + + if (post.containsKey("peertags")) { + yacyCore.seedDB.mySeed.setPeerTags(serverCodings.string2set(normalizedList((String) post.get("peertags")), ",")); + } + + sb.setConfig("cluster.mode", post.get("cluster.mode", "publicpeer")); + + // read remote crawl request settings + sb.setConfig("crawlResponse", (crawlResponse) ? "true" : "false"); + int newppm = Math.max(1, Integer.parseInt(post.get("acceptCrawlLimit", "1"))); + long newBusySleep = Math.max(100, 60000 / newppm); + serverThread rct = sb.getThread(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL); + rct.setBusySleep(newBusySleep); + sb.setConfig(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL_BUSYSLEEP, Long.toString(newBusySleep)); + + sb.setConfig("cluster.peers.ipport", checkIPPortList(post.get("cluster.peers.ipport", ""))); + sb.setConfig("cluster.peers.yacydomain", checkYaCyDomainList(post.get("cluster.peers.yacydomain", ""))); + + } + + // write answer code + prop.put("commit", commit); + + // write remote crawl request settings + prop.put("crawlResponse", sb.getConfigBool("crawlResponse", false) ? 1 : 0); + long RTCbusySleep = Integer.parseInt(env.getConfig(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL_BUSYSLEEP, "100")); + int RTCppm = (int) (60000L / RTCbusySleep); + prop.put("acceptCrawlLimit", RTCppm); + + boolean indexDistribute = sb.getConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, "true").equals("true"); + boolean indexReceive = sb.getConfig("allowReceiveIndex", "true").equals("true"); + prop.put("indexDistributeChecked", (indexDistribute) ? 1 : 0); + prop.put("indexDistributeWhileCrawling.on", (sb.getConfig(plasmaSwitchboard.INDEX_DIST_ALLOW_WHILE_CRAWLING, "true").equals("true")) ? 1 : 0); + prop.put("indexDistributeWhileCrawling.off", (sb.getConfig(plasmaSwitchboard.INDEX_DIST_ALLOW_WHILE_CRAWLING, "true").equals("true")) ? 0 : 1); + prop.put("indexReceiveChecked", (indexReceive) ? 1 : 0); + prop.put("indexReceiveBlockBlacklistChecked.on", (sb.getConfig("indexReceiveBlockBlacklist", "true").equals("true")) ? 1 : 0); + prop.put("indexReceiveBlockBlacklistChecked.off", (sb.getConfig("indexReceiveBlockBlacklist", "true").equals("true")) ? 0 : 1); + prop.put("peertags", serverCodings.set2string(yacyCore.seedDB.mySeed.getPeerTags(), ",", false)); + + // set seed information directly + yacyCore.seedDB.mySeed.setFlagAcceptRemoteCrawl(sb.getConfigBool("crawlResponse", false)); + yacyCore.seedDB.mySeed.setFlagAcceptRemoteIndex(indexReceive); + + // set p2p/robinson mode flags and values + prop.put("p2p.checked", (indexDistribute || indexReceive) ? 1 : 0); + prop.put("robinson.checked", (indexDistribute || indexReceive) ? 0 : 1); + prop.put("cluster.peers.ipport", sb.getConfig("cluster.peers.ipport", "")); + prop.put("cluster.peers.yacydomain", sb.getConfig("cluster.peers.yacydomain", "")); + + // set p2p mode flags + prop.put("privatepeerChecked", (sb.getConfig("cluster.mode", "").equals("privatepeer")) ? 1 : 0); + prop.put("privateclusterChecked", (sb.getConfig("cluster.mode", "").equals("privatecluster")) ? 1 : 0); + prop.put("publicclusterChecked", (sb.getConfig("cluster.mode", "").equals("publiccluster")) ? 1 : 0); + prop.put("publicpeerChecked", (sb.getConfig("cluster.mode", "").equals("publicpeer")) ? 1 : 0); + + return prop; + } + + public static String normalizedList(String input) { + input = input.replace(' ', ','); + input = input.replace(' ', ';'); + input = input.replaceAll(",,", ","); + if (input.startsWith(",")) input = input.substring(1); + if (input.endsWith(",")) input = input.substring(0, input.length() - 1); + return input; + } + + public static String checkYaCyDomainList(String input) { + input = normalizedList(input); + String[] s = input.split(","); + input = ""; + for (int i = 0; i < s.length; i++) { + if ((s[i].endsWith(".yacyh")) || (s[i].endsWith(".yacy"))) input += "," + s[i]; + } + if (input.length() == 0) return input; else return input.substring(1); + } + + public static String checkIPPortList(String input) { + input = normalizedList(input); + String[] s = input.split(","); + input = ""; + for (int i = 0; i < s.length; i++) { + if (s[i].indexOf(':') >= 9) input += "," + s[i]; + } + if (input.length() == 0) return input; else return input.substring(1); + } +} diff --git a/htroot/ConfigRobotsTxt_p.html b/htroot/ConfigRobotsTxt_p.html index 899f9cbd7..478574176 100644 --- a/htroot/ConfigRobotsTxt_p.html +++ b/htroot/ConfigRobotsTxt_p.html @@ -4,7 +4,7 @@ YaCy '#[clientname]#': Local robots.txt #%env/templates/metas.template%# - + #%env/templates/header.template%# #%env/templates/submenuConfig.template%#

Exclude Web-Spiders

diff --git a/htroot/DetailedSearch.java b/htroot/DetailedSearch.java index a5f5eebd5..59c510c3d 100644 --- a/htroot/DetailedSearch.java +++ b/htroot/DetailedSearch.java @@ -195,7 +195,7 @@ public class DetailedSearch { boolean global = post.get("global", "").equals("on"); boolean postsort = post.get("postsort", "").equals("on"); - final boolean indexDistributeGranted = sb.getConfig("allowDistributeIndex", "true").equals("true"); + final boolean indexDistributeGranted = sb.getConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, "true").equals("true"); final boolean indexReceiveGranted = sb.getConfig("allowReceiveIndex", "true").equals("true"); if (!indexDistributeGranted || !indexReceiveGranted) { global = false; } diff --git a/htroot/IndexControl_p.html b/htroot/IndexControl_p.html index b4d4c9eaf..7cad1713f 100644 --- a/htroot/IndexControl_p.html +++ b/htroot/IndexControl_p.html @@ -62,59 +62,6 @@ - - -

- DHT Transmission control:
- The transmission is necessary for the functionality of global search on other peers. - If you switch off distribution or receipt of RWIs you will be banned from global search. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Index Distribution:This enables automated, DHT-ruled Index Transmission to other peers. -
  If checked, DHT-Transmission is enabled even during crawling.
Index Receive:Accept remote Index Transmissions. This works only if you are a senior peer. - The DHT-rules do not work without this function.
  If checked, your peer silently ignores transmitted URLs that match your blacklist
Peer Tags:If your peer runs in 'Robinson Mode' (Distribution and Receive off), you probably run YaCy as a search engine - for your own search portal. Please describe your search portal with some keywords (comma-separated). - This will help to use your peer as search target even if you do not distribute your web index by - DHT distribution.
Changes will take effect immediately
#(keyhashsimilar)#::Sequential List of Word-Hashes:
#{rows}# diff --git a/htroot/IndexControl_p.java b/htroot/IndexControl_p.java index 5f74a4e2e..43b5966ed 100644 --- a/htroot/IndexControl_p.java +++ b/htroot/IndexControl_p.java @@ -70,7 +70,6 @@ import de.anomic.net.URL; import de.anomic.plasma.plasmaCondenser; import de.anomic.plasma.plasmaSwitchboard; import de.anomic.plasma.urlPattern.plasmaURLPattern; -import de.anomic.server.serverCodings; import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch; import de.anomic.yacy.yacyClient; @@ -94,11 +93,6 @@ public class IndexControl_p { prop.put("wcount", Integer.toString(switchboard.wordIndex.size())); prop.put("ucount", Integer.toString(switchboard.wordIndex.loadedURL.size())); prop.put("otherHosts", ""); - prop.put("indexDistributeChecked", (switchboard.getConfig("allowDistributeIndex", "true").equals("true")) ? 1 : 0); - prop.put("indexDistributeWhileCrawling", (switchboard.getConfig("allowDistributeIndexWhileCrawling", "true").equals("true")) ? 1 : 0); - prop.put("indexReceiveChecked", (switchboard.getConfig("allowReceiveIndex", "true").equals("true")) ? 1 : 0); - prop.put("indexReceiveBlockBlacklistChecked", (switchboard.getConfig("indexReceiveBlockBlacklist", "true").equals("true")) ? 1 : 0); - prop.put("peertags", serverCodings.set2string(yacyCore.seedDB.mySeed.getPeerTags(), ",", false)); listHosts(prop, ""); return prop; // be save } @@ -122,40 +116,6 @@ public class IndexControl_p { String[] urlx = post.getAll("urlhx.*"); boolean delurl = post.containsKey("delurl"); boolean delurlref = post.containsKey("delurlref"); -// System.out.println("DEBUG CHECK: " + ((delurl) ? "delurl" : "") + " " + ((delurlref) ? "delurlref" : "")); - - // DHT control - if (post.containsKey("setIndexTransmission")) { - if (post.get("indexDistribute", "").equals("on")) { - switchboard.setConfig("allowDistributeIndex", "true"); - } else { - switchboard.setConfig("allowDistributeIndex", "false"); - } - - if (post.get("indexDistributeWhileCrawling","").equals("on")) { - switchboard.setConfig("allowDistributeIndexWhileCrawling", "true"); - } else { - switchboard.setConfig("allowDistributeIndexWhileCrawling", "false"); - } - - if (post.get("indexReceive", "").equals("on")) { - switchboard.setConfig("allowReceiveIndex", "true"); - yacyCore.seedDB.mySeed.setFlagAcceptRemoteIndex(true); - } else { - switchboard.setConfig("allowReceiveIndex", "false"); - yacyCore.seedDB.mySeed.setFlagAcceptRemoteIndex(false); - } - - if (post.get("indexReceiveBlockBlacklist", "").equals("on")) { - switchboard.setConfig("indexReceiveBlockBlacklist", "true"); - } else { - switchboard.setConfig("indexReceiveBlockBlacklist", "false"); - } - - if (post.containsKey("peertags")) { - yacyCore.seedDB.mySeed.setPeerTags(serverCodings.string2set((String) post.get("peertags"), ",")); - } - } // delete word if (post.containsKey("keyhashdeleteall")) { @@ -455,11 +415,6 @@ public class IndexControl_p { // insert constants prop.put("wcount", Integer.toString(switchboard.wordIndex.size())); prop.put("ucount", Integer.toString(switchboard.wordIndex.loadedURL.size())); - prop.put("indexDistributeChecked", (switchboard.getConfig("allowDistributeIndex", "true").equals("true")) ? 1 : 0); - prop.put("indexDistributeWhileCrawling", (switchboard.getConfig("allowDistributeIndexWhileCrawling", "true").equals("true")) ? 1 : 0); - prop.put("indexReceiveChecked", (switchboard.getConfig("allowReceiveIndex", "true").equals("true")) ? 1 : 0); - prop.put("indexReceiveBlockBlacklistChecked", (switchboard.getConfig("indexReceiveBlockBlacklist", "true").equals("true")) ? 1 : 0); - prop.put("peertags", serverCodings.set2string(yacyCore.seedDB.mySeed.getPeerTags(), ",", false)); // return rewrite properties return prop; } diff --git a/htroot/IndexCreate_p.html b/htroot/IndexCreate_p.html index 7347a4652..fd586fbeb 100644 --- a/htroot/IndexCreate_p.html +++ b/htroot/IndexCreate_p.html @@ -217,53 +217,7 @@ - - -
-

- Distributed Indexing: - Crawling and indexing can be done by remote peers. - Your peer can search and index for other peers and they can search for you. -

- - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - Pages Per Minute (minimum is 1, low system load usually at PPM ≥ 30) -
- - - -
- - -
-
+

#(info)# diff --git a/htroot/IndexCreate_p.java b/htroot/IndexCreate_p.java index ef4c04812..3ff278828 100644 --- a/htroot/IndexCreate_p.java +++ b/htroot/IndexCreate_p.java @@ -52,7 +52,6 @@ import de.anomic.plasma.plasmaURL; import de.anomic.plasma.plasmaSwitchboard; import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch; -import de.anomic.server.serverThread; import de.anomic.yacy.yacyCore; import de.anomic.yacy.yacyNewsPool; import de.anomic.yacy.yacyNewsRecord; @@ -69,26 +68,6 @@ public class IndexCreate_p { prop.put("refreshbutton", 0); if (post != null) { - if (post.containsKey("distributedcrawling")) { - long newBusySleep = Integer.parseInt(env.getConfig(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL_BUSYSLEEP, "100")); - if (post.get("dcr", "").equals("acceptCrawlMax")) { - env.setConfig("crawlResponse", "true"); - newBusySleep = 100; - } else if (post.get("dcr", "").equals("acceptCrawlLimited")) { - env.setConfig("crawlResponse", "true"); - int newppm = Integer.parseInt(post.get("acceptCrawlLimit", "1")); - if (newppm < 1) newppm = 1; - newBusySleep = 60000 / newppm; - if (newBusySleep < 100) newBusySleep = 100; - } else if (post.get("dcr", "").equals("acceptCrawlDenied")) { - env.setConfig("crawlResponse", "false"); - } - serverThread rct = switchboard.getThread(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL); - rct.setBusySleep(newBusySleep); - env.setConfig(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL_BUSYSLEEP, Long.toString(newBusySleep)); - //boolean crawlResponse = ((String) post.get("acceptCrawlMax", "")).equals("on"); - //env.setConfig("crawlResponse", (crawlResponse) ? "true" : "false"); - } if (post.containsKey("pausecrawlqueue")) { switchboard.pauseCrawlJob(plasmaSwitchboard.CRAWLJOB_LOCAL_CRAWL); @@ -150,31 +129,7 @@ public class IndexCreate_p { prop.put("crawlingSpeedMaxChecked", (LCppm >= 1000) ? 1 : 0); prop.put("crawlingSpeedCustChecked", ((LCppm > 10) && (LCppm < 1000)) ? 1 : 0); prop.put("crawlingSpeedMinChecked", (LCppm <= 10) ? 1 : 0); - prop.put("customPPMdefault", ((LCppm > 10) && (LCppm < 1000)) ? Integer.toString(LCppm) : ""); - - long RTCbusySleep = Integer.parseInt(env.getConfig(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL_BUSYSLEEP, "100")); - if (RTCbusySleep < 100) { - RTCbusySleep = 100; - env.setConfig(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL_BUSYSLEEP, Long.toString(RTCbusySleep)); - } - if (env.getConfig("crawlResponse", "").equals("true")) { - if (RTCbusySleep <= 100) { - prop.put("acceptCrawlMaxChecked", 1); - prop.put("acceptCrawlLimitedChecked", 0); - prop.put("acceptCrawlDeniedChecked", 0); - } else { - prop.put("acceptCrawlMaxChecked", 0); - prop.put("acceptCrawlLimitedChecked", 1); - prop.put("acceptCrawlDeniedChecked", 0); - } - } else { - prop.put("acceptCrawlMaxChecked", 0); - prop.put("acceptCrawlLimitedChecked", 0); - prop.put("acceptCrawlDeniedChecked", 1); - } - int RTCppm = (RTCbusySleep == 0) ? 60 : (int) (60000L / RTCbusySleep); - if (RTCppm > 60) RTCppm = 60; - prop.put("PPM", RTCppm); + prop.put("customPPMdefault", ((LCppm > 10) && (LCppm < 1000)) ? Integer.toString(LCppm) : ""); prop.put("xsstopwChecked", env.getConfig("xsstopw", "").equals("true") ? 1 : 0); prop.put("xdstopwChecked", env.getConfig("xdstopw", "").equals("true") ? 1 : 0); diff --git a/htroot/IndexShare_p.java b/htroot/IndexShare_p.java index eb6dc95c8..26e60efe0 100644 --- a/htroot/IndexShare_p.java +++ b/htroot/IndexShare_p.java @@ -71,7 +71,7 @@ public class IndexShare_p { } if (post.containsKey("indexsharesetting")) { - switchboard.setConfig("allowDistributeIndex", (post.containsKey("distribute")) ? "true" : "false"); + switchboard.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, (post.containsKey("distribute")) ? "true" : "false"); switchboard.setConfig("allowReceiveIndex", (post.containsKey("receive")) ? "true" : "false"); switchboard.setConfig("defaultLinkReceiveFrequency", post.get("linkfreq", "30")); switchboard.setConfig("defaultWordReceiveFrequency", post.get("wordfreq", "10")); diff --git a/htroot/env/templates/submenuConfig.template b/htroot/env/templates/submenuConfig.template index 02144e747..717450126 100644 --- a/htroot/env/templates/submenuConfig.template +++ b/htroot/env/templates/submenuConfig.template @@ -3,6 +3,7 @@