* fix: display proper port on 1st startup

* new message on portchange
* first implementation of external link-update for search page (still inactive)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4915 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
lotus 17 years ago
parent 0727bb1e63
commit 48edbef5c7

@ -18,6 +18,9 @@
#%env/templates/header.template%#
#%env/templates/submenuConfig.template%#
<h2>Basic Configuration</h2>
#(reconnect)#::
<p><strong>Your port has changed. Please wait 10 seconds.</strong></p>
#(/reconnect)#
<p>
Your YaCy Peer needs some basic information to operate properly
</p>

@ -60,6 +60,7 @@ import de.anomic.server.serverInstantBusyThread;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
import de.anomic.yacy.yacySeed;
import de.anomic.yacy.yacyAccessible;
public class ConfigBasic {
@ -141,6 +142,10 @@ public class ConfigBasic {
prop.put("reconnect_sslSupport", theServerCore.withSSL() ? "1" : "0");
prop.put("nextStep_sslSupport", theServerCore.withSSL() ? "1" : "0");
// generate new shortcut (used for Windows)
//yacyAccessible.setNewPortLink(Integer.parseInt(port));
// TODO: Windows doesn't open new location even when new content is written to file (some cache seem to be active)
// force reconnection in 7 seconds
theServerCore.reconnect(7000);
} else {

@ -47,7 +47,32 @@
package de.anomic.yacy;
import java.io.File;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.server.serverCore;
import de.anomic.server.serverFileUtils;
public class yacyAccessible {
public long lastUpdated;
public boolean IWasAccessed;
/**
* updates Shortcut /addon/YaCy-Search.url
* @param newPort
*/
public static void setNewPortLink(int newPort){
try {
plasmaSwitchboard sb = plasmaSwitchboard.getSwitchboard();
File shortcut = new File(sb.getRootPath() + "/addon/YaCy-Search.url".replace("/", File.separator));
// FIXME (doesn't work) try destroying some Windows cache
shortcut.delete();
String content =
"[InternetShortcut]" + serverCore.LF_STRING +
"URL=http://localhost:" + newPort + "/" + serverCore.LF_STRING;
serverFileUtils.copy(content.getBytes(), shortcut);
} catch (Exception e) {
return;
}
}
}

@ -16,6 +16,7 @@ set jms=
set javacmd=-Xmx120m -Xms120m
set priolvl=0
set priority=/NORMAL
set port=8080
if exist DATA\SETTINGS\httpProxy.conf GoTo :RENAMEINDEX
if exist DATA\SETTINGS\yacy.conf GoTo :GETSTARTOPTS
@ -63,7 +64,6 @@ for /F "tokens=1,2 delims==" %%i in (DATA\SETTINGS\yacy.conf) do (
)
if defined jmx set javacmd=-%jmx%
if defined jms set javacmd=-%jms% %javacmd%
if not defined port set port=8080
if defined priolvl (
if %priolvl% == 20 set priority=/LOW
if %priolvl% == 10 set priority=/BELOWNORMAL

Loading…
Cancel
Save