<url-pattern> MUST match: \r
* GitFilter\r
* com.gitblit.Constants.GIT_PATH\r
- * Wicket Filter ignorePaths parameter --><!-- STRIP\r
+ * Wicket Filter ignorePaths parameter -->\r
<servlet>\r
<servlet-name>GitServlet</servlet-name>\r
- <servlet-class>org.jgit.http.transport.GitServlet</servlet-class>\r
- <init-param>\r
- <param-name>base-path</param-name>\r
- <param-value>c:/git</param-value>\r
- </init-param>\r
- <init-param>\r
- <param-name>export-all</param-name>\r
- <param-value>1</param-value>\r
- </init-param>\r
+ <servlet-class>com.gitblit.GitServlet</servlet-class>\r
</servlet>\r
<servlet-mapping>\r
<servlet-name>GitServlet</servlet-name> \r
<url-pattern>/git/*</url-pattern>\r
- </servlet-mapping>STRIP -->\r
+ </servlet-mapping>\r
\r
\r
<!-- Syndication Servlet\r
import org.eclipse.jetty.server.ssl.SslConnector;\r
import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;\r
import org.eclipse.jetty.server.ssl.SslSocketConnector;\r
-import org.eclipse.jetty.servlet.FilterMapping;\r
-import org.eclipse.jetty.servlet.ServletHolder;\r
import org.eclipse.jetty.util.thread.QueuedThreadPool;\r
import org.eclipse.jetty.webapp.WebAppContext;\r
-import org.eclipse.jgit.http.server.GitServlet;\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
\r
sessionManager.setSecureCookies(params.port <= 0 && params.securePort > 0);\r
rootContext.getSessionHandler().setSessionManager(sessionManager);\r
\r
- // JGit Filter and Servlet\r
- String jgitPathSpec = Constants.GIT_PATH + "*";\r
- rootContext.addFilter(GitFilter.class, jgitPathSpec, FilterMapping.DEFAULT);\r
- ServletHolder jGitServlet = rootContext.addServlet(GitServlet.class, jgitPathSpec);\r
- jGitServlet.setInitParameter("base-path", params.repositoriesFolder);\r
- jGitServlet.setInitParameter("export-all", "1");\r
-\r
// Ensure there is a defined Login Service\r
String realmUsers = params.realmFile;\r
if (StringUtils.isEmpty(realmUsers)) {\r
--- /dev/null
+package com.gitblit;\r
+\r
+public class GitServlet extends org.eclipse.jgit.http.server.GitServlet {\r
+\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ @Override\r
+ public String getInitParameter(String name) {\r
+ if (name.equals("base-path")) {\r
+ return GitBlit.getString(Keys.git.repositoriesFolder, "git");\r
+ } else if (name.equals("export-all")) {\r
+ return "1";\r
+ }\r
+ return super.getInitParameter(name);\r
+ }\r
+}\r