local Bootstrapping bug.

use yacyDebugMode=true to allow local bootstrapping


git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@572 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 20 years ago
parent 330eae7cf3
commit eb6365c069

@ -48,6 +48,7 @@ import de.anomic.http.httpc;
import de.anomic.server.serverCore;
import de.anomic.tools.disorderHeap;
import de.anomic.tools.nxTools;
import de.anomic.plasma.plasmaSwitchboard;
public class natLib {
@ -122,9 +123,14 @@ public class natLib {
}
public static boolean isProper(String ip) {
plasmaSwitchboard sb=plasmaSwitchboard.getSwitchboard();
String yacyDebugMode = sb.getConfig("yacyDebugMode", "false");
if(yacyDebugMode.equals("true")){
return true;
}
if (ip == null) return false;
if (ip.indexOf(":") >= 0) return false; // ipv6...
return ((isNotLocal(ip)) && (isIP(ip)));
return ( isNotLocal(ip)) && (isIP(ip) );
}
private static int retrieveOptions() {
@ -139,12 +145,12 @@ public class natLib {
return null;
}
public static String retrieveIP(boolean DI604, String password, boolean yacyDebugMode) {
public static String retrieveIP(boolean DI604, String password) {
String ip;
if (DI604) {
// first try the simple way...
ip = getDI604(password);
if (isProper(ip)||yacyDebugMode) {
if (isProper(ip)) {
//System.out.print("{DI604}");
return ip;
}
@ -154,7 +160,7 @@ public class natLib {
InetAddress ia = serverCore.publicIP();
if (ia != null) {
ip = ia.getHostAddress();
if (isProper(ip)||yacyDebugMode) return ip;
if (isProper(ip)) return ip;
}
// now go the uneasy way and ask some web responder

@ -189,6 +189,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
private Object crawlingPausedSync = new Object();
private boolean crawlingIsPaused = false;
private static plasmaSwitchboard sb;
public plasmaSwitchboard(String rootPath, String initPath, String configPath) throws IOException {
super(rootPath, initPath, configPath);
@ -404,8 +405,13 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
//plasmaSnippetCache.result scr = snippetCache.retrieve(new URL("http://www.heise.de/security/news/foren/go.shtml?read=1&msg_id=7301419&forum_id=72721"), query, true);
//plasmaSnippetCache.result scr = snippetCache.retrieve(new URL("http://www.heise.de/kiosk/archiv/ct/2003/4/20"), query, true, 260);
sb=this;
log.logSystem("Finished Switchboard Initialization");
}
public static plasmaSwitchboard getSwitchboard(){
return sb;
}
public boolean onlineCaution() {
try {

@ -470,7 +470,7 @@ public class yacyCore {
String DI604pw = switchboard.getConfig("DI604pw", "");
String ip = switchboard.getConfig("staticIP", "");
if(ip.equals("")){
ip = natLib.retrieveIP(DI604use, DI604pw, (switchboard.getConfig("yacyDebugMode", "false")=="false" ? false : true));
ip = natLib.retrieveIP(DI604use, DI604pw);
}
//yacyCore.log.logDebug("DEBUG: new IP=" + ip);
seedDB.mySeed.put("IP", ip);

Loading…
Cancel
Save