Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fixed configuration of repository path

orbiter5eac60716620
diff --git a/htroot/ConfigBasic.html b/htroot/ConfigBasic.html
index 4e6e91d9a..8795295cc 100644
--- a/htroot/ConfigBasic.html
+++ b/htroot/ConfigBasic.html
@@ -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>
diff --git a/htroot/ConfigBasic.java b/htroot/ConfigBasic.java
index e85b11c77..c22cad8b9 100644
--- a/htroot/ConfigBasic.java
+++ b/htroot/ConfigBasic.java
@@ -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);