Change-Id: Id18077126e984a767725cf9e8d8eb531a14e1713tags/v1.4.0
@@ -19,6 +19,7 @@ r20: { | |||
- Dashboard and Activity pages now obey the web.generateActivityGraph setting (issue-310) | |||
- Do not log passwords on failed authentication attempts (issue-316) | |||
- Updated default binary and Lucene ignore extensions | |||
- Change the WAR baseFolder context parameter to a JNDI env-entry to improve enterprise deployments | |||
additions: | |||
- Added branch graph image servlet based on EGit's branch graph renderer (issue-194) | |||
- Added option to render Markdown commit messages (issue-203) | |||
@@ -40,6 +41,7 @@ r20: { | |||
- Bret Ikehara | |||
- Chad Horohoe | |||
- Domingo Oropeza | |||
- Chris Graham | |||
} | |||
# |
@@ -22,10 +22,12 @@ | |||
review the defaults for any new settings. Settings are always versioned | |||
with a SINCE x.y.z attribute and also noted in the release changelog. | |||
--> | |||
<context-param> | |||
<param-name>baseFolder</param-name> | |||
<param-value>${contextFolder}/WEB-INF/data</param-value> | |||
</context-param> | |||
<env-entry> | |||
<description>The base folder is used to specify the root location of your Gitblit data.</description> | |||
<env-entry-name>baseFolder</env-entry-name> | |||
<env-entry-type>java.lang.String</env-entry-type> | |||
<env-entry-value>${contextFolder}/WEB-INF/data</env-entry-value> | |||
</env-entry> | |||
<!-- Gitblit Displayname --> | |||
<display-name> |
@@ -62,6 +62,9 @@ import javax.mail.Message; | |||
import javax.mail.MessagingException; | |||
import javax.mail.internet.MimeBodyPart; | |||
import javax.mail.internet.MimeMultipart; | |||
import javax.naming.Context; | |||
import javax.naming.InitialContext; | |||
import javax.naming.NamingException; | |||
import javax.servlet.ServletContext; | |||
import javax.servlet.ServletContextEvent; | |||
import javax.servlet.ServletContextListener; | |||
@@ -3776,6 +3779,18 @@ public class GitBlit implements ServletContextListener { | |||
logger.error(""); | |||
} | |||
try { | |||
// try to lookup JNDI env-entry for the baseFolder | |||
InitialContext ic = new InitialContext(); | |||
Context env = (Context) ic.lookup("java:comp/env"); | |||
String val = (String) env.lookup("baseFolder"); | |||
if (!StringUtils.isEmpty(val)) { | |||
path = val; | |||
} | |||
} catch (NamingException n) { | |||
logger.error("Failed to get JNDI env-entry: " + n.getExplanation()); | |||
} | |||
File base = com.gitblit.utils.FileUtils.resolveParameter(Constants.contextFolder$, contextFolder, path); | |||
base.mkdirs(); | |||