mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-01 11:06:06 +01:00
add temp_dir parameter
This commit is contained in:
@@ -32,6 +32,7 @@ You can specify following options:
|
|||||||
- `--prefix=[CONTEXTPATH]`
|
- `--prefix=[CONTEXTPATH]`
|
||||||
- `--host=[HOSTNAME]`
|
- `--host=[HOSTNAME]`
|
||||||
- `--gitbucket.home=[DATA_DIR]`
|
- `--gitbucket.home=[DATA_DIR]`
|
||||||
|
- `--temp_dir=[TEMP_DIR]`
|
||||||
|
|
||||||
You can also deploy gitbucket.war to a servlet container which supports Servlet 3.0 (like Jetty, Tomcat, JBoss, etc)
|
You can also deploy gitbucket.war to a servlet container which supports Servlet 3.0 (like Jetty, Tomcat, JBoss, etc)
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ public class JettyLauncher {
|
|||||||
int port = 8080;
|
int port = 8080;
|
||||||
InetSocketAddress address = null;
|
InetSocketAddress address = null;
|
||||||
String contextPath = "/";
|
String contextPath = "/";
|
||||||
|
String tmpDirPath="";
|
||||||
boolean forceHttps = false;
|
boolean forceHttps = false;
|
||||||
|
|
||||||
for(String arg: args) {
|
for(String arg: args) {
|
||||||
@@ -29,6 +30,8 @@ public class JettyLauncher {
|
|||||||
}
|
}
|
||||||
} else if(dim[0].equals("--gitbucket.home")){
|
} else if(dim[0].equals("--gitbucket.home")){
|
||||||
System.setProperty("gitbucket.home", dim[1]);
|
System.setProperty("gitbucket.home", dim[1]);
|
||||||
|
} else if(dim[0].equals("--temp_dir")){
|
||||||
|
tmpDirPath = dim[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -53,10 +56,22 @@ public class JettyLauncher {
|
|||||||
|
|
||||||
WebAppContext context = new WebAppContext();
|
WebAppContext context = new WebAppContext();
|
||||||
|
|
||||||
File tmpDir = new File(getGitBucketHome(), "tmp");
|
File tmpDir;
|
||||||
|
if(tmpDirPath.equals("")){
|
||||||
|
tmpDir = new File(getGitBucketHome(), "tmp");
|
||||||
if(!tmpDir.exists()){
|
if(!tmpDir.exists()){
|
||||||
tmpDir.mkdirs();
|
tmpDir.mkdirs();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
tmpDir = new File(tmpDirPath);
|
||||||
|
if(!tmpDir.exists()){
|
||||||
|
throw new java.io.FileNotFoundException(
|
||||||
|
String.format("temp_dir \"%s\" not found", tmpDirPath));
|
||||||
|
} else if(!tmpDir.isDirectory()) {
|
||||||
|
throw new IllegalArgumentException(
|
||||||
|
String.format("temp_dir \"%s\" is not a directory", tmpDirPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
context.setTempDirectory(tmpDir);
|
context.setTempDirectory(tmpDir);
|
||||||
|
|
||||||
ProtectionDomain domain = JettyLauncher.class.getProtectionDomain();
|
ProtectionDomain domain = JettyLauncher.class.getProtectionDomain();
|
||||||
|
|||||||
Reference in New Issue
Block a user