fixed configuration of repository path

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6002 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent daee735ad7
commit 5eac607166

@ -54,7 +54,7 @@
<td><label for="usecaseFreeworld">join and support the global network 'freeworld', search the web with an uncensored user-owned search network</label></td>
<td><label for="usecasePortal">your YaCy installation behaves independently from other peers and you define your own web index by starting your own web crawl. This can be used to search your own web pages or to define a topic-oriented search portal.</label></td>
<td><label for="usecaseIntranet">create a search portal for your intranet web pages, or pages that are placed at DATA/HTDOCS/repository and can be accessed at <a href="http://localhost:#[port]#/repository/">http://localhost:#[port]#/repository</a></label>
<input type="file" name="repository" size="10" value="/DATA/HTROOT/repositry"></td>
<input type="text" name="repositoryPath" size="37" value="#[repositoryPath]#"></td>
</tr>
</table>
</fieldset>

@ -28,6 +28,7 @@
// javac -classpath .:../classes ConfigBasic_p.java
// if the shell's current path is HTROOT
import java.io.File;
import java.util.regex.Pattern;
import de.anomic.data.translator;
@ -170,6 +171,13 @@ public class ConfigBasic {
sb.setConfig(plasmaSwitchboardConstants.INDEX_DIST_ALLOW, false);
sb.setConfig(plasmaSwitchboardConstants.INDEX_RECEIVE_ALLOW, false);
}
if (post.get("usecase", "").equals("intranet")) {
String repositoryPath = post.get("repositoryPath", "/DATA/HTROOT/repositry");
File repository = new File(sb.getRootPath(), repositoryPath);
if (repository.exists() && repository.isDirectory()) {
sb.setConfig("repositoryPath", repositoryPath);
}
}
}
networkName = sb.getConfig(plasmaSwitchboardConstants.NETWORK_NAME, "");
@ -186,6 +194,7 @@ public class ConfigBasic {
prop.put("setUseCase", 0);
}
prop.put("setUseCase_port", port);
prop.put("setUseCase_repositoryPath", sb.getConfig("repositoryPath", "/DATA/HTROOT/repositry"));
// check if values are proper
final boolean properPassword = (sb.getConfig(httpd.ADMIN_ACCOUNT_B64MD5, "").length() > 0) || sb.getConfigBool("adminAccountForLocalhost", false);

Loading…
Cancel
Save