Skip to content

Commit

Permalink
Merge pull request rundeck#1819 from sebastianopilla/development
Browse files Browse the repository at this point in the history
Place Jetty work directory outside of the installation tree
  • Loading branch information
gschueler committed Apr 21, 2016
2 parents 69e3f79 + 0519545 commit 30023a1
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class RunServer {
private static final String SYS_PROP_ROLE_CLASS_NAMES = "loginmodule.role.classnames";
public static final String SYS_PROP_WEB_CONTEXT = "server.web.context";
File configdir;
File workdir;
String loginmodulename;
String roleclassnames;
private boolean useJaas;
Expand All @@ -73,6 +74,7 @@ public class RunServer {
private String appContext;
private static final String RUNDECK_SERVER_SERVER_DIR = "rundeck.server.serverDir";
private static final String RUNDECK_SERVER_CONFIG_DIR = "rundeck.server.configDir";
private static final String RUNDECK_SERVER_WORK_DIR = "rundeck.server.workDir";

public static void main(final String[] args) throws Exception {
new RunServer().run(args);
Expand Down Expand Up @@ -257,7 +259,7 @@ private WebAppContext createWebAppContext(final File webapp) throws IOException
throw new RuntimeException("expected expanded webapp at location: " + webapp.getAbsolutePath());
}
final WebAppContext context = new WebAppContext(webapp.getAbsolutePath(), appContext);
context.setTempDirectory(new File(serverdir, "work"));
context.setTempDirectory(workdir);
context.setInitParameter("org.eclipse.jetty.servlet.Default.dirAllowed", "false");
return context;
}
Expand All @@ -278,6 +280,11 @@ private void init() {
} else {
configdir = new File(serverdir, "config");
}
if (null != System.getProperty(RUNDECK_SERVER_WORK_DIR)) {
workdir = new File(System.getProperty(RUNDECK_SERVER_WORK_DIR));
} else {
workdir = new File(serverdir, "work");
}
if(null!=System.getProperty(RUNDECK_SSL_CONFIG)){
final Properties sslProperties = new Properties();
try{
Expand Down

0 comments on commit 30023a1

Please sign in to comment.