summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2007-07-10 23:56:25 +0000
committerorbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2007-07-10 23:56:25 +0000
commit527b3decdee2951910bef96f5e5e915fe7c9c73e (patch)
tree5b5830f378d5d14ce001cfa265ad490d33021037
parent49685566684b0d648881fcba3f4969078e690c7f (diff)
- re-sructuring of configuration menus
- added new system update configuration page - moved system update from status page to system udate page - moved shutdown and restart from status page to main menu - added new configuration properties to yacy.init (not yet actively used) - added some methods to handle new automatic update process git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3958 6c8d7289-2bf4-0310-a012-ef5d649a1542
-rw-r--r--build.properties2
-rw-r--r--htroot/ConfigBasic.html4
-rw-r--r--htroot/ConfigProperties_p.html (renamed from htroot/ConfigAdvanced_p.html)0
-rw-r--r--htroot/ConfigProperties_p.java (renamed from htroot/ConfigAdvanced_p.java)2
-rw-r--r--htroot/ConfigUpdate_p.html47
-rw-r--r--htroot/ConfigUpdate_p.java156
-rw-r--r--htroot/PerformanceMemory_p.html2
-rw-r--r--htroot/PerformanceQueues_p.html2
-rw-r--r--htroot/PerformanceSearch_p.html2
-rw-r--r--htroot/Settings_p.html1
-rw-r--r--htroot/Status.html51
-rw-r--r--htroot/Status.java89
-rw-r--r--htroot/User_p.html1
-rw-r--r--htroot/env/base.css6
-rw-r--r--htroot/env/templates/header.template12
-rw-r--r--htroot/env/templates/submenuConfig.template25
-rw-r--r--htroot/env/templates/submenuPerformance.template8
-rw-r--r--source/de/anomic/yacy/yacyVersion.java104
-rw-r--r--source/yacy.java13
-rw-r--r--yacy.init26
-rw-r--r--yacy.network.unit2
21 files changed, 372 insertions, 183 deletions
diff --git a/build.properties b/build.properties
index 05ba7f403..07a0dd1f5 100644
--- a/build.properties
+++ b/build.properties
@@ -3,7 +3,7 @@ javacSource=1.4
javacTarget=1.4
# Release Configuration
-releaseVersion=0.535
+releaseVersion=0.536
releaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
proReleaseFile=yacy_pro_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
releaseFileParentDir=yacy
diff --git a/htroot/ConfigBasic.html b/htroot/ConfigBasic.html
index 0bf15c6b1..89b29b967 100644
--- a/htroot/ConfigBasic.html
+++ b/htroot/ConfigBasic.html
@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>YaCy '#[clientname]#': Basic Configuration</title>
+ <title>YaCy '#[clientname]#': Access Configuration</title>
#%env/templates/metas.template%#
<script type="text/javascript">
<!--
@@ -17,7 +17,7 @@
<body id="ConfigBasic">
#%env/templates/header.template%#
#%env/templates/submenuConfig.template%#
- <h2>Basic Configuration</h2>
+ <h2>Access Configuration</h2>
<p>
Your YaCy Peer needs some basic information to operate properly
</p>
diff --git a/htroot/ConfigAdvanced_p.html b/htroot/ConfigProperties_p.html
index 8764eafbe..8764eafbe 100644
--- a/htroot/ConfigAdvanced_p.html
+++ b/htroot/ConfigProperties_p.html
diff --git a/htroot/ConfigAdvanced_p.java b/htroot/ConfigProperties_p.java
index 74dd1cdeb..46d03b2fa 100644
--- a/htroot/ConfigAdvanced_p.java
+++ b/htroot/ConfigProperties_p.java
@@ -56,7 +56,7 @@ import de.anomic.http.httpHeader;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
-public class ConfigAdvanced_p {
+public class ConfigProperties_p {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
// return variable that accumulates replacements
diff --git a/htroot/ConfigUpdate_p.html b/htroot/ConfigUpdate_p.html
new file mode 100644
index 000000000..ab8d47cba
--- /dev/null
+++ b/htroot/ConfigUpdate_p.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>YaCy '#[clientname]#': System Update</title>
+ #%env/templates/metas.template%#
+ <meta http-equiv="REFRESH" content="30" />
+ </head>
+ <body style="margin:0px;">
+ #%env/templates/header.template%#
+ #%env/templates/submenuConfig.template%#
+ <h2>System Update</h2>
+
+ #(candeploy)#::
+ <fieldset>
+ <legend>System Update</legend>
+ <dl>
+ <dt>Available Releases</dt>
+ <dd><form action="ConfigUpdate_p.html" method="get">
+ &nbsp;<select name="releasedownload">
+ #{availreleases}#
+ <option #(selected)#::selected#(/selected)# value="#[url]#">#[name]#</option>
+ #{/availreleases}#
+ </select>
+ &nbsp;&nbsp;<button type="submit" name="downloadRelease" value="DownloadRelease">
+ <img src="/env/grafics/lock.gif" alt="" />
+ Download Release
+ </button><br><br>
+ </form></dd>
+ <dt>Downloaded Releases</dt>
+ <dd><form action="Steering.html" method="get">
+ &nbsp;<select name="releaseinstall">
+ #{downloadedreleases}#
+ <option #(selected)#::selected#(/selected)# value="#[file]#">#[name]#</option>
+ #{/downloadedreleases}#
+ </select>#(deployenabled)#::no&nbsp;automated installation on development environments::
+ &nbsp;&nbsp;<button type="submit" name="update" value="InstallRelease">
+ <img src="/env/grafics/lock.gif" alt="" />
+ Install Release
+ </button>#(/deployenabled)#
+ </form></dd>
+ </dl>
+ </fieldset>
+ #(/candeploy)#
+
+ #%env/templates/footer.template%#
+ </body>
+</html>
diff --git a/htroot/ConfigUpdate_p.java b/htroot/ConfigUpdate_p.java
new file mode 100644
index 000000000..1c8f9bafa
--- /dev/null
+++ b/htroot/ConfigUpdate_p.java
@@ -0,0 +1,156 @@
+// ConfigUpdate_p.java
+// (C) 2007 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
+// first published 11.07.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 java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.TreeSet;
+
+import de.anomic.http.httpHeader;
+import de.anomic.net.URL;
+import de.anomic.plasma.plasmaSwitchboard;
+import de.anomic.server.serverObjects;
+import de.anomic.server.serverSwitch;
+import de.anomic.server.serverSystem;
+import de.anomic.yacy.yacyVersion;
+
+public class ConfigUpdate_p {
+
+ public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
+ // return variable that accumulates replacements
+ final serverObjects prop = new serverObjects();
+ final plasmaSwitchboard sb = (plasmaSwitchboard) env;
+
+ if (post != null) {
+ if (post.containsKey("downloadRelease")) {
+ // download a release
+ String release = post.get("releasedownload", "");
+ if (release.length() > 0) {
+ try {
+ yacyVersion.downloadRelease(new yacyVersion(new URL(release)));
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+
+ }
+
+ // version information
+ String versionstring = yacy.combined2prettyVersion(sb.getConfig("version","0.1"));
+ prop.put("versionpp", versionstring);
+ boolean devenvironment = versionstring.startsWith("dev");
+ double thisVersion = Double.parseDouble(sb.getConfig("version","0.1"));
+ // cut off the SVN Rev in the Version
+ try {thisVersion = Math.round(thisVersion*1000.0)/1000.0;} catch (NumberFormatException e) {}
+
+ if (serverSystem.canExecUnix) {
+ // we can deploy a new system with (i.e.)
+ // cd DATA/RELEASE;tar xfz $1;cp -Rf yacy/* ../../;rm -Rf yacy
+
+ // list downloaded releases
+ yacyVersion release, dflt;
+ String[] downloaded = sb.releasePath.list();
+ prop.put("candeploy", 1);
+ prop.put("candeploy_deployenabled", (downloaded.length == 0) ? 0 : ((devenvironment) ? 1 : 2)); // prevent that a developer-version is over-deployed
+
+ TreeSet downloadedreleases = new TreeSet();
+ for (int j = 0; j < downloaded.length; j++) {
+ try {
+ release = (yacyVersion) new yacyVersion(downloaded[j]);
+ downloadedreleases.add(release);
+ } catch (RuntimeException e) {
+ // not a valid release
+ new File(sb.releasePath, downloaded[j]).deleteOnExit(); // can be also a restart- or deploy-file
+ }
+ }
+ dflt = (downloadedreleases.size() == 0) ? null : (yacyVersion) downloadedreleases.last();
+ Iterator i = downloadedreleases.iterator();
+ int relcount = 0;
+ while (i.hasNext()) {
+ release = (yacyVersion) i.next();
+ prop.put("candeploy_downloadedreleases_" + relcount + "_name", (release.proRelease ? "pro" : "standard") + "/" + ((release.mainRelease) ? "main" : "dev") + " " + release.releaseNr + "/" + release.svn);
+ prop.put("candeploy_downloadedreleases_" + relcount + "_file", release.name);
+ prop.put("candeploy_downloadedreleases_" + relcount + "_selected", (release == dflt) ? 1 : 0);
+ relcount++;
+ }
+ prop.put("candeploy_downloadedreleases", relcount);
+
+ // list remotely available releases
+ TreeSet[] releasess = yacyVersion.allReleases(false); // {0=promain, 1=prodev, 2=stdmain, 3=stddev}
+ relcount = 0;
+ // main
+ TreeSet releases = releasess[(yacy.pro) ? 0 : 2];
+ releases.removeAll(downloadedreleases);
+ i = releases.iterator();
+ while (i.hasNext()) {
+ release = (yacyVersion) i.next();
+ prop.put("candeploy_availreleases_" + relcount + "_name", (release.proRelease ? "pro" : "standard") + "/" + ((release.mainRelease) ? "main" : "dev") + " " + release.releaseNr + "/" + release.svn);
+ prop.put("candeploy_availreleases_" + relcount + "_url", release.url.toString());
+ prop.put("candeploy_availreleases_" + relcount + "_selected", 0);
+ relcount++;
+ }
+ // dev
+ dflt = (releasess[(yacy.pro) ? 1 : 3].size() == 0) ? null : (yacyVersion) releasess[(yacy.pro) ? 1 : 3].last();
+ releases = releasess[(yacy.pro) ? 1 : 3];
+ releases.removeAll(downloadedreleases);
+ i = releases.iterator();
+ while (i.hasNext()) {
+ release = (yacyVersion) i.next();
+ prop.put("candeploy_availreleases_" + relcount + "_name", (release.proRelease ? "pro" : "standard") + "/" + ((release.mainRelease) ? "main" : "dev") + " " + release.releaseNr + "/" + release.svn);
+ prop.put("candeploy_availreleases_" + relcount + "_url", release.url.toString());
+ prop.put("candeploy_availreleases_" + relcount + "_selected", (release == dflt) ? 1 : 0);
+ relcount++;
+ }
+ prop.put("candeploy_availreleases", relcount);
+ } else {
+ prop.put("candeploy", 0);
+ }
+
+ /*
+ if ((adminaccess) && (yacyVersion.latestRelease >= (thisVersion+0.01))) { // only new Versions(not new SVN)
+ if ((yacyVersion.latestMainRelease != null) ||
+ (yacyVersion.latestDevRelease != null)) {
+ prop.put("hintVersionDownload", 1);
+ } else if ((post != null) && (post.containsKey("aquirerelease"))) {
+ yacyVersion.aquireLatestReleaseInfo();
+ prop.put("hintVersionDownload", 1);
+ } else {
+ prop.put("hintVersionAvailable", 1);
+ }
+ }
+ prop.put("hintVersionAvailable", 1); // for testing
+
+ prop.putASIS("hintVersionDownload_versionResMain", (yacyVersion.latestMainRelease == null) ? "-" : yacyVersion.latestMainRelease.toAnchor());
+ prop.putASIS("hintVersionDownload_versionResDev", (yacyVersion.latestDevRelease == null) ? "-" : yacyVersion.latestDevRelease.toAnchor());
+ prop.put("hintVersionAvailable_latestVersion", Double.toString(yacyVersion.latestRelease));
+ */
+
+ return prop;
+ }
+
+}
diff --git a/htroot/PerformanceMemory_p.html b/htroot/PerformanceMemory_p.html
index 25b6086b9..b9a915046 100644
--- a/htroot/PerformanceMemory_p.html
+++ b/htroot/PerformanceMemory_p.html
@@ -6,7 +6,7 @@
</head>
<body id="PerformanceMemory">
#%env/templates/header.template%#
- #%env/templates/submenuPerformance.template%#
+ #%env/templates/submenuConfig.template%#
<h2>Performance Settings for Memory</h2>
<p><strong>Memory Usage:</strong></p>
diff --git a/htroot/PerformanceQueues_p.html b/htroot/PerformanceQueues_p.html
index b38a086ea..0f5ae4ba5 100644
--- a/htroot/PerformanceQueues_p.html
+++ b/htroot/PerformanceQueues_p.html
@@ -6,7 +6,7 @@
</head>
<body id="PerformanceQueues">
#%env/templates/header.template%#
- #%env/templates/submenuPerformance.template%#
+ #%env/templates/submenuConfig.template%#
<h2>Performance Settings of Queues and Processes</h2>
<p>
diff --git a/htroot/PerformanceSearch_p.html b/htroot/PerformanceSearch_p.html
index 787149224..b67663370 100644
--- a/htroot/PerformanceSearch_p.html
+++ b/htroot/PerformanceSearch_p.html
@@ -6,7 +6,7 @@
</head>
<body id="PerformanceSearch">
#%env/templates/header.template%#
- #%env/templates/submenuPerformance.template%#
+ #%env/templates/submenuConfig.template%#
<h2>Timing Settings of Search Sequence</h2>
<p>
diff --git a/htroot/Settings_p.html b/htroot/Settings_p.html
index 80ecf3bf4..f06dee48a 100644
--- a/htroot/Settings_p.html
+++ b/htroot/Settings_p.html
@@ -22,6 +22,7 @@
</head>
<body id="Settings">
#%env/templates/header.template%#
+ #%env/templates/submenuConfig.template%#
<h2>Advanced Settings</h2>
<p>If you want to restore all settings to the default values,
but <strong>forgot your administration password</strong>, you must stop the proxy,
diff --git a/htroot/Status.html b/htroot/Status.html
index ab9785495..cdc75a691 100644
--- a/htroot/Status.html
+++ b/htroot/Status.html
@@ -1,17 +1,19 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>YaCy '#[clientname]#': Status</title>
+ <title>YaCy '#[clientname]#': Console Status</title>
#%env/templates/metas.template%#
<meta http-equiv="REFRESH" content="30" />
</head>
<body style="margin:0px;">
#%env/templates/header.template%#
+ #%env/templates/submenuConfig.template%#
<!--[if IE]>
<div class="gainlayout">
<![endif]-->
- <div class="welcome"><center><h2>Welcome to YaCy!</h2></center>
+ <div class="welcome">
+ <center><h2>Welcome to YaCy!</h2></center>
<dl>
@@ -134,51 +136,6 @@
<div class="sidebar">
- <form action="Steering.html" method="get" class="PeerControl">
- <fieldset>
- <button type="submit" name="restart" value="Restart">
- <img src="/env/grafics/lock.gif" alt="Only the administrator may restart this peer" />
- Restart
- </button>
- <button type="submit" name="shutdown" value="Shutdown">
- <img src="/env/grafics/lock.gif" alt="Only the administrator may shutdown this peer" />
- Shutdown
- </button>
- </fieldset>
- </form>
-
- #(candeploy)#::
- <fieldset>
- <legend>System Update</legend>
- <dl>
- <dt>Available Releases</dt>
- <dd><form action="Status.html" method="get">
- &nbsp;<select name="releasedownload">
- #{availreleases}#
- <option #(selected)#::selected#(/selected)# value="#[url]#">#[name]#</option>
- #{/availreleases}#
- </select>
- &nbsp;&nbsp;<button type="submit" name="downloadRelease" value="DownloadRelease">
- <img src="/env/grafics/lock.gif" alt="" />
- Download Release
- </button><br><br>
- </form></dd>
- <dt>Downloaded Releases</dt>
- <dd><form action="Steering.html" method="get">
- &nbsp;<select name="releaseinstall">
- #{downloadedreleases}#
- <option #(selected)#::selected#(/selected)# value="#[file]#">#[name]#</option>
- #{/downloadedreleases}#
- </select>#(deployenabled)#::no&nbsp;automated installation on development environments::
- &nbsp;&nbsp;<button type="submit" name="update" value="InstallRelease">
- <img src="/env/grafics/lock.gif" alt="" />
- Install Release
- </button>#(/deployenabled)#
- </form></dd>
- </dl>
- </fieldset>
- #(/candeploy)#
-
<fieldset>
<legend>Public System Properties</legend>
<dl>
diff --git a/htroot/Status.java b/htroot/Status.java
index da5c0dbfd..a2c061023 100644
--- a/htroot/Status.java
+++ b/htroot/Status.java
@@ -46,12 +46,9 @@
// javac -classpath .:../Classes Status.java
// if the shell's current path is HTROOT
-import java.io.File;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.Date;
-import java.util.Iterator;
-import java.util.TreeSet;
import de.anomic.http.httpHeader;
import de.anomic.http.httpd;
@@ -64,7 +61,6 @@ import de.anomic.server.serverDate;
import de.anomic.server.serverMemory;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
-import de.anomic.server.serverSystem;
import de.anomic.yacy.yacyCore;
import de.anomic.yacy.yacySeed;
import de.anomic.yacy.yacyVersion;
@@ -160,92 +156,11 @@ public class Status {
// version information
String versionstring = yacy.combined2prettyVersion(sb.getConfig("version","0.1"));
prop.put("versionpp", versionstring);
- boolean devenvironment = versionstring.startsWith("dev");
double thisVersion = Double.parseDouble(sb.getConfig("version","0.1"));
+
// cut off the SVN Rev in the Version
try {thisVersion = Math.round(thisVersion*1000.0)/1000.0;} catch (NumberFormatException e) {}
- if (serverSystem.canExecUnix) {
- // we can deploy a new system with (i.e.)
- // cd DATA/RELEASE;tar xfz $1;cp -Rf yacy/* ../../;rm -Rf yacy
-
- // list downloaded releases
- yacyVersion release, dflt;
- String[] downloaded = sb.releasePath.list();
- prop.put("candeploy", 1);
- prop.put("candeploy_deployenabled", (downloaded.length == 0) ? 0 : ((devenvironment) ? 1 : 2)); // prevent that a developer-version is over-deployed
-
- TreeSet downloadedreleases = new TreeSet();
- for (int j = 0; j < downloaded.length; j++) {
- try {
- release = (yacyVersion) new yacyVersion(downloaded[j]);
- downloadedreleases.add(release);
- } catch (RuntimeException e) {
- // not a valid release
- new File(sb.releasePath, downloaded[j]).deleteOnExit(); // can be also a restart- or deploy-file
- }
- }
- dflt = (downloadedreleases.size() == 0) ? null : (yacyVersion) downloadedreleases.last();
- Iterator i = downloadedreleases.iterator();
- int relcount = 0;
- while (i.hasNext()) {
- release = (yacyVersion) i.next();
- prop.put("candeploy_downloadedreleases_" + relcount + "_name", (release.proRelease ? "pro" : "standard") + "/" + ((release.mainRelease) ? "main" : "dev") + " " + release.releaseNr + "/" + release.svn);
- prop.put("candeploy_downloadedreleases_" + relcount + "_file", release.name);
- prop.put("candeploy_downloadedreleases_" + relcount + "_selected", (release == dflt) ? 1 : 0);
- relcount++;
- }
- prop.put("candeploy_downloadedreleases", relcount);
-
- // list remotely available releases
- TreeSet[] releasess = yacyVersion.allReleases(); // {0=promain, 1=prodev, 2=stdmain, 3=stddev}
- relcount = 0;
- // main
- TreeSet releases = releasess[(yacy.pro) ? 0 : 2];
- releases.removeAll(downloadedreleases);
- i = releases.iterator();
- while (i.hasNext()) {
- release = (yacyVersion) i.next();
- prop.put("candeploy_availreleases_" + relcount + "_name", (release.proRelease ? "pro" : "standard") + "/" + ((release.mainRelease) ? "main" : "dev") + " " + release.releaseNr + "/" + release.svn);
- prop.put("candeploy_availreleases_" + relcount + "_url", release.url.toString());
- prop.put("candeploy_availreleases_" + relcount + "_selected", 0);
- relcount++;
- }
- // dev
- dflt = (releasess[(yacy.pro) ? 1 : 3].size() == 0) ? null : (yacyVersion) releasess[(yacy.pro) ? 1 : 3].last();
- releases = releasess[(yacy.pro) ? 1 : 3];
- releases.removeAll(downloadedreleases);
- i = releases.iterator();
- while (i.hasNext()) {
- release = (yacyVersion) i.next();
- prop.put("candeploy_availreleases_" + relcount + "_name", (release.proRelease ? "pro" : "standard") + "/" + ((release.mainRelease) ? "main" : "dev") + " " + release.releaseNr + "/" + release.svn);
- prop.put("candeploy_availreleases_" + relcount + "_url", release.url.toString());
- prop.put("candeploy_availreleases_" + relcount + "_selected", (release == dflt) ? 1 : 0);
- relcount++;
- }
- prop.put("candeploy_availreleases", relcount);
- } else {
- prop.put("candeploy", 0);
- }
-
- /*
- if ((adminaccess) && (yacyVersion.latestRelease >= (thisVersion+0.01))) { // only new Versions(not new SVN)
- if ((yacyVersion.latestMainRelease != null) ||
- (yacyVersion.latestDevRelease != null)) {
- prop.put("hintVersionDownload", 1);
- } else if ((post != null) && (post.containsKey("aquirerelease"))) {
- yacyVersion.aquireLatestReleaseInfo();
- prop.put("hintVersionDownload", 1);
- } else {
- prop.put("hintVersionAvailable", 1);
- }
- }
- prop.put("hintVersionAvailable", 1); // for testing
-
- prop.putASIS("hintVersionDownload_versionResMain", (yacyVersion.latestMainRelease == null) ? "-" : yacyVersion.latestMainRelease.toAnchor());
- prop.putASIS("hintVersionDownload_versionResDev", (yacyVersion.latestDevRelease == null) ? "-" : yacyVersion.latestDevRelease.toAnchor());
- prop.put("hintVersionAvailable_latestVersion", Double.toString(yacyVersion.latestRelease));
- */
// place some more hints
if ((adminaccess) && (sb.getThread(plasmaSwitchboard.CRAWLJOB_LOCAL_CRAWL).getJobCount() == 0) && (sb.getThread(plasmaSwitchboard.INDEXER).getJobCount() == 0)) {
prop.put("hintCrawlStart", 1);
@@ -255,8 +170,6 @@ public class Status {
prop.put("hintCrawlMonitor", 1);
}
-
-
// hostname and port
String extendedPortString = sb.getConfig("port", "8080");
int pos = extendedPortString.indexOf(":");
diff --git a/htroot/User_p.html b/htroot/User_p.html
index 188e79fdc..54e753550 100644
--- a/htroot/User_p.html
+++ b/htroot/User_p.html
@@ -6,6 +6,7 @@
</head>
<body>
#%env/templates/header.template%#
+ #%env/templates/submenuConfig.template%#
<h2>User Administration</h2>
<!-- Page 1: Results -->
diff --git a/htroot/env/base.css b/htroot/env/base.css
index 0aa197ebb..9c9ba6afb 100644
--- a/htroot/env/base.css
+++ b/htroot/env/base.css
@@ -332,6 +332,7 @@ h2.yacy { /* The heading in index.html */
}
div.welcome { /* The heading in Status.html */
+ clear:left;
float:left;
margin:10px 0;
padding-top:130px;
@@ -358,7 +359,7 @@ li.menugroup h3{
margin: 0; padding: 1px 10px;
}
-div.SubMenugroup h3{
+div.SubMenugroup h3 {
font-size:1em;
font-weight:bold;
margin:0;
@@ -439,7 +440,7 @@ a.deletelink:hover, div.searchresults:hover a.deletelink, div.searchresults.hove
background:url(/env/grafics/minus.gif) center center no-repeat;
}
-ul.SubMenu a.MenuItemLink{
+ul.SubMenu a.MenuItemLink {
margin-top:0;
}
@@ -487,6 +488,7 @@ ul.tagList {
ul.menu, ul.SubMenu {
+ clear:left;
padding:0;
margin:0;
}
diff --git a/htroot/env/templates/header.template b/htroot/env/templates/header.template
index 7effa54d1..ac2c77664 100644
--- a/htroot/env/templates/header.template
+++ b/htroot/env/templates/header.template
@@ -44,26 +44,22 @@
</ul>
</li>
<li class="menugroup" id="menugroupPeerControl">
- <h3>Peer Configuration</h3>
+ <h3>Peer Control</h3>
<ul class="menu">
- <li><a href="/Status.html" accesskey="t" class="MenuItemLink">Status &amp; Shutdown</a></li>
- <li><a href="/ConfigBasic.html" class="MenuItemLink lock">Basic Configuration</a></li>
- <li><a href="/Settings_p.html" class="MenuItemLink lock">Advanced Settings</a></li>
- <li><a href="/User_p.html" class="MenuItemLink lock">User Administration</a></li>
- <li><a href="/PerformanceQueues_p.html" class="MenuItemLink lock">Performance</a></li>
+ <li><a href="/Status.html" accesskey="t" class="MenuItemLink">Admin Console</a></li>
+ <li><a href="/Steering.html?restart=" class="MenuItemLink lock">Re-Start</a></li>
+ <li><a href="/Steering.html?shutdown=" class="MenuItemLink lock">Shutdown</a></li>
</ul>
</li>
<li class="menugroup" id="menugroupTheProjekt">
<h3>The Project</h3>
<ul class="menu">
<li><a href="http://www.yacy.net/yacy/" class="MenuItemLink">Project Home</a></li>
- <li><a href="http://www.yacy.net/yacy/News.html" class="MenuItemLink">Project News</a></li>
<li><a href="http://forum.yacy.de" class="MenuItemLink">Deutsches Forum</a></li>
<li><a href="http://yacy-forum.huzzaar.com" class="MenuItemLink">English Forum</a></li>
<li><a href="http://www.yacy.net/yacy/Download.html" class="MenuItemLink">Download YaCy</a></li>
<li><a href="http://www.yacy-websuche.de/wiki/index.php/Hauptseite" class="MenuItemLink">YaCy Project Wiki</a></li>
<li><a href="http://www.yacystats.de" class="MenuItemLink">YaCy Community Statistics</a></li>
- <li><a href="http://www.yacy.net/yacy/Contact.html" class="MenuItemLink">Contact YaCy Developer</a></li>
</ul>
</li>
</ul>
diff --git a/htroot/env/templates/submenuConfig.template b/htroot/env/templates/submenuConfig.template
index 717450126..0c8900c64 100644
--- a/htroot/env/templates/submenuConfig.template
+++ b/htroot/env/templates/submenuConfig.template
@@ -1,12 +1,27 @@
<div class="SubMenu">
- <h3>Peer Configuration Menu</h3>
+ <h3>Peer Administration Console</h3>
<ul class="SubMenu">
- <li><a href="/ConfigBasic.html" class="MenuItemLink lock">Basic Configuraton</a></li>
+ <li><a href="/Status.html" class="MenuItemLink lock">Status</a></li>
+ <li><a href="/ConfigBasic.html" class="MenuItemLink lock">Access Config</a></li>
<li><a href="/ConfigLanguage_p.html" class="MenuItemLink lock">Language</a></li>
+ <li><a href="/ConfigProfile_p.html" class="MenuItemLink lock">Profile</a></li>
+ <li><a href="/ConfigSkins_p.html" class="MenuItemLink lock">Skins</a></li>
+ <li><a href="/ConfigUpdate_p.html" class="MenuItemLink lock">System Update</a></li>
+ </ul>
+</div>
+<div class="SubMenu">
+ <ul class="SubMenu">
<li><a href="/ConfigNetwork_p.html" class="MenuItemLink lock">Network</a></li>
- <li><a href="/ConfigProfile_p.html" class="MenuItemLink lock">Peer Profile</a></li>
- <li><a href="/ConfigSkins_p.html" class="MenuItemLink lock">Interface Skins</a></li>
<li><a href="/ConfigRobotsTxt_p.html" class ="MenuItemLink lock">Local robots.txt</a></li>
- <li><a href="/ConfigAdvanced_p.html" class="MenuItemLink lock">Advanced</a></li>
+ <li><a href="/User_p.html" class="MenuItemLink lock">User Administration</a></li>
+ <li><a href="/Settings_p.html" class="MenuItemLink lock">Advanced Settings</a></li>
+ <li><a href="/ConfigProperties_p.html" class="MenuItemLink lock">Advanced Properties</a></li>
+ </ul>
+</div>
+<div class="SubMenu">
+ <ul class="SubMenu">
+ <li><a href="/PerformanceQueues_p.html" class="MenuItemLink lock">Queues Performance Settings</a></li>
+ <li><a href="/PerformanceMemory_p.html" class="MenuItemLink lock">Memory Settings for Database Caches</a></li>
+ <li><a href="/PerformanceSearch_p.html" class="MenuItemLink lock">Timing Settings for Search Sequence</a></li>
</ul>
</div> \ No newline at end of file
diff --git a/htroot/env/templates/submenuPerformance.template b/htroot/env/templates/submenuPerformance.template
deleted file mode 100644
index fc5378c2e..000000000
--- a/htroot/env/templates/submenuPerformance.template
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class="SubMenu">
-<h3>Performance Menu</h3>
-<ul class="SubMenu">
-<li><a href="/PerformanceQueues_p.html" class="MenuItemLink lock">Queues Performance Settings</a></li>
-<li><a href="/PerformanceMemory_p.html" class="MenuItemLink lock">Memory Settings for Database Caches</a></li>
-<li><a href="/PerformanceSearch_p.html" class="MenuItemLink lock">Timing Settings for Search Sequence</a></li>
-</ul>
-</div> \ No newline at end of file
diff --git a/source/de/anomic/yacy/yacyVersion.java b/source/de/anomic/yacy/yacyVersion.java
index 1d7dc8dc1..d17c05f10 100644
--- a/source/de/anomic/yacy/yacyVersion.java
+++ b/source/de/anomic/yacy/yacyVersion.java
@@ -63,6 +63,9 @@ public final class yacyVersion implements Comparator, Comparable {
private static HashMap /* URL:TreeSet[]*/ latestReleases = new HashMap();
public static ArrayList latestReleaseLocations /*string*/ = new ArrayList(); // will be initialized with value in yacy.network.unit
+ // private static release info about this release; is generated only once and can be retrieved by thisVersion()
+ private static yacyVersion thisVersion = null;
+
// class variables
public float releaseNr;
public String dateStamp;
@@ -124,6 +127,7 @@ public final class yacyVersion implements Comparator, Comparable {
}
public int compareTo(Object obj) {
+ // returns 0 if this object is equal to the obj, -1 if this is smaller than obj and 1 if this is greater than obj
yacyVersion v = (yacyVersion) obj;
return compare(this, v);
}
@@ -150,12 +154,83 @@ public final class yacyVersion implements Comparator, Comparable {
return "<a href=" + this.url.toNormalform() + ">YaCy " + ((this.proRelease) ? "pro release" : "standard release") + " v" + this.releaseNr + ", SVN " + this.svn + "</a>";
}
- public static TreeSet[] allReleases() {
+ // static methods:
+
+ public static final yacyVersion thisVersion() {
+ // construct a virtual release name for this release
+ if (thisVersion == null) {
+ plasmaSwitchboard sb = plasmaSwitchboard.getSwitchboard();
+ boolean pro = new File(sb.getRootPath(), "libx").exists();
+ thisVersion = new yacyVersion(
+ "yacy" + ((pro) ? "_pro" : "") +
+ "_v" + sb.getConfig("version", "0.1") + "_" +
+ sb.getConfig("vdate", "19700101") + "_" +
+ sb.getConfig("svnRevision", "0") + ".tar.gz");
+ }
+ return thisVersion;
+ }
+
+ public static final boolean shallRetrieveUpdateInfo() {
+ // according to update properties, decide if we should retrieve update information
+ plasmaSwitchboard sb = plasmaSwitchboard.getSwitchboard();
+
+ // check if update process allowes update retrieve
+ String process = sb.getConfig("update.process", "manual");
+ if (process.equals("manual")) return false; // no, its a manual process
+
+ // check if the last retrieve time is a minimum time ago
+ long cycle = Math.max(1, sb.getConfigLong("update.cycle", 168)) * 24 * 60 * 60 * 1000;
+ long timeLookup = sb.getConfigLong("update.time.lookup", System.currentTimeMillis());
+ if (timeLookup + cycle > System.currentTimeMillis()) return false; // no we have recently made a lookup
+
+ // ok, we may do a lookup
+ return true;
+ }
+
+ public static final yacyVersion shallRetrieveReleaseAutomatically() {
+ // according to update properties, decide if we should retrieve update information
+ // if true, the release that can be obtained is returned.
+ // if false, null is returned
+
+ plasmaSwitchboard sb = plasmaSwitchboard.getSwitchboard();
+
+ // check if update process allowes automatic update retrieve
+ String process = sb.getConfig("update.process", "manual");
+ if (!process.equals("auto")) return null; // no, its a manual or guided process
+
+ // check if we have a release info
+ if ((latestReleases == null) || (latestReleases.size() == 0)) return null; // no info available
+
+ // check if we know that there is a release that is more recent that that which we are using
+ TreeSet[] releasess = yacyVersion.allReleases(true); // {0=promain, 1=prodev, 2=stdmain, 3=stddev}
+ boolean pro = new File(sb.getRootPath(), "libx").exists();
+ yacyVersion latestmain = (yacyVersion) releasess[(pro) ? 0 : 2].first();
+ yacyVersion latestdev = (yacyVersion) releasess[(pro) ? 1 : 3].first();
+ String concept = sb.getConfig("update.concept", "any");
+ String blacklist = sb.getConfig("update.blacklist", ".\\...[123]");
+ if (concept.equals("any")) {
+ // return a dev-release or a main-release
+ if ((latestdev.compareTo(latestmain) > 0) && (!(Float.toString(latestdev.releaseNr).matches(blacklist)))) {
+ return (latestdev.compareTo(thisVersion()) > 0) ? latestdev : null;
+ } else {
+ if ((Float.toString(latestmain.releaseNr).matches(blacklist))) return null;
+ return (latestmain.compareTo(thisVersion()) > 0) ? latestmain : null;
+ }
+ }
+ if (concept.equals("main")) {
+ // return a main-release
+ if ((Float.toString(latestmain.releaseNr).matches(blacklist))) return null;
+ return (latestmain.compareTo(thisVersion()) > 0) ? latestmain : null;
+ }
+ return null;
+ }
+
+ public static TreeSet[] allReleases(boolean force) {
// join the release infos
// {promainreleases, prodevreleases, stdmainreleases, stddevreleases}
Object[] a = new Object[latestReleaseLocations.size()];
for (int j = 0; j < latestReleaseLocations.size(); j++) {
- a[j] = getReleases((URL) latestReleaseLocations.get(j));
+ a[j] = getReleases((URL) latestReleaseLocations.get(j), force);
}
TreeSet[] r = new TreeSet[4];
TreeSet s;
@@ -169,11 +244,12 @@ public final class yacyVersion implements Comparator, Comparable {
return r;
}
- private static TreeSet[] getReleases(URL location) {
+ private static TreeSet[] getReleases(URL location, boolean force) {
// get release info from a internet resource
// {promainreleases, prodevreleases, stdmainreleases, stddevreleases}
TreeSet[] latestRelease = (TreeSet[]) latestReleases.get(location);
- if ((latestRelease == null) ||
+ if (force ||
+ (latestRelease == null) ||
((latestRelease[0].size() == 0) &&
(latestRelease[1].size() == 0) &&
(latestRelease[2].size() == 0) &&
@@ -223,6 +299,7 @@ public final class yacyVersion implements Comparator, Comparable {
continue;
}
}
+ plasmaSwitchboard.getSwitchboard().setConfig("update.time.lookup", System.currentTimeMillis());
return new TreeSet[] {promainreleases, prodevreleases, stdmainreleases, stddevreleases} ;
}
@@ -241,13 +318,16 @@ public final class yacyVersion implements Comparator, Comparable {
download
);
if ((!download.exists()) || (download.length() == 0)) throw new IOException("wget of url " + release.url + " failed");
+ plasmaSwitchboard.getSwitchboard().setConfig("update.time.download", System.currentTimeMillis());
}
public static void restart() {
+ plasmaSwitchboard sb = plasmaSwitchboard.getSwitchboard();
+
if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
// create yacy.restart file which is used in Windows startscript
- final File yacyRestart = new File(plasmaSwitchboard.getSwitchboard().getRootPath(), "DATA/yacy.restart");
+ final File yacyRestart = new File(sb.getRootPath(), "DATA/yacy.restart");
if (!yacyRestart.exists()) {
try {
yacyRestart.createNewFile();
@@ -264,18 +344,18 @@ public final class yacyVersion implements Comparator, Comparable {
try {
serverLog.logInfo("RESTART", "INITIATED");
String script =
- "cd " + plasmaSwitchboard.getSwitchboard().getRootPath() + "/DATA/RELEASE/" + serverCore.lfstring +
+ "cd " + sb.getRootPath() + "/DATA/RELEASE/" + serverCore.lfstring +
"while [ -e ../yacy.running ]; do" + serverCore.lfstring +
"sleep 1" + serverCore.lfstring +
"done" + serverCore.lfstring +
"cd ../../" + serverCore.lfstring +
"nohup ./startYACY.sh > /dev/null" + serverCore.lfstring;
- File scriptFile = new File(plasmaSwitchboard.getSwitchboard().getRootPath(), "DATA/RELEASE/restart.sh");
+ File scriptFile = new File(sb.getRootPath(), "DATA/RELEASE/restart.sh");
serverSystem.deployScript(scriptFile, script);
serverLog.logInfo("RESTART", "wrote restart-script to " + scriptFile.getAbsolutePath());
serverSystem.execAsynchronous(scriptFile);
serverLog.logInfo("RESTART", "script is running");
- plasmaSwitchboard.getSwitchboard().terminate(5000);
+ sb.terminate(5000);
} catch (IOException e) {
serverLog.logSevere("RESTART", "restart failed", e);
}
@@ -285,9 +365,10 @@ public final class yacyVersion implements Comparator, Comparable {
public static void deployRelease(String release) {
//byte[] script = ("cd " + plasmaSwitchboard.getSwitchboard().getRootPath() + ";while [ -e ../yacy.running ]; do sleep 1;done;tar xfz " + release + ";cp -Rf yacy/* ../../;rm -Rf yacy;cd ../../;startYACY.sh").getBytes();
try {
+ plasmaSwitchboard sb = plasmaSwitchboard.getSwitchboard();
serverLog.logInfo("UPDATE", "INITIATED");
String script =
- "cd " + plasmaSwitchboard.getSwitchboard().getRootPath() + "/DATA/RELEASE/" + serverCore.lfstring +
+ "cd " + sb.getRootPath() + "/DATA/RELEASE/" + serverCore.lfstring +
"tar xfz " + release + serverCore.lfstring +
"while [ -e ../yacy.running ]; do" + serverCore.lfstring +
"sleep 1" + serverCore.lfstring +
@@ -296,12 +377,13 @@ public final class yacyVersion implements Comparator, Comparable {
"rm -Rf yacy" + serverCore.lfstring +
"cd ../../" + serverCore.lfstring +
"nohup ./startYACY.sh > /dev/null" + serverCore.lfstring;
- File scriptFile = new File(plasmaSwitchboard.getSwitchboard().getRootPath(), "DATA/RELEASE/update.sh");
+ File scriptFile = new File(sb.getRootPath(), "DATA/RELEASE/update.sh");
serverSystem.deployScript(scriptFile, script);
serverLog.logInfo("UPDATE", "wrote update-script to " + scriptFile.getAbsolutePath());
serverSystem.execAsynchronous(scriptFile);
serverLog.logInfo("UPDATE", "script is running");
- plasmaSwitchboard.getSwitchboard().terminate(5000);
+ sb.setConfig("update.time.deploy", System.currentTimeMillis());
+ sb.terminate(5000);
} catch (IOException e) {
serverLog.logSevere("UPDATE", "update failed", e);
}
diff --git a/source/yacy.java b/source/yacy.java
index e979d2e62..c857ed424 100644
--- a/source/yacy.java
+++ b/source/yacy.java
@@ -133,14 +133,15 @@ import de.anomic.yacy.yacyVersion;
*/
public final class yacy {
+
// static objects
- private static String vString = "@REPL_VERSION@";
- private static double version = 0.1;
- public static boolean pro;
+ public static final String vString = "@REPL_VERSION@";
+ public static double version = 0.1;
+ public static boolean pro;
- private static final String vDATE = "@REPL_DATE@";
- private static final String copyright = "[ YaCy v" + vString + ", build " + vDATE + " by Michael Christen / www.yacy.net ]";
- private static final String hline = "-------------------------------------------------------------------------------";
+ public static final String vDATE = "@REPL_DATE@";
+ public static final String copyright = "[ YaCy v" + vString + ", build " + vDATE + " by Michael Christen / www.yacy.net ]";
+ public static final String hline = "-------------------------------------------------------------------------------";
/**
* a reference to the {@link plasmaSwitchboard} created by the
diff --git a/yacy.init b/yacy.init
index 9e293609d..ad96d050b 100644
--- a/yacy.init
+++ b/yacy.init
@@ -73,6 +73,32 @@ server.maxTrackingTime = 3600000
network.unit.definition = yacy.network.unit
network.group.definition = yacy.network.group
+# Update process properties
+# The update server location is given in the network.unit.definition,
+# but the settings for update processing and cycles are individual.
+# the update process can be either 'manual' (no automatic lookup for new versions),
+# 'guided' (automatic lookup, but user is asked before update is performed',
+# or 'auto' (whenever an update is available, the update is loaded and installed)
+update.process = manual
+# the cycle value applies only if the process is automatic or guided. The value means hours.
+# There is currently a fixed minimum number of hours of 24 hours for updates
+update.cycle = 168
+# a version number blacklist can restrict automatic or guided updates to a specific
+# range of version numbers. The restriction is done with a blacklist (standard regexpr)
+# It is recommended to set this list to low developer version numbers
+update.blacklist = .\...[123]
+# a update can also restricted with a concept property, which can decide if an
+# update is only valid if it either is a main release or any svn release including new development releases
+# Valid keywords are 'main' and 'any'
+update.concept = any
+# the following values are set automatically:
+# the lookup time when the last time a lookup to the network update server(s) where done
+update.time.lookup = 0
+# the download time when the last time a release was downloaded
+update.time.download = 0
+# the deploy time when the last update was done; milliseconds since epoch
+update.time.deploy = 0
+
# clusters within a network:
# every network can have an unlimited number of clusters. Clusters may be also completely
# sealed and have no connection to other peers. When a cluster does not use the
diff --git a/yacy.network.unit b/yacy.network.unit
index d7106b2b4..0790fd1ed 100644
--- a/yacy.network.unit
+++ b/yacy.network.unit
@@ -66,7 +66,7 @@ network.unit.bootstrap.seedlist6 = http://www.dc-art.de/yacy/seed.txt
# the auto-updater can access network-specific update locations
network.unit.update.location0 = http://yacy.net/yacy/Download.html
network.unit.update.location1 = http://latest.yacy.net
-network.unit.update.location2 = http://latest.yacy-forum.net
+network.unit.update.location2 = http://www.findenstattsuchen.info/YaCy/latest/index.php
# properties for in-protocol response authentification:
network.unit.protocol.control = uncontrolled