diff options
Diffstat (limited to 'src')
85 files changed, 469 insertions, 1142 deletions
diff --git a/src/WEB-INF/web.xml b/src/WEB-INF/web.xml new file mode 100644 index 00000000..d5d3288f --- /dev/null +++ b/src/WEB-INF/web.xml @@ -0,0 +1,125 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <!-- PARAMS -->
+
+ <!-- Gitblit Context Listener --><!-- STRIP
+ <listener>
+ <listener-class>com.gitblit.GitBlit</listener-class>
+ </listener>STRIP -->
+
+
+ <!-- Git Servlet
+ <url-pattern> MUST match:
+ * GitFilter
+ * com.gitblit.Constants.GIT_PATH
+ * Wicket Filter ignorePaths parameter --><!-- STRIP
+ <servlet>
+ <servlet-name>GitServlet</servlet-name>
+ <servlet-class>org.jgit.http.transport.GitServlet</servlet-class>
+ <init-param>
+ <param-name>base-path</param-name>
+ <param-value>c:/git</param-value>
+ </init-param>
+ <init-param>
+ <param-name>export-all</param-name>
+ <param-value>1</param-value>
+ </init-param>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>GitServlet</servlet-name>
+ <url-pattern>/git/*</url-pattern>
+ </servlet-mapping>STRIP -->
+
+
+ <!-- Syndication Servlet
+ <url-pattern> MUST match:
+ * SyndicationFilter
+ * com.gitblit.Constants.SYNDICATION_PATH
+ * Wicket Filter ignorePaths parameter -->
+ <servlet>
+ <servlet-name>SyndicationServlet</servlet-name>
+ <servlet-class>com.gitblit.SyndicationServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>SyndicationServlet</servlet-name>
+ <url-pattern>/feed/*</url-pattern>
+ </servlet-mapping>
+
+
+ <!-- Zip Servlet
+ <url-pattern> MUST match:
+ * ZipServlet
+ * com.gitblit.Constants.ZIP_PATH
+ * Wicket Filter ignorePaths parameter -->
+ <servlet>
+ <servlet-name>ZipServlet</servlet-name>
+ <servlet-class>com.gitblit.DownloadZipServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>ZipServlet</servlet-name>
+ <url-pattern>/zip/*</url-pattern>
+ </servlet-mapping>
+
+
+ <!-- Git Access Restriction Filter
+ <url-pattern> MUST match:
+ * GitServlet
+ * com.gitblit.Constants.GIT_PATH
+ * Wicket Filter ignorePaths parameter -->
+ <filter>
+ <filter-name>GitFilter</filter-name>
+ <filter-class>com.gitblit.GitFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>GitFilter</filter-name>
+ <url-pattern>/git/*</url-pattern>
+ </filter-mapping>
+
+
+ <!-- Syndication Restriction Filter
+ <url-pattern> MUST match:
+ * SyndicationServlet
+ * com.gitblit.Constants.SYNDICATION_PATH
+ * Wicket Filter ignorePaths parameter -->
+ <filter>
+ <filter-name>SyndicationFilter</filter-name>
+ <filter-class>com.gitblit.SyndicationFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>SyndicationFilter</filter-name>
+ <url-pattern>/feed/*</url-pattern>
+ </filter-mapping>
+
+
+ <!-- Wicket Filter -->
+ <filter>
+ <filter-name>wicketFilter</filter-name>
+ <filter-class>
+ org.apache.wicket.protocol.http.WicketFilter
+ </filter-class>
+ <init-param>
+ <param-name>applicationClassName</param-name>
+ <param-value>com.gitblit.wicket.GitBlitWebApp</param-value>
+ </init-param>
+ <init-param>
+ <param-name>ignorePaths</param-name>
+ <!-- Paths should match
+ * SyndicationFilter <url-pattern>
+ * SyndicationServlet <url-pattern>
+ * com.gitblit.Constants.SYNDICATION_PATH
+ * GitFilter <url-pattern>
+ * GitServlet <url-pattern>
+ * com.gitblit.Constants.GIT_PATH
+ * ZipServlet <url-pattern>
+ * com.gitblit.Constants.ZIP_PATH -->
+ <param-value>git/,feed/,zip/</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>wicketFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+</web-app>
\ No newline at end of file diff --git a/src/com/gitblit/AccessRestrictionFilter.java b/src/com/gitblit/AccessRestrictionFilter.java index 3aca1039..625eaa99 100644 --- a/src/com/gitblit/AccessRestrictionFilter.java +++ b/src/com/gitblit/AccessRestrictionFilter.java @@ -16,6 +16,7 @@ package com.gitblit;
import java.io.IOException;
+import java.nio.charset.Charset;
import java.security.Principal;
import java.text.MessageFormat;
import java.util.Enumeration;
@@ -32,6 +33,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
+import org.eclipse.jgit.util.Base64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -114,7 +116,8 @@ public abstract class AccessRestrictionFilter implements Filter { if (authorization != null && authorization.startsWith(BASIC)) {
// Authorization: Basic base64credentials
String base64Credentials = authorization.substring(BASIC.length()).trim();
- String credentials = StringUtils.decodeBase64(base64Credentials);
+ String credentials = new String(Base64.decode(base64Credentials),
+ Charset.forName("UTF-8"));
if (GitBlit.isDebugMode()) {
logger.info(MessageFormat.format("AUTH: {0} ({1})", authorization, credentials));
}
@@ -131,7 +134,8 @@ public abstract class AccessRestrictionFilter implements Filter { // authenticated request permitted.
// pass processing to the restricted servlet.
newSession(accessRequest, httpResponse);
- logger.info("ARF: " + fullUrl + " (" + HttpServletResponse.SC_CONTINUE + ") authenticated");
+ logger.info("ARF: " + fullUrl + " (" + HttpServletResponse.SC_CONTINUE
+ + ") authenticated");
chain.doFilter(accessRequest, httpResponse);
return;
}
@@ -163,7 +167,8 @@ public abstract class AccessRestrictionFilter implements Filter { }
if (GitBlit.isDebugMode()) {
- logger.info("ARF: " + fullUrl + " (" + HttpServletResponse.SC_CONTINUE + ") unauthenticated");
+ logger.info("ARF: " + fullUrl + " (" + HttpServletResponse.SC_CONTINUE
+ + ") unauthenticated");
}
// unauthenticated request permitted.
// pass processing to the restricted servlet.
@@ -202,19 +207,19 @@ public abstract class AccessRestrictionFilter implements Filter { @Override
public void destroy() {
}
-
+
/**
* Wraps a standard HttpServletRequest and overrides user principal methods.
*/
public static class AccessRestrictionRequest extends ServletRequestWrapper {
private UserModel user;
-
+
public AccessRestrictionRequest(HttpServletRequest req) {
super(req);
user = new UserModel("anonymous");
}
-
+
void setUser(UserModel user) {
this.user = user;
}
diff --git a/src/com/gitblit/Build.java b/src/com/gitblit/Build.java index 30c4aa00..90224f08 100644 --- a/src/com/gitblit/Build.java +++ b/src/com/gitblit/Build.java @@ -312,10 +312,10 @@ public class Build { "c7adc475ca40c288c93054e0f4fe58f3a98c0cb5");
public static final MavenObject JETTY = new MavenObject("Jetty",
- "org/eclipse/jetty/aggregate", "jetty-all", "7.4.1.v20110513", 1500000, 1000000,
- 4100000, "1e2de9ed25a7c6ae38717d5ffdc7cfcd6be4bd46",
- "7b6279d16ce8f663537d9faf55ea353e748dbbaa",
- "fa06212e751296f1a7abc15c843b135bf49a112b");
+ "org/eclipse/jetty/aggregate", "jetty-webapp", "7.4.2.v20110526", 1000000, 680000,
+ 2720000, "56331143afa22d24d9faba96e86e6371b0686c7c",
+ "9f38230fd589e29c8be0fc3c80fb51c5093c2e1e",
+ "0d48212889c25252c5c14bef62703e28215d80cc");
public static final MavenObject SERVLET = new MavenObject("Servlet 2.5", "javax/servlet",
"servlet-api", "2.5", 105000, 158000, 0,
@@ -363,8 +363,8 @@ public class Build { "3d32d958b2f7aa58388af5701ea3aafc433e573f",
"c37518b67ea85af485dd61fe854137eeacc50318");
- public static final MavenObject JUNIT = new MavenObject("JUnit", "junit", "junit", "3.8.2",
- 120000, 0, 0, "07e4cde26b53a9a0e3fe5b00d1dbbc7cc1d46060", "", "");
+ public static final MavenObject JUNIT = new MavenObject("JUnit", "junit", "junit", "4.8.2",
+ 237000, 0, 0, "c94f54227b08100974c36170dcb53329435fe5ad", "", "");
public static final MavenObject MARKDOWNPAPERS = new MavenObject("MarkdownPapers",
"org/tautua/markdownpapers", "markdownpapers-core", "1.0.0", 87000, 58000, 278000,
diff --git a/src/com/gitblit/BuildWebXml.java b/src/com/gitblit/BuildWebXml.java new file mode 100644 index 00000000..3b687f6d --- /dev/null +++ b/src/com/gitblit/BuildWebXml.java @@ -0,0 +1,80 @@ +/*
+ * Copyright 2011 gitblit.com.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.gitblit;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+
+public class BuildWebXml {
+ private static final String PARAMS = "<!-- PARAMS -->";
+
+ private static final String [] STRIP_TOKENS = { "<!-- STRIP", "STRIP -->" };
+
+ private static final String PARAM_PATTERN = "\n\t<context-param>\n\t\t<param-name>{0}</param-name>\n\t\t<param-value>{1}</param-value>\n\t</context-param>\n";
+
+ public static void main(String[] args) throws Exception {
+ // Read the current Gitblit properties
+ // TODO extract the comments and inject them into web.xml too
+ FileInputStream fis = new FileInputStream(new File("distrib/gitblit.properties"));
+ Properties fileSettings = new Properties();
+ fileSettings.load(fis);
+ fis.close();
+ List<String> keys = new ArrayList<String>(fileSettings.stringPropertyNames());
+ Collections.sort(keys);
+
+ StringBuilder parameters = new StringBuilder();
+ for (String key : keys) {
+ if (!skipKey(key)) {
+ String value = fileSettings.getProperty(key);
+ parameters.append(MessageFormat.format(PARAM_PATTERN, key, value));
+ }
+ }
+
+ // Read the prototype web.xml file
+ File webxml = new File("src/WEB-INF/web.xml");
+ char [] buffer = new char[(int) webxml.length()];
+ FileReader reader = new FileReader(webxml);
+ reader.read(buffer);
+ reader.close();
+ String webXmlContent = new String(buffer);
+
+ // Insert the Gitblit properties into the prototype web.xml
+ for (String stripToken:STRIP_TOKENS) {
+ webXmlContent = webXmlContent.replace(stripToken, "");
+ }
+ int idx = webXmlContent.indexOf(PARAMS);
+ StringBuilder sb = new StringBuilder();
+ sb.append(webXmlContent.substring(0, idx));
+ sb.append(parameters.toString());
+ sb.append(webXmlContent.substring(idx + PARAMS.length()));
+
+ // Save the merged web.xml to the war build folder
+ FileOutputStream os = new FileOutputStream(new File("war/WEB-INF/web.xml"), false);
+ os.write(sb.toString().getBytes());
+ os.close();
+ }
+
+ private static boolean skipKey(String key) {
+ return key.startsWith(Keys.server._ROOT);
+ }
+}
diff --git a/src/com/gitblit/Constants.java b/src/com/gitblit/Constants.java index 68e7b67e..b874a7b0 100644 --- a/src/com/gitblit/Constants.java +++ b/src/com/gitblit/Constants.java @@ -33,14 +33,12 @@ public class Constants { public static final String PROPERTIES_FILE = "gitblit.properties";
- public static final String GIT_SERVLET_PATH = "/git/";
+ public static final String GIT_PATH = "/git/";
- public static final String ZIP_SERVLET_PATH = "/zip/";
+ public static final String ZIP_PATH = "/zip/";
- public static final String SYNDICATION_SERVLET_PATH = "/feed/";
+ public static final String SYNDICATION_PATH = "/feed/";
- public static final String RESOURCE_PATH = "/com/gitblit/wicket/resources/";
-
public static final String BORDER = "***********************************************************";
public static enum AccessRestrictionType {
diff --git a/src/com/gitblit/DownloadZipServlet.java b/src/com/gitblit/DownloadZipServlet.java index 3b02cbac..d36b94d2 100644 --- a/src/com/gitblit/DownloadZipServlet.java +++ b/src/com/gitblit/DownloadZipServlet.java @@ -44,7 +44,7 @@ public class DownloadZipServlet extends HttpServlet { if (baseURL.length() > 0 && baseURL.charAt(baseURL.length() - 1) == '/') {
baseURL = baseURL.substring(0, baseURL.length() - 1);
}
- return baseURL + Constants.ZIP_SERVLET_PATH + "?r=" + repository
+ return baseURL + Constants.ZIP_PATH + "?r=" + repository
+ (path == null ? "" : ("&p=" + path))
+ (objectId == null ? "" : ("&h=" + objectId));
}
diff --git a/src/com/gitblit/FileLoginService.java b/src/com/gitblit/FileLoginService.java index b59a7763..e239efc4 100644 --- a/src/com/gitblit/FileLoginService.java +++ b/src/com/gitblit/FileLoginService.java @@ -53,8 +53,7 @@ public class FileLoginService extends FileSettings implements ILoginService { if (user.password.equalsIgnoreCase(md5)) {
returnedUser = user;
}
- }
- if (user.password.equals(new String(password))) {
+ } else if (user.password.equals(new String(password))) {
returnedUser = user;
}
return returnedUser;
diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java index fa593f92..1fa8b60f 100644 --- a/src/com/gitblit/GitBlit.java +++ b/src/com/gitblit/GitBlit.java @@ -45,7 +45,7 @@ import com.gitblit.utils.StringUtils; public class GitBlit implements ServletContextListener {
- private static final GitBlit GITBLIT;
+ private static GitBlit gitblit;
private final Logger logger = LoggerFactory.getLogger(GitBlit.class);
@@ -53,45 +53,48 @@ public class GitBlit implements ServletContextListener { private File repositoriesFolder;
- private boolean exportAll;
+ private boolean exportAll = true;
private ILoginService loginService;
private IStoredSettings storedSettings;
- static {
- GITBLIT = new GitBlit();
- }
-
- private GitBlit() {
+ public GitBlit() {
+ if (gitblit == null) {
+ // Singleton reference when running in standard servlet container
+ gitblit = this;
+ }
}
public static GitBlit self() {
- return GITBLIT;
+ if (gitblit == null) {
+ gitblit = new GitBlit();
+ }
+ return gitblit;
}
public static boolean getBoolean(String key, boolean defaultValue) {
- return GITBLIT.storedSettings.getBoolean(key, defaultValue);
+ return self().storedSettings.getBoolean(key, defaultValue);
}
public static int getInteger(String key, int defaultValue) {
- return GITBLIT.storedSettings.getInteger(key, defaultValue);
+ return self().storedSettings.getInteger(key, defaultValue);
}
public static String getString(String key, String defaultValue) {
- return GITBLIT.storedSettings.getString(key, defaultValue);
+ return self().storedSettings.getString(key, defaultValue);
}
public static List<String> getStrings(String key) {
- return GITBLIT.storedSettings.getStrings(key);
+ return self().storedSettings.getStrings(key);
}
public static List<String> getAllKeys(String startingWith) {
- return GITBLIT.storedSettings.getAllKeys(startingWith);
+ return self().storedSettings.getAllKeys(startingWith);
}
public static boolean isDebugMode() {
- return GITBLIT.storedSettings.getBoolean(Keys.web.debugMode, false);
+ return self().storedSettings.getBoolean(Keys.web.debugMode, false);
}
public List<String> getOtherCloneUrls(String repositoryName) {
@@ -103,6 +106,7 @@ public class GitBlit implements ServletContextListener { }
public void setLoginService(ILoginService loginService) {
+ logger.info("Setting up login service " + loginService.toString());
this.loginService = loginService;
}
@@ -353,9 +357,32 @@ public class GitBlit implements ServletContextListener { public void configureContext(IStoredSettings settings) {
logger.info("Reading configuration from " + settings.toString());
this.storedSettings = settings;
- repositoriesFolder = new File(settings.getString(Keys.git.repositoriesFolder, "repos"));
- exportAll = settings.getBoolean(Keys.git.exportAll, true);
+ repositoriesFolder = new File(settings.getString(Keys.git.repositoriesFolder, "git"));
+ logger.info("Git repositories folder " + repositoriesFolder.getAbsolutePath());
repositoryResolver = new FileResolver<Void>(repositoriesFolder, exportAll);
+ String realm = settings.getString(Keys.realm.realmFile, "users.properties");
+ ILoginService loginService = null;
+ try {
+ // Check to see if this "file" is a login service class
+ Class<?> realmClass = Class.forName(realm);
+ if (ILoginService.class.isAssignableFrom(realmClass)) {
+ loginService = (ILoginService) realmClass.newInstance();
+ }
+ } catch (Throwable t) {
+ // Not a login service class OR other issue
+ // Use default file login service
+ File realmFile = new File(realm);
+ if (!realmFile.exists()) {
+ try {
+ realmFile.createNewFile();
+ } catch (IOException x) {
+ logger.error(
+ MessageFormat.format("COULD NOT CREATE REALM FILE {0}!", realmFile), x);
+ }
+ }
+ loginService = new FileLoginService(realmFile);
+ }
+ setLoginService(loginService);
}
@Override
diff --git a/src/com/gitblit/GitBlitServer.java b/src/com/gitblit/GitBlitServer.java index 4b6df709..3687e4db 100644 --- a/src/com/gitblit/GitBlitServer.java +++ b/src/com/gitblit/GitBlitServer.java @@ -30,10 +30,6 @@ import java.text.MessageFormat; import java.util.ArrayList;
import java.util.List;
-import org.apache.log4j.ConsoleAppender;
-import org.apache.log4j.PatternLayout;
-import org.apache.wicket.protocol.http.ContextParamWebApplicationFactory;
-import org.apache.wicket.protocol.http.WicketFilter;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.bio.SocketConnector;
@@ -42,7 +38,6 @@ import org.eclipse.jetty.server.session.HashSessionManager; import org.eclipse.jetty.server.ssl.SslConnector;
import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
import org.eclipse.jetty.server.ssl.SslSocketConnector;
-import org.eclipse.jetty.servlet.FilterHolder;
import org.eclipse.jetty.servlet.FilterMapping;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
@@ -56,7 +51,6 @@ import com.beust.jcommander.Parameter; import com.beust.jcommander.ParameterException;
import com.beust.jcommander.Parameters;
import com.gitblit.utils.StringUtils;
-import com.gitblit.wicket.GitBlitWebApp;
public class GitBlitServer {
@@ -121,26 +115,6 @@ public class GitBlitServer { */
private static void start(Params params) {
FileSettings settings = params.FILESETTINGS;
- String pattern = settings.getString(Keys.server.log4jPattern,
- "%-5p %d{MM-dd HH:mm:ss.SSS} %-20.20c{1} %m%n");
-
- // allow os override of logging pattern
- String os = System.getProperty("os.name").toLowerCase();
- if (os.indexOf("windows") > -1) {
- String winPattern = settings.getString(Keys.server.log4jPattern_windows, pattern);
- if (!StringUtils.isEmpty(winPattern)) {
- pattern = winPattern;
- }
- } else if (os.indexOf("linux") > -1) {
- String linuxPattern = settings.getString(Keys.server.log4jPattern_linux, pattern);
- if (!StringUtils.isEmpty(linuxPattern)) {
- pattern = linuxPattern;
- }
- }
-
- PatternLayout layout = new PatternLayout(pattern);
- org.apache.log4j.Logger rootLogger = org.apache.log4j.Logger.getRootLogger();
- rootLogger.addAppender(new ConsoleAppender(layout));
logger = LoggerFactory.getLogger(GitBlitServer.class);
logger.info(Constants.BORDER);
@@ -223,55 +197,23 @@ public class GitBlitServer { sessionManager.setSecureCookies(params.port <= 0 && params.securePort > 0);
rootContext.getSessionHandler().setSessionManager(sessionManager);
- // Wicket Filter
- String wicketPathSpec = "/*";
- FilterHolder wicketFilter = new FilterHolder(WicketFilter.class);
- wicketFilter.setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM,
- GitBlitWebApp.class.getName());
- wicketFilter.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, wicketPathSpec);
- wicketFilter.setInitParameter(WicketFilter.IGNORE_PATHS_PARAM, "git/,feed/,zip/");
- rootContext.addFilter(wicketFilter, wicketPathSpec, FilterMapping.DEFAULT);
-
// JGit Filter and Servlet
- if (settings.getBoolean(Keys.git.enableGitServlet, true)) {
- String jgitPathSpec = Constants.GIT_SERVLET_PATH + "*";
- rootContext.addFilter(GitFilter.class, jgitPathSpec, FilterMapping.DEFAULT);
- ServletHolder jGitServlet = rootContext.addServlet(GitServlet.class, jgitPathSpec);
- jGitServlet.setInitParameter("base-path", params.repositoriesFolder);
- jGitServlet.setInitParameter("export-all",
- settings.getBoolean(Keys.git.exportAll, true) ? "1" : "0");
- }
+ String jgitPathSpec = Constants.GIT_PATH + "*";
+ rootContext.addFilter(GitFilter.class, jgitPathSpec, FilterMapping.DEFAULT);
+ ServletHolder jGitServlet = rootContext.addServlet(GitServlet.class, jgitPathSpec);
+ jGitServlet.setInitParameter("base-path", params.repositoriesFolder);
+ jGitServlet.setInitParameter("export-all", "1");
- // Syndication Filter and Servlet
- String feedPathSpec = Constants.SYNDICATION_SERVLET_PATH + "*";
- rootContext.addFilter(SyndicationFilter.class, feedPathSpec, FilterMapping.DEFAULT);
- rootContext.addServlet(SyndicationServlet.class, feedPathSpec);
-
- // Zip Servlet
- rootContext.addServlet(DownloadZipServlet.class, Constants.ZIP_SERVLET_PATH + "*");
-
- // Login Service
+ // Ensure there is a defined Login Service
String realmUsers = params.realmFile;
if (StringUtils.isEmpty(realmUsers)) {
logger.error(MessageFormat.format("PLEASE SPECIFY {0}!!", Keys.realm.realmFile));
return;
}
- File realmFile = new File(realmUsers);
- if (!realmFile.exists()) {
- try {
- realmFile.createNewFile();
- } catch (IOException x) {
- logger.error(MessageFormat.format("COULD NOT CREATE REALM FILE {0}!", realmUsers),
- x);
- return;
- }
- }
- logger.info("Setting up login service from " + realmUsers);
- FileLoginService loginService = new FileLoginService(realmFile);
- GitBlit.self().setLoginService(loginService);
-
- logger.info("Git repositories folder "
- + new File(params.repositoriesFolder).getAbsolutePath());
+
+ // Update settings
+// settings.put(Keys.realm.realmFile, params.realmFile);
+// settings.put(Keys.git.repositoriesFolder, params.repositoriesFolder);
// Set the server's contexts
server.setHandler(rootContext);
diff --git a/src/com/gitblit/GitFilter.java b/src/com/gitblit/GitFilter.java index 5bd7b330..b3104426 100644 --- a/src/com/gitblit/GitFilter.java +++ b/src/com/gitblit/GitFilter.java @@ -65,6 +65,10 @@ public class GitFilter extends AccessRestrictionFilter { @Override
protected boolean canAccess(RepositoryModel repository, UserModel user, String urlRequestType) {
+ if (!GitBlit.getBoolean(Keys.git.enableGitServlet, true)) {
+ // Git Servlet disabled
+ return false;
+ }
if (repository.isFrozen || repository.accessRestriction.atLeast(AccessRestrictionType.PUSH)) {
boolean authorizedUser = user.canAccessRepository(repository.name);
if (urlRequestType.equals(gitReceivePack)) {
diff --git a/src/com/gitblit/ILoginService.java b/src/com/gitblit/ILoginService.java index d7bfd017..0e706cf3 100644 --- a/src/com/gitblit/ILoginService.java +++ b/src/com/gitblit/ILoginService.java @@ -42,4 +42,6 @@ public interface ILoginService { boolean renameRole(String oldRole, String newRole);
boolean deleteRole(String role);
+
+ String toString();
}
diff --git a/src/com/gitblit/IStoredSettings.java b/src/com/gitblit/IStoredSettings.java index 7108c068..403a0676 100644 --- a/src/com/gitblit/IStoredSettings.java +++ b/src/com/gitblit/IStoredSettings.java @@ -27,21 +27,25 @@ import com.gitblit.utils.StringUtils; public abstract class IStoredSettings {
protected final Logger logger;
-
+
public IStoredSettings(Class<? extends IStoredSettings> clazz) {
logger = LoggerFactory.getLogger(clazz);
}
-
+
protected abstract Properties read();
public List<String> getAllKeys(String startingWith) {
- startingWith = startingWith.toLowerCase();
List<String> keys = new ArrayList<String>();
Properties props = read();
- for (Object o : props.keySet()) {
- String key = o.toString();
- if (key.toLowerCase().startsWith(startingWith)) {
- keys.add(key);
+ if (StringUtils.isEmpty(startingWith)) {
+ keys.addAll(props.stringPropertyNames());
+ } else {
+ startingWith = startingWith.toLowerCase();
+ for (Object o : props.keySet()) {
+ String key = o.toString();
+ if (key.toLowerCase().startsWith(startingWith)) {
+ keys.add(key);
+ }
}
}
return keys;
diff --git a/src/com/gitblit/SyndicationServlet.java b/src/com/gitblit/SyndicationServlet.java index 19865fe5..66dc467a 100644 --- a/src/com/gitblit/SyndicationServlet.java +++ b/src/com/gitblit/SyndicationServlet.java @@ -43,7 +43,7 @@ public class SyndicationServlet extends HttpServlet { }
StringBuilder url = new StringBuilder();
url.append(baseURL);
- url.append(Constants.SYNDICATION_SERVLET_PATH);
+ url.append(Constants.SYNDICATION_PATH);
url.append(repository);
if (!StringUtils.isEmpty(objectId) || length > 0) {
StringBuilder parameters = new StringBuilder("?");
diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java index e8bb3bf2..5656efb3 100644 --- a/src/com/gitblit/utils/JGitUtils.java +++ b/src/com/gitblit/utils/JGitUtils.java @@ -402,36 +402,30 @@ public class JGitUtils { public static List<PathChangeModel> getFilesInCommit(Repository r, RevCommit commit) {
List<PathChangeModel> list = new ArrayList<PathChangeModel>();
- RevWalk rw = new RevWalk(r);
- TreeWalk tw = new TreeWalk(r);
+ RevWalk rw = new RevWalk(r);
try {
if (commit == null) {
ObjectId object = r.resolve(Constants.HEAD);
commit = rw.parseCommit(object);
- }
- RevTree commitTree = commit.getTree();
+ }
- tw.reset();
- tw.setRecursive(true);
if (commit.getParentCount() == 0) {
- tw.addTree(commitTree);
+ TreeWalk tw = new TreeWalk(r);
+ tw.reset();
+ tw.setRecursive(true);
+ tw.addTree(commit.getTree());
while (tw.next()) {
list.add(new PathChangeModel(tw.getPathString(), tw.getPathString(), 0, tw
.getRawMode(0), commit.getId().getName(), ChangeType.ADD));
}
+ tw.release();
} else {
RevCommit parent = rw.parseCommit(commit.getParent(0).getId());
- RevTree parentTree = parent.getTree();
- tw.addTree(parentTree);
- tw.addTree(commitTree);
- tw.setFilter(TreeFilter.ANY_DIFF);
-
- RawTextComparator cmp = RawTextComparator.DEFAULT;
DiffFormatter df = new DiffFormatter(DisabledOutputStream.INSTANCE);
df.setRepository(r);
- df.setDiffComparator(cmp);
+ df.setDiffComparator(RawTextComparator.DEFAULT);
df.setDetectRenames(true);
- List<DiffEntry> diffs = df.scan(parentTree, commitTree);
+ List<DiffEntry> diffs = df.scan(parent.getTree(), commit.getTree());
for (DiffEntry diff : diffs) {
if (diff.getChangeType().equals(ChangeType.DELETE)) {
list.add(new PathChangeModel(diff.getOldPath(), diff.getOldPath(), 0, diff
@@ -447,8 +441,7 @@ public class JGitUtils { } catch (Throwable t) {
LOGGER.error("failed to determine files in commit!", t);
} finally {
- rw.dispose();
- tw.release();
+ rw.dispose();
}
return list;
}
diff --git a/src/com/gitblit/utils/StringUtils.java b/src/com/gitblit/utils/StringUtils.java index 363efc9c..b53b5e15 100644 --- a/src/com/gitblit/utils/StringUtils.java +++ b/src/com/gitblit/utils/StringUtils.java @@ -16,16 +16,12 @@ package com.gitblit.utils;
import java.io.UnsupportedEncodingException;
-import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.PatternSyntaxException;
-import org.eclipse.jetty.util.log.Log;
-import org.eclipse.jgit.util.Base64;
-
public class StringUtils {
public static final String MD5_TYPE = "MD5:";
@@ -152,9 +148,10 @@ public class StringUtils { md.update(string.getBytes("iso-8859-1"));
byte[] digest = md.digest();
return toHex(digest);
- } catch (Exception e) {
- Log.warn(e);
- return null;
+ } catch (UnsupportedEncodingException u) {
+ throw new RuntimeException(u);
+ } catch (NoSuchAlgorithmException t) {
+ throw new RuntimeException(t);
}
}
@@ -168,11 +165,7 @@ public class StringUtils { }
return sb.toString();
}
-
- public static String decodeBase64(String base64) {
- return new String(Base64.decode(base64), Charset.forName("UTF-8"));
- }
-
+
public static String getRootPath(String path) {
if (path.indexOf('/') > -1) {
return path.substring(0, path.lastIndexOf('/'));
diff --git a/src/com/gitblit/utils/SyndicationUtils.java b/src/com/gitblit/utils/SyndicationUtils.java index 5763af3f..80a1b288 100644 --- a/src/com/gitblit/utils/SyndicationUtils.java +++ b/src/com/gitblit/utils/SyndicationUtils.java @@ -48,7 +48,7 @@ public class SyndicationUtils { feed.setDescription(description);
SyndImageImpl image = new SyndImageImpl();
image.setTitle(Constants.NAME);
- image.setUrl(hostUrl + Constants.RESOURCE_PATH + "gitblt_25.png");
+ image.setUrl(hostUrl + "/gitblt_25.png");
image.setLink(hostUrl);
feed.setImage(image);
diff --git a/src/com/gitblit/wicket/GitBlitWebApp.properties b/src/com/gitblit/wicket/GitBlitWebApp.properties index 50a4ef42..2ed61fa6 100644 --- a/src/com/gitblit/wicket/GitBlitWebApp.properties +++ b/src/com/gitblit/wicket/GitBlitWebApp.properties @@ -66,7 +66,7 @@ gb.filesRenamed = {0} files renamed gb.missingUsername = Missing Username
gb.edit = edit
gb.searchTypeTooltip = Select Search Type
-gb.searchTooltip = Search Git:Blit
+gb.searchTooltip = Search Gitblit
gb.delete = delete
gb.docs = docs
gb.accessRestriction = access restriction
@@ -86,7 +86,7 @@ gb.viewRestricted = authenticated view, clone, & push gb.useTicketsDescription = distributed Ticgit issues
gb.useDocsDescription = enumerates Markdown documentation in repository
gb.showRemoteBranchesDescription = show remote branches
-gb.canAdminDescription = can administer Git:Blit server
+gb.canAdminDescription = can administer Gitblit server
gb.permittedUsers = permitted users
gb.isFrozen = is frozen
gb.isFrozenDescription = deny push operations
diff --git a/src/com/gitblit/wicket/WicketUtils.java b/src/com/gitblit/wicket/WicketUtils.java index 54f9648c..1897acac 100644 --- a/src/com/gitblit/wicket/WicketUtils.java +++ b/src/com/gitblit/wicket/WicketUtils.java @@ -169,7 +169,7 @@ public class WicketUtils { }
public static ContextImage newImage(String wicketId, String file, String tooltip) {
- ContextImage img = new ContextImage(wicketId, com.gitblit.Constants.RESOURCE_PATH + file);
+ ContextImage img = new ContextImage(wicketId, file);
if (!StringUtils.isEmpty(tooltip)) {
setHtmlTooltip(img, tooltip);
}
@@ -177,7 +177,7 @@ public class WicketUtils { }
public static ContextRelativeResource getResource(String file) {
- return new ContextRelativeResource(com.gitblit.Constants.RESOURCE_PATH + file);
+ return new ContextRelativeResource(file);
}
public static String getHostURL(Request request) {
diff --git a/src/com/gitblit/wicket/pages/BasePage.html b/src/com/gitblit/wicket/pages/BasePage.html index 0da37d40..cc19fbcc 100644 --- a/src/com/gitblit/wicket/pages/BasePage.html +++ b/src/com/gitblit/wicket/pages/BasePage.html @@ -4,25 +4,21 @@ xml:lang="en"
lang="en">
- <!-- Head with Wicket-controlled resources in this package -->
+ <!-- Head -->
<wicket:head>
<title wicket:id="title">[page title]</title>
- <wicket:link>
- <link rel="stylesheet" type="text/css" href="/com/gitblit/wicket/resources/gitblit.css"/>
- <link rel="shortcut icon" href="/com/gitblit/wicket/resources/gitblt-favicon.png" type="image/png" />
- </wicket:link>
+ <link rel="stylesheet" type="text/css" href="gitblit.css"/>
+ <link rel="icon" href="gitblt-favicon.png" type="image/png" />
</wicket:head>
<body>
<!-- page header -->
<div class="page_header">
<a title="gitblit homepage" href="http://gitblit.com/">
- <wicket:link>
- <img src="/com/gitblit/wicket/resources/gitblt_25.png" width="79" height="25" alt="gitblit" class="logo"/>
- </wicket:link>
+ <img src="gitblt_25.png" width="79" height="25" alt="gitblit" class="logo"/>
</a>
<span>
- <a href="/"><span wicket:id="siteName">[site name]</span></a> / <span wicket:id="repositoryName">[repository name]</span> <span wicket:id="pageName">[page name]</span>
+ <span wicket:id="siteName">[site name]</span> / <span wicket:id="repositoryName">[repository name]</span> <span wicket:id="pageName">[page name]</span>
</span>
</div>
diff --git a/src/com/gitblit/wicket/pages/BasePage.java b/src/com/gitblit/wicket/pages/BasePage.java index 9031befd..5a0eb90f 100644 --- a/src/com/gitblit/wicket/pages/BasePage.java +++ b/src/com/gitblit/wicket/pages/BasePage.java @@ -63,7 +63,7 @@ public abstract class BasePage extends WebPage { if (siteName == null || siteName.trim().length() == 0) {
siteName = Constants.NAME;
}
- add(new Label("siteName", siteName));
+ add(new LinkPanel("siteName", null, siteName, RepositoriesPage.class, null));
add(new LinkPanel("repositoryName", null, repositoryName, SummaryPage.class,
WicketUtils.newRepositoryParameter(repositoryName)));
add(new Label("pageName", pageName));
@@ -122,6 +122,10 @@ public abstract class BasePage extends WebPage { HttpServletRequest req = servletWebRequest.getHttpServletRequest();
return req.getServerName();
}
+
+ public void warn(String message, Throwable t) {
+ logger.warn(message, t);
+ }
public void error(String message, boolean redirect) {
logger.error(message);
diff --git a/src/com/gitblit/wicket/pages/DocsPage.java b/src/com/gitblit/wicket/pages/DocsPage.java index 7f41b71b..2f899bbe 100644 --- a/src/com/gitblit/wicket/pages/DocsPage.java +++ b/src/com/gitblit/wicket/pages/DocsPage.java @@ -64,7 +64,8 @@ public class DocsPage extends RepositoryPage { .newPathParameter(repositoryName, entry.commitId, entry.path)));
item.add(new BookmarkablePageLink<Void>("raw", RawPage.class, WicketUtils
.newPathParameter(repositoryName, entry.commitId, entry.path)));
- item.add(new BookmarkablePageLink<Void>("blame", BlobPage.class).setEnabled(false));
+ item.add(new BookmarkablePageLink<Void>("blame", BlamePage.class,
+ WicketUtils.newPathParameter(repositoryName, entry.commitId, entry.path)));
item.add(new BookmarkablePageLink<Void>("history", HistoryPage.class, WicketUtils
.newPathParameter(repositoryName, entry.commitId, entry.path)));
WicketUtils.setAlternatingBackground(item, counter);
diff --git a/src/com/gitblit/wicket/pages/LoginPage.html b/src/com/gitblit/wicket/pages/LoginPage.html index 280453d5..5f9b779f 100644 --- a/src/com/gitblit/wicket/pages/LoginPage.html +++ b/src/com/gitblit/wicket/pages/LoginPage.html @@ -7,18 +7,14 @@ <!-- Head with Wicket-controlled resources in this package -->
<wicket:head>
<title wicket:id="title">[page title]</title>
- <wicket:link>
- <link rel="stylesheet" type="text/css" href="/com/gitblit/wicket/resources/gitblit.css"/>
- <link rel="shortcut icon" href="/com/gitblit/wicket/resources/gitblt-favicon.png" type="image/png" />
- </wicket:link>
+ <link rel="stylesheet" type="text/css" href="gitblit.css"/>
+ <link rel="shortcut icon" href="gitblt-favicon.png" type="image/png" />
</wicket:head>
<body onload="document.getElementById('username').focus();">
<div>
<div style="padding-top: 10px;text-align:center;">
- <wicket:link>
- <img src="/com/gitblit/wicket/resources/gitblt_25.png" alt="Git:Blit"/><br/>
- </wicket:link>
+ <img src="gitblt_25.png" alt="Gitblit"/><br/>
<div style="padding-top:30px;font-weight:bold;" wicket:id="name">[name]</div>
</div>
diff --git a/src/com/gitblit/wicket/pages/MarkdownPage.html b/src/com/gitblit/wicket/pages/MarkdownPage.html index a0f60904..1293f786 100644 --- a/src/com/gitblit/wicket/pages/MarkdownPage.html +++ b/src/com/gitblit/wicket/pages/MarkdownPage.html @@ -6,16 +6,14 @@ <!-- contribute markdown css to the page header -->
<wicket:head>
- <wicket:link>
- <link href="/com/gitblit/wicket/resources/markdown.css" type="text/css" rel="stylesheet" />
- </wicket:link>
+ <link href="markdown.css" type="text/css" rel="stylesheet" />
</wicket:head>
<body>
<wicket:extend>
<!-- markdown nav links -->
<div class="page_nav2">
- <span wicket:id="blameLink">[blame link]</span> | <a wicket:id="historyLink"><wicket:message key="gb.history"></wicket:message></a> | <a wicket:id="rawLink"><wicket:message key="gb.raw"></wicket:message></a> | <a wicket:id="headLink"><wicket:message key="gb.head"></wicket:message></a>
+ <a wicket:id="blameLink"><wicket:message key="gb.blame"></wicket:message></a> | <a wicket:id="historyLink"><wicket:message key="gb.history"></wicket:message></a> | <a wicket:id="rawLink"><wicket:message key="gb.raw"></wicket:message></a> | <a wicket:id="headLink"><wicket:message key="gb.head"></wicket:message></a>
</div>
<!-- markdown content -->
diff --git a/src/com/gitblit/wicket/pages/MarkdownPage.java b/src/com/gitblit/wicket/pages/MarkdownPage.java index 9202fb88..aaf12bad 100644 --- a/src/com/gitblit/wicket/pages/MarkdownPage.java +++ b/src/com/gitblit/wicket/pages/MarkdownPage.java @@ -39,7 +39,8 @@ public class MarkdownPage extends RepositoryPage { RevCommit commit = JGitUtils.getCommit(r, objectId);
// markdown page links
- add(new Label("blameLink", getString("gb.blame")));
+ add(new BookmarkablePageLink<Void>("blameLink", BlamePage.class,
+ WicketUtils.newPathParameter(repositoryName, objectId, markdownPath)));
add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class,
WicketUtils.newPathParameter(repositoryName, objectId, markdownPath)));
add(new BookmarkablePageLink<Void>("rawLink", RawPage.class, WicketUtils.newPathParameter(
diff --git a/src/com/gitblit/wicket/pages/RepositoriesPage.html b/src/com/gitblit/wicket/pages/RepositoriesPage.html index da91cb2e..c8ab5978 100644 --- a/src/com/gitblit/wicket/pages/RepositoriesPage.html +++ b/src/com/gitblit/wicket/pages/RepositoriesPage.html @@ -4,9 +4,7 @@ xml:lang="en"
lang="en">
<wicket:head>
- <wicket:link>
- <link href="/com/gitblit/wicket/resources/markdown.css" type="text/css" rel="stylesheet" />
- </wicket:link>
+ <link href="markdown.css" type="text/css" rel="stylesheet" />
</wicket:head>
<body>
diff --git a/src/com/gitblit/wicket/pages/RepositoriesPage.java b/src/com/gitblit/wicket/pages/RepositoriesPage.java index b0e5e579..f97adff5 100644 --- a/src/com/gitblit/wicket/pages/RepositoriesPage.java +++ b/src/com/gitblit/wicket/pages/RepositoriesPage.java @@ -86,7 +86,7 @@ public class RepositoriesPage extends BasePage { message = MarkdownUtils.transformMarkdown(reader);
} catch (Throwable t) {
message = "Failed to read " + file;
- error(message, t, false);
+ warn(message, t);
}
} else {
message = messageSource + " is not a valid file.";
diff --git a/src/com/gitblit/wicket/pages/RepositoryPage.html b/src/com/gitblit/wicket/pages/RepositoryPage.html index cff7d068..e793a1e9 100644 --- a/src/com/gitblit/wicket/pages/RepositoryPage.html +++ b/src/com/gitblit/wicket/pages/RepositoryPage.html @@ -19,7 +19,7 @@ <!-- page nav links -->
<div class="page_nav">
<a style="text-decoration: none;" wicket:id="syndication">
- <img style="border:0px;vertical-align:middle;" src="/com/gitblit/wicket/resources/feed_16x16.png"></img>
+ <img style="border:0px;vertical-align:middle;" src="feed_16x16.png"></img>
</a>
<a wicket:id="summary"><wicket:message key="gb.summary"></wicket:message></a> | <a wicket:id="log"><wicket:message key="gb.log"></wicket:message></a> | <a wicket:id="branches"><wicket:message key="gb.branches"></wicket:message></a> | <a wicket:id="tags"><wicket:message key="gb.tags"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a> <span wicket:id="extra"><span wicket:id="extraSeparator"></span><span wicket:id="extraLink"></span></span>
</div>
diff --git a/src/com/gitblit/wicket/pages/RepositoryPage.java b/src/com/gitblit/wicket/pages/RepositoryPage.java index cf14ee19..00ed7554 100644 --- a/src/com/gitblit/wicket/pages/RepositoryPage.java +++ b/src/com/gitblit/wicket/pages/RepositoryPage.java @@ -40,8 +40,6 @@ import org.eclipse.jgit.diff.DiffEntry.ChangeType; import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import com.gitblit.GitBlit;
import com.gitblit.Keys;
@@ -65,20 +63,19 @@ public abstract class RepositoryPage extends BasePage { private RepositoryModel m;
- private final Logger logger = LoggerFactory.getLogger(RepositoryPage.class);
-
- private final Map<String, String> knownPages = new HashMap<String, String>() {
+ private final Map<String, PageRegistration> registeredPages = new HashMap<String, PageRegistration>() {
private static final long serialVersionUID = 1L;
{
- put("summary", "gb.summary");
- put("log", "gb.log");
- put("branches", "gb.branches");
- put("tags", "gb.tags");
- put("tree", "gb.tree");
- put("tickets", "gb.tickets");
- put("edit", "gb.edit");
+ put("summary", new PageRegistration("gb.summary", SummaryPage.class));
+ put("log", new PageRegistration("gb.log", LogPage.class));
+ put("branches", new PageRegistration("gb.branches", BranchesPage.class));
+ put("tags", new PageRegistration("gb.tags", TagsPage.class));
+ put("tree", new PageRegistration("gb.tree", TreePage.class));
+ put("tickets", new PageRegistration("gb.tickets", TicketsPage.class));
+ put("edit", new PageRegistration("gb.edit", EditRepositoryPage.class));
+ put("docs", new PageRegistration("gb.docs", DocsPage.class));
}
};
@@ -95,26 +92,17 @@ public abstract class RepositoryPage extends BasePage { RepositoryModel model = getRepositoryModel();
// standard page links
- add(new BookmarkablePageLink<Void>("summary", SummaryPage.class,
- WicketUtils.newRepositoryParameter(repositoryName)));
- add(new BookmarkablePageLink<Void>("log", LogPage.class,
- WicketUtils.newRepositoryParameter(repositoryName)));
- add(new BookmarkablePageLink<Void>("branches", BranchesPage.class,
- WicketUtils.newRepositoryParameter(repositoryName)));
- add(new BookmarkablePageLink<Void>("tags", TagsPage.class,
- WicketUtils.newRepositoryParameter(repositoryName)));
- add(new BookmarkablePageLink<Void>("tree", TreePage.class,
- WicketUtils.newRepositoryParameter(repositoryName)));
+ addRegisteredPageLink("summary");
+ addRegisteredPageLink("log");
+ addRegisteredPageLink("branches");
+ addRegisteredPageLink("tags");
+ addRegisteredPageLink("tree");
// per-repository extra page links
List<String> extraPageLinks = new ArrayList<String>();
-
- // Conditionally add tickets link
if (model.useTickets && TicgitUtils.getTicketsBranch(r) != null) {
extraPageLinks.add("tickets");
}
-
- // Conditionally add docs link
if (model.useDocs) {
extraPageLinks.add("docs");
}
@@ -135,26 +123,19 @@ public abstract class RepositoryPage extends BasePage { extraPageLinks.add("edit");
}
+ final String pageName = getPageName();
+ final String pageWicketId = getLinkWicketId(pageName);
ListDataProvider<String> extrasDp = new ListDataProvider<String>(extraPageLinks);
DataView<String> extrasView = new DataView<String>("extra", extrasDp) {
private static final long serialVersionUID = 1L;
public void populateItem(final Item<String> item) {
String extra = item.getModelObject();
- if (extra.equals("tickets")) {
- item.add(new Label("extraSeparator", " | "));
- item.add(new LinkPanel("extraLink", null, getString("gb.tickets"),
- TicketsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));
- } else if (extra.equals("docs")) {
- item.add(new Label("extraSeparator", " | "));
- item.add(new LinkPanel("extraLink", null, getString("gb.docs"), DocsPage.class,
- WicketUtils.newRepositoryParameter(repositoryName)));
- } else if (extra.equals("edit")) {
- item.add(new Label("extraSeparator", " | "));
- item.add(new LinkPanel("extraLink", null, getString("gb.edit"),
- EditRepositoryPage.class, WicketUtils
- .newRepositoryParameter(repositoryName)));
- }
+ PageRegistration pageReg = registeredPages.get(extra);
+ item.add(new Label("extraSeparator", " | "));
+ item.add(new LinkPanel("extraLink", null, getString(pageReg.translationKey),
+ pageReg.pageClass, WicketUtils.newRepositoryParameter(repositoryName))
+ .setEnabled(!extra.equals(pageWicketId)));
}
};
add(extrasView);
@@ -163,7 +144,7 @@ public abstract class RepositoryPage extends BasePage { .getRelativePathPrefixToContextRoot(), repositoryName, null, 0)));
// disable current page
- disablePageLink(getPageName());
+ disableRegisteredPageLink(pageName);
// add floating search form
SearchForm searchForm = new SearchForm("searchForm", repositoryName);
@@ -174,18 +155,31 @@ public abstract class RepositoryPage extends BasePage { setStatelessHint(true);
}
- public void disablePageLink(String pageName) {
- for (String wicketId : knownPages.keySet()) {
- String key = knownPages.get(wicketId);
+ public String getLinkWicketId(String pageName) {
+ for (String wicketId : registeredPages.keySet()) {
+ String key = registeredPages.get(wicketId).translationKey;
String linkName = getString(key);
if (linkName.equals(pageName)) {
- Component c = get(wicketId);
- if (c != null) {
- c.setEnabled(false);
- }
- break;
+ return wicketId;
}
}
+ return null;
+ }
+
+ public void disableRegisteredPageLink(String pageName) {
+ String wicketId = getLinkWicketId(pageName);
+ if (!StringUtils.isEmpty(wicketId)) {
+ Component c = get(wicketId);
+ if (c != null) {
+ c.setEnabled(false);
+ }
+ }
+ }
+
+ private void addRegisteredPageLink(String key) {
+ PageRegistration pageReg = registeredPages.get(key);
+ add(new BookmarkablePageLink<Void>(key, pageReg.pageClass,
+ WicketUtils.newRepositoryParameter(repositoryName)));
}
protected void addSyndicationDiscoveryLink() {
@@ -339,6 +333,16 @@ public abstract class RepositoryPage extends BasePage { return WicketUtils.newPathParameter(repositoryName, objectId, path);
}
+ private static class PageRegistration {
+ final String translationKey;
+ final Class<? extends BasePage> pageClass;
+
+ PageRegistration(String translationKey, Class<? extends BasePage> pageClass) {
+ this.translationKey = translationKey;
+ this.pageClass = pageClass;
+ }
+ }
+
private static class SearchForm extends StatelessForm<Void> {
private static final long serialVersionUID = 1L;
diff --git a/src/com/gitblit/wicket/pages/SummaryPage.html b/src/com/gitblit/wicket/pages/SummaryPage.html index 7784a471..bbf89798 100644 --- a/src/com/gitblit/wicket/pages/SummaryPage.html +++ b/src/com/gitblit/wicket/pages/SummaryPage.html @@ -5,9 +5,7 @@ lang="en">
<wicket:head>
- <wicket:link>
- <link href="/com/gitblit/wicket/resources/markdown.css" type="text/css" rel="stylesheet" />
- </wicket:link>
+ <link href="markdown.css" type="text/css" rel="stylesheet" />
</wicket:head>
<body>
diff --git a/src/com/gitblit/wicket/pages/SummaryPage.java b/src/com/gitblit/wicket/pages/SummaryPage.java index 0d0db86b..e31375c0 100644 --- a/src/com/gitblit/wicket/pages/SummaryPage.java +++ b/src/com/gitblit/wicket/pages/SummaryPage.java @@ -122,7 +122,7 @@ public class SummaryPage extends RepositoryPage { }
StringBuilder sb = new StringBuilder();
sb.append(WicketUtils.getHostURL(getRequestCycle().getRequest()));
- sb.append(Constants.GIT_SERVLET_PATH);
+ sb.append(Constants.GIT_PATH);
sb.append(repositoryName);
repositoryUrls.add(sb.toString());
} else {
diff --git a/src/com/gitblit/wicket/panels/RepositoriesPanel.html b/src/com/gitblit/wicket/panels/RepositoriesPanel.html index 1e609e10..7e090e80 100644 --- a/src/com/gitblit/wicket/panels/RepositoriesPanel.html +++ b/src/com/gitblit/wicket/panels/RepositoriesPanel.html @@ -21,9 +21,7 @@ <wicket:fragment wicket:id="adminLinks">
<!-- page nav links -->
<div class="admin_nav">
- <wicket:link>
- <img style="vertical-align: top;" src="/com/gitblit/wicket/resources/add_16x16.png"/>
- </wicket:link>
+ <img style="vertical-align: top;" src="add_16x16.png"/>
<a wicket:id="newRepository">
<wicket:message key="gb.newRepository"></wicket:message>
</a>
@@ -41,9 +39,7 @@ <wicket:fragment wicket:id="flatRepositoryHeader">
<tr>
<th class="left" wicket:id="orderByRepository">
- <wicket:link>
- <img style="vertical-align: top; border: 1px solid #888;" src="/com/gitblit/wicket/resources/gitweb-favicon.png"/>
- </wicket:link>
+ <img style="vertical-align: top; border: 1px solid #888;" src="gitweb-favicon.png"/>
<wicket:message key="gb.repository">Repository</wicket:message>
</th>
<th wicket:id="orderByDescription"><wicket:message key="gb.description">Description</wicket:message></th>
@@ -57,9 +53,7 @@ <wicket:fragment wicket:id="groupRepositoryHeader">
<tr>
<th class="left">
- <wicket:link>
- <img style="vertical-align: top; border: 1px solid #888;" src="/com/gitblit/wicket/resources/gitweb-favicon.png"/>
- </wicket:link>
+ <img style="vertical-align: top; border: 1px solid #888;" src="gitweb-favicon.png"/>
<wicket:message key="gb.repository">Repository</wicket:message>
</th>
<th><wicket:message key="gb.description">Description</wicket:message></th>
@@ -83,7 +77,7 @@ <td class="rightAlign">
<span wicket:id="repositoryLinks"></span>
<a style="text-decoration: none;" wicket:id="syndication">
- <img style="border:0px;vertical-align:middle;" src="/com/gitblit/wicket/resources/feed_16x16.png"></img>
+ <img style="border:0px;vertical-align:middle;" src="feed_16x16.png"></img>
</a>
</td>
</wicket:fragment>
diff --git a/src/com/gitblit/wicket/panels/SearchPanel.html b/src/com/gitblit/wicket/panels/SearchPanel.html index 7c8f96f2..bfbcb6ba 100644 --- a/src/com/gitblit/wicket/panels/SearchPanel.html +++ b/src/com/gitblit/wicket/panels/SearchPanel.html @@ -8,8 +8,10 @@ <wicket:panel>
<!-- header -->
- <div class="header" wicket:id="header">[search header]</div>
+ <div wicket:id="commitHeader">[search header]</div>
+ <!-- header -->
+ <div style="margin-top:10px;font-weight:bold;" class="header"><wicket:message key="gb.search"></wicket:message>: <span wicket:id="searchString">[search string]</span> (<span wicket:id="searchType">[search type]</span>)</div>
<table class="pretty">
<tbody>
<tr wicket:id="commit">
diff --git a/src/com/gitblit/wicket/panels/SearchPanel.java b/src/com/gitblit/wicket/panels/SearchPanel.java index 5f82a428..759040e6 100644 --- a/src/com/gitblit/wicket/panels/SearchPanel.java +++ b/src/com/gitblit/wicket/panels/SearchPanel.java @@ -19,6 +19,7 @@ import java.util.Date; import java.util.List;
import java.util.Map;
+import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.markup.repeater.data.DataView;
@@ -72,9 +73,10 @@ public class SearchPanel extends BasePanel { hasMore = commits.size() >= itemsPerPage;
// header
- add(new LinkPanel("header", "title", commit == null ? "" : commit.getShortMessage(),
- CommitPage.class, WicketUtils.newObjectParameter(repositoryName,
- commit == null ? "" : commit.getName())));
+ add(new CommitHeaderPanel("commitHeader", repositoryName, commit));
+
+ add(new Label("searchString", value));
+ add(new Label("searchType", searchType.toString()));
ListDataProvider<RevCommit> dp = new ListDataProvider<RevCommit>(commits);
DataView<RevCommit> searchView = new DataView<RevCommit>("commit", dp) {
diff --git a/src/com/gitblit/wicket/panels/UsersPanel.html b/src/com/gitblit/wicket/panels/UsersPanel.html index 39074b2f..eed2a887 100644 --- a/src/com/gitblit/wicket/panels/UsersPanel.html +++ b/src/com/gitblit/wicket/panels/UsersPanel.html @@ -12,9 +12,7 @@ <table class="repositories">
<tr>
<th class="left">
- <wicket:link>
- <img style="vertical-align: top; border: 1px solid #888; background-color: white;" src="/com/gitblit/wicket/resources/user_16x16.png"/>
- </wicket:link>
+ <img style="vertical-align: top; border: 1px solid #888; background-color: white;" src="user_16x16.png"/>
<wicket:message key="gb.username">[username]</wicket:message>
</th>
<th class="right"></th>
@@ -30,9 +28,7 @@ <wicket:fragment wicket:id="adminLinks">
<!-- page nav links -->
<div class="admin_nav">
- <wicket:link>
- <img style="vertical-align: top;" src="/com/gitblit/wicket/resources/add_16x16.png"/>
- </wicket:link>
+ <img style="vertical-align: top;" src="add_16x16.png"/>
<a wicket:id="newUser">
<wicket:message key="gb.newUser"></wicket:message>
</a>
diff --git a/src/com/gitblit/wicket/resources/add_16x16.png b/src/com/gitblit/wicket/resources/add_16x16.png Binary files differdeleted file mode 100644 index 0ea124a7..00000000 --- a/src/com/gitblit/wicket/resources/add_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/arrow_down.png b/src/com/gitblit/wicket/resources/arrow_down.png Binary files differdeleted file mode 100644 index f31cc819..00000000 --- a/src/com/gitblit/wicket/resources/arrow_down.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/arrow_off.png b/src/com/gitblit/wicket/resources/arrow_off.png Binary files differdeleted file mode 100644 index f9b1ced2..00000000 --- a/src/com/gitblit/wicket/resources/arrow_off.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/arrow_up.png b/src/com/gitblit/wicket/resources/arrow_up.png Binary files differdeleted file mode 100644 index 63031c33..00000000 --- a/src/com/gitblit/wicket/resources/arrow_up.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/background.png b/src/com/gitblit/wicket/resources/background.png Binary files differdeleted file mode 100644 index 6f75e43d..00000000 --- a/src/com/gitblit/wicket/resources/background.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/blank.png b/src/com/gitblit/wicket/resources/blank.png Binary files differdeleted file mode 100644 index 109296b9..00000000 --- a/src/com/gitblit/wicket/resources/blank.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/book_16x16.png b/src/com/gitblit/wicket/resources/book_16x16.png Binary files differdeleted file mode 100644 index e48ff95e..00000000 --- a/src/com/gitblit/wicket/resources/book_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/bug_16x16.png b/src/com/gitblit/wicket/resources/bug_16x16.png Binary files differdeleted file mode 100644 index c7299fd7..00000000 --- a/src/com/gitblit/wicket/resources/bug_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/bullet_error.png b/src/com/gitblit/wicket/resources/bullet_error.png Binary files differdeleted file mode 100644 index b2e6b752..00000000 --- a/src/com/gitblit/wicket/resources/bullet_error.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/cold_16x16.png b/src/com/gitblit/wicket/resources/cold_16x16.png Binary files differdeleted file mode 100644 index 79cb7567..00000000 --- a/src/com/gitblit/wicket/resources/cold_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/commit_branch_16x16.png b/src/com/gitblit/wicket/resources/commit_branch_16x16.png Binary files differdeleted file mode 100644 index d1fe7175..00000000 --- a/src/com/gitblit/wicket/resources/commit_branch_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/commit_divide_16x16.png b/src/com/gitblit/wicket/resources/commit_divide_16x16.png Binary files differdeleted file mode 100644 index e611bd57..00000000 --- a/src/com/gitblit/wicket/resources/commit_divide_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/commit_join_16x16.png b/src/com/gitblit/wicket/resources/commit_join_16x16.png Binary files differdeleted file mode 100644 index 51e7de97..00000000 --- a/src/com/gitblit/wicket/resources/commit_join_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/commit_merge_16x16.png b/src/com/gitblit/wicket/resources/commit_merge_16x16.png Binary files differdeleted file mode 100644 index 5a066e59..00000000 --- a/src/com/gitblit/wicket/resources/commit_merge_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/commit_up_16x16.png b/src/com/gitblit/wicket/resources/commit_up_16x16.png Binary files differdeleted file mode 100644 index 30d005f2..00000000 --- a/src/com/gitblit/wicket/resources/commit_up_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/feed_16x16.png b/src/com/gitblit/wicket/resources/feed_16x16.png Binary files differdeleted file mode 100644 index 99987a30..00000000 --- a/src/com/gitblit/wicket/resources/feed_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/file_16x16.png b/src/com/gitblit/wicket/resources/file_16x16.png Binary files differdeleted file mode 100644 index eda44886..00000000 --- a/src/com/gitblit/wicket/resources/file_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/file_acrobat_16x16.png b/src/com/gitblit/wicket/resources/file_acrobat_16x16.png Binary files differdeleted file mode 100644 index f1627837..00000000 --- a/src/com/gitblit/wicket/resources/file_acrobat_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/file_c_16x16.png b/src/com/gitblit/wicket/resources/file_c_16x16.png Binary files differdeleted file mode 100644 index 44045a9b..00000000 --- a/src/com/gitblit/wicket/resources/file_c_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/file_code_16x16.png b/src/com/gitblit/wicket/resources/file_code_16x16.png Binary files differdeleted file mode 100644 index 931b0d6a..00000000 --- a/src/com/gitblit/wicket/resources/file_code_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/file_cpp_16x16.png b/src/com/gitblit/wicket/resources/file_cpp_16x16.png Binary files differdeleted file mode 100644 index d3f55ee0..00000000 --- a/src/com/gitblit/wicket/resources/file_cpp_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/file_cs_16x16.png b/src/com/gitblit/wicket/resources/file_cs_16x16.png Binary files differdeleted file mode 100644 index 80130209..00000000 --- a/src/com/gitblit/wicket/resources/file_cs_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/file_doc_16x16.png b/src/com/gitblit/wicket/resources/file_doc_16x16.png Binary files differdeleted file mode 100644 index 225c3b09..00000000 --- a/src/com/gitblit/wicket/resources/file_doc_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/file_excel_16x16.png b/src/com/gitblit/wicket/resources/file_excel_16x16.png Binary files differdeleted file mode 100644 index 04e03327..00000000 --- a/src/com/gitblit/wicket/resources/file_excel_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/file_h_16x16.png b/src/com/gitblit/wicket/resources/file_h_16x16.png Binary files differdeleted file mode 100644 index 3f7f5394..00000000 --- a/src/com/gitblit/wicket/resources/file_h_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/file_java_16x16.png b/src/com/gitblit/wicket/resources/file_java_16x16.png Binary files differdeleted file mode 100644 index 16620e5c..00000000 --- a/src/com/gitblit/wicket/resources/file_java_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/file_php_16x16.png b/src/com/gitblit/wicket/resources/file_php_16x16.png Binary files differdeleted file mode 100644 index 4ac56183..00000000 --- a/src/com/gitblit/wicket/resources/file_php_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/file_ppt_16x16.png b/src/com/gitblit/wicket/resources/file_ppt_16x16.png Binary files differdeleted file mode 100644 index 44bbf26f..00000000 --- a/src/com/gitblit/wicket/resources/file_ppt_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/file_ruby_16x16.png b/src/com/gitblit/wicket/resources/file_ruby_16x16.png Binary files differdeleted file mode 100644 index f29349da..00000000 --- a/src/com/gitblit/wicket/resources/file_ruby_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/file_settings_16x16.png b/src/com/gitblit/wicket/resources/file_settings_16x16.png Binary files differdeleted file mode 100644 index 92953fec..00000000 --- a/src/com/gitblit/wicket/resources/file_settings_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/file_vs_16x16.png b/src/com/gitblit/wicket/resources/file_vs_16x16.png Binary files differdeleted file mode 100644 index 645fa7a0..00000000 --- a/src/com/gitblit/wicket/resources/file_vs_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/file_world_16x16.png b/src/com/gitblit/wicket/resources/file_world_16x16.png Binary files differdeleted file mode 100644 index 0a4fa8be..00000000 --- a/src/com/gitblit/wicket/resources/file_world_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/file_zip_16x16.png b/src/com/gitblit/wicket/resources/file_zip_16x16.png Binary files differdeleted file mode 100644 index 15845924..00000000 --- a/src/com/gitblit/wicket/resources/file_zip_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/folder_16x16.png b/src/com/gitblit/wicket/resources/folder_16x16.png Binary files differdeleted file mode 100644 index f1ed9abe..00000000 --- a/src/com/gitblit/wicket/resources/folder_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/gitblit.css b/src/com/gitblit/wicket/resources/gitblit.css deleted file mode 100644 index 498c1a77..00000000 --- a/src/com/gitblit/wicket/resources/gitblit.css +++ /dev/null @@ -1,819 +0,0 @@ -/*
- Git:Blit css.
-*/
-html, body, table, dl, dt, dd, ol, ul, li, form, a, span, tr, th, td, div, em {
- font-family: verdana, sans-serif;
- font-size: 12px;
- line-height: 1.35em;
- margin: 0;
- padding: 0;
- border: 0;
- outline: 0;
-}
-
-body {
- width: 980px;
- margin: 5px;
- background-color: #ffffff;
- color: #000000;
- margin-right: auto;
- margin-left: auto;
- padding: 0px;
- background: url(background.png) repeat-x scroll 0 0 #FFFFFF;
-}
-
-pre, code, pre.prettyprint, pre.plainprint {
- color: black;
- font-family: monospace;
- font-size:12px;
- border:0px;
-}
-
-pre.prettyprint ol {
- padding-left:25px;
-}
-
-/* age0: age < 60*60*2 */
-.age0 {
- color: #008000;
- font-style: italic;
- font-weight: bold;
-}
-
-/* age1: 60*60*2 <= age < 60*60*24*2 */
-.age1 {
- color: #008000;
- font-style: italic;
-}
-
-/* age2: 60*60*24*2 <= age */
-.age2 {
- font-style: italic;
-}
-
-img.inlineIcon {
- padding-left: 1px;
- padding-right: 1px;
-}
-
-a {
- color: #0000cc;
-}
-
-a:hover, a:visited, a:active {
- color: #880000;
-}
-
-img.logo {
- float: right;
- border-width: 0px;
-}
-
-img.activityGraph {
- float: right;
- border-width: 0px;
- padding: 8px;
-}
-
-div.repositories_message {
- line-height: inherit;
-}
-
-div.header, div.commitHeader {
- background-color: #D2C3AF;
- padding: 3px;
- border: 1px solid #808080;
-}
-
-div.header {
- border-radius: 3px 3px 0 0;
-}
-
-div.commitHeader {
- border-radius: 3px;
-}
-
-div.header a, div.commitHeader a {
- color: black;
- text-decoration: none;
- font-weight: bold;
-}
-
-div.header a:hover, div.commitHeader a:hover {
- text-decoration: underline;
-}
-
-div.pager {
- padding: 0px 0px 15px 5px;
-}
-
-span.empty {
- font-size: 0.9em;
- font-style: italic;
- padding-left:10px;
- color: #008000;
-}
-
-span.link {
- color: #888;
-}
-
-span.link, span.link a {
- font-family: sans-serif;
- font-size: 11px;
-}
-
-span.link em, div.link span em {
- font-style: normal;
- font-family: sans-serif;
- font-size: 11px;
-}
-
-div.page_header {
- height: 25px;
- padding: 5px;
- font-family: sans-serif;
- font-weight: bold;
- font-size: 150%;
- color: #888;
- background: transparent;
-}
-
-div.page_header span {
- font-family: inherit;
- font-size: inherit;
-}
-
-div.page_header a {
- font-size: inherit;
- font-family: inherit;
- text-decoration: none;
-}
-
-div.page_header a:visited {
- color: #000000;
-}
-
-div.page_header a:hover {
- color: #E66C2C;
- text-decoration: underline;
-}
-
-div.page_footer {
- clear: both;
- height: 17px;
- color: black;
- background-color: #ffffff;
- padding: 5px;
- border-top: 1px solid #bbb;
- font-style: italic;
-}
-
-div.page_nav {
- color: #ddd;
- background-color: #000070;
- padding: 7px;
- border-radius: 3px;
-}
-
-div.page_nav a {
- color: yellow;
- text-decoration: none;
-}
-
-div.page_nav a:hover {
- text-decoration: underline;
-}
-
-div.page_nav em {
- font-style: normal;
-}
-
-div.page_nav2 {
- padding: 2px 5px 7px 5px;
-}
-
-div.admin_nav {
- border: 1px solid #888;
- border-bottom: 0px;
- background:#dae0d2;
- text-align: right;
- padding: 5px 5px 5px 2px;
-}
-
-div.admin_nav a {
- text-decoration: none;
-}
-
-div.admin_nav a:hover {
- text-decoration: underline;
-}
-
-div.search {
- color:yellow;
- text-align:right;
- float:right;
- padding:4px 4px 3px 3px;
- border-left: 1px solid #8080f0;
- margin: 0px;
- height: 23px;
-}
-
-div.search input {
- vertical-align: top;
- background: url(/com/gitblit/wicket/resources/search-icon.png) no-repeat 4px center;
- color: #ddd;
- background-color: #000070;
- border: 1px solid transparent;
- padding: 2px 2px 2px 22px;
- margin: 0px;
-}
-
-div.search input:hover, div.search input:focus {
- color: white;
- border-bottom: 1px solid orange;
- outline: none;
-}
-
-div.page_path {
- padding: 8px;
- font-weight: bold;
- border: solid #bbb;
- border-width: 0px 0px 1px;
-}
-
-div.commit_message {
- font-family: monospace;
- padding: 8px;
- border: solid #bbb;
- border-width: 1px 0px 0px;
-}
-
-div.commit_message a {
- font-family: monospace;
-}
-
-div.bug_open, span.bug_open {
- padding: 2px;
- background-color: #803333;
- color: white;
- text-align: center;
-}
-
-div.bug_resolved, span.bug_resolved {
- padding: 2px;
- background-color: #408040;
- color: white;
- text-align: center;
-}
-
-div.bug_invalid, span.bug_invalid {
- padding: 2px;
- background-color: gray;
- text-align: center;
-}
-
-div.bug_hold, span.bug_hold {
- padding: 2px;
- background-color: orange;
- text-align: center;
-}
-
-div.diff {
- font-family: monospace;
- overflow: auto;
-}
-
-div.diff.header {
- -moz-border-bottom-colors: none;
- -moz-border-image: none;
- -moz-border-left-colors: none;
- -moz-border-right-colors: none;
- -moz-border-top-colors: none;
- background-color: #EDECE6;
- border-color: #D9D8D1;
- border-style: solid;
- border-width: 1px;
- font-weight: bold;
- margin-top: 10px;
- padding: 4px 0 2px;
-}
-
-div.diff.extended_header {
- background-color: #F6F5EE;
- padding: 2px 0;
- font-family: inherit;
-}
-
-span.diff.add {
- color: #008800;
- font-family: inherit;
-}
-
-span.diff.remove {
- color: #FFDDDD;
- font-family: inherit;
-}
-
-span.diff.unchanged {
- color: inherit;
- font-family: inherit;
-}
-
-div.diff.hunk_header {
- -moz-border-bottom-colors: none;
- -moz-border-image: none;
- -moz-border-left-colors: none;
- -moz-border-right-colors: none;
- -moz-border-top-colors: none;
- border-color: #FFE0FF;
- border-style: dotted;
- border-width: 1px 0 0;
- margin-top: 2px;
- font-family: inherit;
-}
-
-span.diff.hunk_info {
- background-color: #FFEEFF;
- color: #990099;
- font-family: inherit;
-}
-
-span.diff.hunk_section {
- color: #AA22AA;
- font-family: inherit;
-}
-
-div.diff.add2 {
- background-color: #DDFFDD;
- font-family: inherit;
-}
-
-div.diff.remove2 {
- background-color: #FFDDDD;
- font-family: inherit;
-}
-
-div.diff table {
- border-right: 1px solid #bbb;
- border-bottom: 1px solid #bbb;
- width: 100%;
-}
-
-div.diff table th, div.diff table td {
- margin: 0px;
- padding: 0px;
- font-family: monospace;
-}
-
-div.diff table th {
- background-color: #faf8dc;
- border-left: 1px solid #bbb;
- text-align: center;
- color: #999;
- padding-left: 5px;
- padding-right: 5px;
- width: 30px;
-}
-
-div.diff table th.header {
- background-color: #D2C3AF;
- border-right: 0px;
- border-bottom: 1px solid #808080;
- font-family: inherit;
- font-size:0.9em;
- color: black;
- padding: 2px;
- text-align: left;
-}
-
-div.diff table td.hunk_header {
- background-color: #dAe2e5 !important;
- border-bottom: 1px solid #bac2c5;
- color: #555;
-}
-
-div.diff table td {
- border-left: 1px solid #bbb;
- background-color: #fbfbfb;
-}
-
-td.changeType {
- width: 15px;
-}
-
-span.addition, span.modification, span.deletion, span.rename {
- border: 1px solid #888;
- float: left;
- height: 0.8em;
- margin: 0.2em 0.5em 0 0;
- overflow: hidden;
- width: 0.8em;
-}
-
-span.addition {
- background-color: #ccffcc;
-}
-
-span.modification {
- background-color: #ffdd88;
-}
-
-span.deletion {
- background-color: #f8bbbb;
-}
-
-span.rename {
- background-color: #cAc2f5;
-}
-
-div.commitLegend {
- float: right;
- padding: 0.4em 0.4em 0.2em 0.4em;
- vertical-align:top;
- margin: 0px;
-}
-
-div.commitLegend span {
- font-size: 0.9em;
- vertical-align: top;
-}
-
-div.references {
- float: right;
- text-align: right;
-}
-
-a.list {
- text-decoration: none;
- color: #000000;
-}
-
-a.list.subject {
- font-weight: bold;
-}
-
-a.list.name {
- font-weight: bold;
-}
-
-a.list:hover {
- text-decoration: underline;
- color: #880000;
-}
-
-table {
- border-spacing: 0px;
-}
-
-th {
- padding: 2px 5px;
- font-size: 100%;
- text-align: left;
-}
-
-table.screenshots td {
- text-align: center;
- padding-bottom: 10px;
-}
-
-table.screenshots img {
- border: 1px solid #ccc;
- margin: 5px;
-}
-
-table.plain {
- padding: 8px;
-}
-
-table.plain td {
- white-space: nowrap;
-}
-
-table.plain td.edit {
- padding: 3px;
-}
-
-table.plain td.editButton {
- padding:0px;
- padding-top: 10px;
-}
-
-table.plain td.edit input {
- margin: 0px;
- outline: 1px solid transparent;
- border: 1px solid #ccc;
- padding-left:5px;
-}
-
-table.plain td.edit input:focus, table.plain td.edit input:hover{
- border: 1px solid orange;
-}
-
-table.pretty, table.comments {
- margin-bottom:5px;
- border-spacing: 0px;
- border-left: 1px solid #bbb;
- border-right: 1px solid #bbb;
-}
-
-table.pretty, table.comments, table.repositories, table.gitnotes {
- width:100%;
-}
-
-table.pretty td.icon {
- padding: 0px 0px 0px 2px;
- width: 18px;
-}
-
-table.pretty td.icon img {
- vertical-align: top;
-}
-
-table.pretty td {
- padding: 2px 4px;
-}
-
-table.comments td {
- padding: 4px;
- line-height: 17px;
-}
-
-table.repositories {
- margin-bottom:5px;
- border-spacing: 0px;
-}
-
-table.repositories th {
- background-color:#D2C3AF;
- padding: 4px;
- border-top: 1px solid #808080;
- border-bottom: 1px solid #808080;
-}
-
-table.repositories th.left, table.repositories td.left {
- border-left: 1px solid #808080;
- padding-left: 5px;
-}
-
-table.repositories td.left {
- padding-left: 10px;
-}
-
-table.repositories th.right, table.repositories td.right {
- border-right: 1px solid #808080;
-}
-
-table.repositories td {
- padding: 2px;
-}
-
-table.repositories td.rightAlign {
- text-align: right;
- border-right: 1px solid #808080;
-}
-
-table.repositories td.icon img {
- vertical-align: top;
-}
-
-table.repositories th a {
- color:black;/*#ddd;*/
- text-decoration: none;
- font-weight: normal;
-}
-
-table.repositories th a:hover {
- text-decoration: underline;
-}
-
-table.repositories th.wicket_orderDown a, table.repositories th.wicket_orderUp a {
- color: black;
- font-weight: bold;
-}
-
-table.repositories tr.group {
- background-color: #E66C2C;
-}
-
-table.repositories tr.group td {
- font-weight: bold;
- border-bottom: 1px solid orange;
- color: white;
- background-color: #E66C2C;
- border-left: 1px solid #808080;
- border-right: 1px solid #808080;
- padding-left: 5px;
-}
-
-table.palette { border:0;}
-table.palette td.header {
- font-weight: bold;
- background-color: #D2C3AF !important;
- padding: 3px !important;
- border: 1px solid #808080 !important;
- border-bottom: 0px solid !important;
- border-radius: 3px 3px 0 0;
-}
-table.palette td.pane {
- padding: 0px;
-}
-
-table.gitnotes {
- padding-bottom: 5px;
-}
-table.gitnotes td {
- border-top: 1px solid #ccc;
- padding-top: 3px;
- vertical-align:top;
-}
-
-table.gitnotes td table td {
- border: none;
- padding-top: 0px;
-}
-
-table.gitnotes td.info {
-}
-
-table.gitnotes td.message {
- width: 65%;
- border-left: 1px solid #ccc;
-}
-
-table.annotated {
- width: 100%;
- border: 1px solid #bbb;
-}
-
-table.annotated tr.even {
- background-color: white;
-}
-
-table.annotated tr.odd {
- background-color: #fdfbdf;
-}
-
-tr th a { padding-right: 15px; background-position: right; background-repeat:no-repeat; }
-tr th.wicket_orderDown a {background-image: url(arrow_down.png); }
-tr th.wicket_orderUp a { background-image: url(arrow_up.png); }
-tr th.wicket_orderNone a { background-image: url(arrow_off.png); }
-
-tr.light {
- background-color: #ffffff;
-}
-
-tr.light td {
- border-bottom: 1px solid #bbb;
-}
-
-tr.dark {
- background-color: #faf8dc;
- border-bottom: 1px solid #bbb;
-}
-
-tr.dark td {
- border-bottom: 1px solid #bbb;
-}
-
-/* currently both use the same, but it can change */
-tr.light:hover,
-tr.dark:hover {
- /*background-color: #0099b7;*/
- background-color: #000070;
- color: white;
-}
-
-tr.light:hover a,
-tr.dark:hover a {
- color: white;
-}
-
-td {
- padding-left: 7px;
- padding-right: 7px;
-}
-
-td.author {
- font-style: italic;
-}
-
-td.date {
- font-style: italic;
-}
-
-span.sha1, span.sha1 a, span.sha1 a span {
- font-family: monospace;
- font-size: 13px;
-}
-
-td.mode {
- text-align: right;
- font-family: monospace;
- width: 8em;
- padding-right:15px;
-}
-
-td.size {
- text-align: right;
- width: 8em;
- padding-right:15px;
-}
-
-td.rightAlign {
- text-align: right;
-}
-
-td.treeLinks {
- text-align: right;
- width: 13em;
-}
-
-span.metricsTitle {
- font-size: 2em;
-}
-
-span .tagRef, span .headRef, span .localBranch, span .remoteBranch, span .otherRef {
- padding: 0px 3px;
- margin-right:2px;
- font-family: sans-serif;
- font-size: 9px;
- font-weight: normal;
- border: 1px solid;
- color: black;
-}
-
-span .tagRef a span, span .headRef a span, span .localBranch a span, span .remoteBranch a span, span .otherRef a span {
- font-size: 9px;
-}
-
-span .tagRef a, span .headRef a, span .localBranch a, span .remoteBranch a, span .otherRef a {
- text-decoration: none;
- color: black !important;
-}
-
-span .tagRef a:hover, span .headRef a:hover, span .localBranch a:hover, span .remoteBranch a:hover, span .otherRef a:hover {
- color: black !important;
- text-decoration: underline;
-}
-
-span .otherRef {
- background-color: #b0e0f0;
- border-color: #80aaaa;
-}
-
-span .remoteBranch {
- background-color: #cAc2f5;
- border-color: #6c6cbf;
-}
-
-span .tagRef {
- background-color: #ffffaa;
- border-color: #ffcc00;
-}
-
-span .headRef {
- background-color: #ffaaff;
- border-color: #ff00ee;
-}
-
-span .localBranch {
- background-color: #ccffcc;
- border-color: #00cc33;
-}
-
-.feedbackPanelERROR {
- color: red;
- list-style-image: url(bullet_error.png);
- font-weight: bold;
- vertical-align: top;
- padding:0;
- margin:0;
-}
-
-.feedbackPanelINFO {
- color: green;
- list-style: none;
- font-weight: bold;
- padding:0;
- margin:0;
-}
-
-/* google-code-prettify line numbers */
-li.L0,
-li.L1,
-li.L2,
-li.L3,
-li.L4,
-li.L5,
-li.L6,
-li.L7,
-li.L8,
-li.L9 { color: #888; border-left: 1px solid #ccc; padding-left:5px; list-style-type: decimal !important; }
-
-/* Alternate shading for lines */
-li.L1,
-li.L3,
-li.L5,
-li.L7,
-li.L9 { background: #fafafa !important; }
\ No newline at end of file diff --git a/src/com/gitblit/wicket/resources/gitblt-favicon.png b/src/com/gitblit/wicket/resources/gitblt-favicon.png Binary files differdeleted file mode 100644 index f6ac1540..00000000 --- a/src/com/gitblit/wicket/resources/gitblt-favicon.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/gitblt-logo.png b/src/com/gitblit/wicket/resources/gitblt-logo.png Binary files differdeleted file mode 100644 index 7ec945b5..00000000 --- a/src/com/gitblit/wicket/resources/gitblt-logo.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/gitblt2.png b/src/com/gitblit/wicket/resources/gitblt2.png Binary files differdeleted file mode 100644 index c1642941..00000000 --- a/src/com/gitblit/wicket/resources/gitblt2.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/gitblt_25.png b/src/com/gitblit/wicket/resources/gitblt_25.png Binary files differdeleted file mode 100644 index ad580fad..00000000 --- a/src/com/gitblit/wicket/resources/gitblt_25.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/gitweb-favicon.png b/src/com/gitblit/wicket/resources/gitweb-favicon.png Binary files differdeleted file mode 100644 index de637c06..00000000 --- a/src/com/gitblit/wicket/resources/gitweb-favicon.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/lock_16x16.png b/src/com/gitblit/wicket/resources/lock_16x16.png Binary files differdeleted file mode 100644 index ddf83d95..00000000 --- a/src/com/gitblit/wicket/resources/lock_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/lock_go_16x16.png b/src/com/gitblit/wicket/resources/lock_go_16x16.png Binary files differdeleted file mode 100644 index 63d42859..00000000 --- a/src/com/gitblit/wicket/resources/lock_go_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/lock_pull_16x16.png b/src/com/gitblit/wicket/resources/lock_pull_16x16.png Binary files differdeleted file mode 100644 index 85c5c53e..00000000 --- a/src/com/gitblit/wicket/resources/lock_pull_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/markdown.css b/src/com/gitblit/wicket/resources/markdown.css deleted file mode 100644 index 41bc4392..00000000 --- a/src/com/gitblit/wicket/resources/markdown.css +++ /dev/null @@ -1,67 +0,0 @@ -/*
- * Git:Blit Markdown CSS definition.
- */
-
-div.markdown {
- line-height: 1.4em;
-}
-
-div.markdown h1,
-div.markdown h2,
-div.markdown h3,
-div.markdown h4,
-div.markdown h5,
-div.markdown h6 {
- border: 0 none !important;
-}
-
-div.markdown h1 {
- margin-top: 1em;
- margin-bottom: 0.5em;
- padding-bottom: 0.5em;
- border-bottom: 2px solid #000080 !important;
-}
-
-div.markdown h2 {
- margin-top: 1em;
- margin-bottom: 0.5em;
- padding-bottom: 0.5em;
- border-bottom: 2px solid #000080 !important;
-}
-
-div.markdown pre {
- background-color: #f8f8f8;
- border: 1px solid #2f6fab;
- border-radius: 3px;
- overflow: auto;
- padding: 5px;
-}
-
-div.markdown pre code {
- background-color: inherit;
- border: none;
- padding: 0;
-}
-
-div.markdown code {
- background-color: #ffffe0;
- border: 1px solid orange;
- border-radius: 3px;
- padding: 0 0.2em;
-}
-
-div.markdown a {
- text-decoration: underline;
-}
-
-div.markdown ul, div.markdown ol {
- padding-left: 30px;
-}
-
-div.markdown li {
- margin: 0.2em 0 0 0em; padding: 0px;
-}
-
-div.markdown em {
- color: #b05000;
-}
\ No newline at end of file diff --git a/src/com/gitblit/wicket/resources/pixel.png b/src/com/gitblit/wicket/resources/pixel.png Binary files differdeleted file mode 100644 index 4d5f6df1..00000000 --- a/src/com/gitblit/wicket/resources/pixel.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/search-icon.png b/src/com/gitblit/wicket/resources/search-icon.png Binary files differdeleted file mode 100644 index 90e8d2c6..00000000 --- a/src/com/gitblit/wicket/resources/search-icon.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/shield_16x16.png b/src/com/gitblit/wicket/resources/shield_16x16.png Binary files differdeleted file mode 100644 index 4eb8031c..00000000 --- a/src/com/gitblit/wicket/resources/shield_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/tag_16x16.png b/src/com/gitblit/wicket/resources/tag_16x16.png Binary files differdeleted file mode 100644 index 7e75cba0..00000000 --- a/src/com/gitblit/wicket/resources/tag_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/user_16x16.png b/src/com/gitblit/wicket/resources/user_16x16.png Binary files differdeleted file mode 100644 index d5edd4d4..00000000 --- a/src/com/gitblit/wicket/resources/user_16x16.png +++ /dev/null diff --git a/src/com/gitblit/wicket/resources/welcome.mkd b/src/com/gitblit/wicket/resources/welcome.mkd deleted file mode 100644 index 130cd8ac..00000000 --- a/src/com/gitblit/wicket/resources/welcome.mkd +++ /dev/null @@ -1,3 +0,0 @@ -## Welcome to Gitblit
-
-A quick and easy way to host or view your own [Git](http://www.git-scm.com) repositories.
diff --git a/src/log4j.properties b/src/log4j.properties index 16f12363..dc6dd2b5 100644 --- a/src/log4j.properties +++ b/src/log4j.properties @@ -1,12 +1,66 @@ -log4j.debug=false +#------------------------------------------------------------------------------ +# +# The following properties set the logging levels and log appender. The +# log4j.rootCategory variable defines the default log level and one or more +# appenders. For the console, use 'S'. For the daily rolling file, use 'R'. +# For an HTML formatted log, use 'H'. +# +# To override the default (rootCategory) log level, define a property of the +# form (see below for available values): +# +# log4j.logger. = +# +# Available logger names: +# TODO +# +# Possible Log Levels: +# FATAL, ERROR, WARN, INFO, DEBUG +# +#------------------------------------------------------------------------------ +log4j.rootCategory=INFO, S -log4j.rootLogger=INFO -log4j.logger.org=INFO -log4j.logger.com=INFO -log4j.logger.net=INFO +#log4j.rootLogger=INFO +#log4j.logger.org=INFO +#log4j.logger.com=INFO +#log4j.logger.net=INFO -log4j.logger.com.gitblit=DEBUG +#log4j.logger.com.gitblit=DEBUG log4j.logger.org.apache.wicket=INFO log4j.logger.org.apache.wicket.RequestListenerInterface=WARN log4j.logger.org.apache.wicket.protocol.http.HttpSessionStore=WARN + +#------------------------------------------------------------------------------ +# +# The following properties configure the console (stdout) appender. +# See http://logging.apache.org/log4j/docs/api/index.html for details. +# +#------------------------------------------------------------------------------ +log4j.appender.S = org.apache.log4j.ConsoleAppender +log4j.appender.S.layout = org.apache.log4j.PatternLayout +log4j.appender.S.layout.ConversionPattern = %-5p %m%n + +#------------------------------------------------------------------------------ +# +# The following properties configure the Daily Rolling File appender. +# See http://logging.apache.org/log4j/docs/api/index.html for details. +# +#------------------------------------------------------------------------------ +log4j.appender.R = org.apache.log4j.DailyRollingFileAppender +log4j.appender.R.File = logs/gitblit.log +log4j.appender.R.Append = true +log4j.appender.R.DatePattern = '.'yyy-MM-dd +log4j.appender.R.layout = org.apache.log4j.PatternLayout +log4j.appender.R.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n + +#------------------------------------------------------------------------------ +# +# The following properties configure the Rolling File appender in HTML. +# See http://logging.apache.org/log4j/docs/api/index.html for details. +# +#------------------------------------------------------------------------------ +log4j.appender.H = org.apache.log4j.RollingFileAppender +log4j.appender.H.File = logs/gitblit.html +log4j.appender.H.MaxFileSize = 100KB +log4j.appender.H.Append = false +log4j.appender.H.layout = org.apache.log4j.HTMLLayout |