mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 05:55:51 +01:00
(refs #204)Add some way to configure data directory.
1) system property of JVM (e.g. -Dgitbucket.home=PATH_TO_DATADIR) 2) java -jar gitbucket.war --data=PATH_TO_DATADIR 3) Add context parameter "gitbucket.home" to web.xml
This commit is contained in:
@@ -8,9 +8,15 @@ import util.ControlUtil._
|
||||
*/
|
||||
object Directory {
|
||||
|
||||
val GitBucketHome = (scala.util.Properties.envOrNone("GITBUCKET_HOME") match {
|
||||
case Some(env) => new File(env)
|
||||
case None => new File(System.getProperty("user.home"), "gitbucket")
|
||||
val GitBucketHome = (System.getProperty("gitbucket.home") match {
|
||||
// -Dgitbucket.home=<path>
|
||||
case path if(path != null) => new File(path)
|
||||
case _ => scala.util.Properties.envOrNone("GITBUCKET_HOME") match {
|
||||
// environment variable GITBUCKET_HOME
|
||||
case Some(env) => new File(env)
|
||||
// default is HOME/gitbucket
|
||||
case None => new File(System.getProperty("user.home"), "gitbucket")
|
||||
}
|
||||
}).getAbsolutePath
|
||||
|
||||
val GitBucketConf = new File(GitBucketHome, "gitbucket.conf")
|
||||
|
||||
Reference in New Issue
Block a user