Skip to content

Commit

Permalink
fixed configuration of repository path
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6002 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Jun 1, 2009
1 parent daee735 commit 5eac607
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion htroot/ConfigBasic.html
Expand Up @@ -54,7 +54,7 @@ <h2>Basic Configuration</h2>
<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>
Expand Down
9 changes: 9 additions & 0 deletions htroot/ConfigBasic.java
Expand Up @@ -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;
Expand Down Expand Up @@ -170,6 +171,13 @@ public static serverObjects respond(final httpRequestHeader header, final server
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, "");
Expand All @@ -186,6 +194,7 @@ public static serverObjects respond(final httpRequestHeader header, final server
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);
Expand Down

0 comments on commit 5eac607

Please sign in to comment.