Skip to content

Commit

Permalink
Update RunServer.java
Browse files Browse the repository at this point in the history
Added a new system property "rundeck.server.workDir" to specify a temporary directory for the Jetty web app context which can be configured to be outside of the installation tree.

When unset, a new directory "work" is created under the "rundeck.server.serverDir" directory.
When set, the embedded Jetty uses or creates the directory identified by the "rundeck.server.workDir" directory.
  • Loading branch information
sebastianopilla committed Apr 20, 2016
1 parent 07fea3c commit 0519545
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 0519545

Please sign in to comment.