/git
/target
/build.properties
+/war
+/*.war
<property name="project.jar" value="gitblit.jar" />\r
<property name="project.mainclass" value="com.gitblit.Launcher" />\r
<property name="project.build.dir" value="${basedir}/build" />\r
+ <property name="project.resources.dir" value="${basedir}/resources" />\r
\r
<loadproperties srcfile="${basedir}/build.properties" />\r
-\r
- <!-- Build Gitblit -->\r
- <target name="main" description="Compiles Gitblit from source to website">\r
-\r
+ \r
+ <target name="buildinfo">\r
<!-- build date -->\r
<tstamp>\r
<format property="gb.buildDate" pattern="yyyy-MM-dd" />\r
</tstamp>\r
-\r
+ \r
<!-- extract Gitblit version number from source code -->\r
<loadfile property="gb.version" srcfile="${basedir}/src/com/gitblit/Constants.java">\r
<filterchain>\r
</tokenfilter>\r
</filterchain>\r
</loadfile>\r
-\r
+ \r
<!-- extract JGit version number from source code -->\r
<loadfile property="jgit.version" srcfile="${basedir}/src/com/gitblit/Constants.java">\r
<filterchain>\r
</filterchain>\r
</loadfile>\r
<echo>Building Gitblit ${gb.version}</echo>\r
+ \r
+ <property name="distribution.zipfile" value="gitblit-${gb.version}.zip" />\r
+ <property name="distribution.warfile" value="gitblit-${gb.version}.war" />\r
+ </target>\r
+ \r
+ <!-- Build Gitblit GO -->\r
+ <target name="main" description="Compiles Gitblit from source to website" depends="buildinfo">\r
\r
<!-- copy required distribution files to project folder -->\r
<copy todir="${basedir}" overwrite="false">\r
<mkdir dir="${project.build.dir}" />\r
<javac srcdir="${basedir}/src" destdir="${project.build.dir}">\r
<include name="com/gitblit/Build.java" />\r
+ <include name="com/gitblit/BuildWebXml.java" />\r
<include name="com/gitblit/Constants.java" />\r
- <include name="com/gitblit/utils/StringUtils.java" />\r
+ <include name="com/gitblit/utils/StringUtils.java" /> \r
</javac>\r
<java classpath="${project.build.dir}" classname="com.gitblit.Build" />\r
\r
<fileset dir="${project.build.dir}">\r
<include name="**/*" />\r
</fileset>\r
+ <fileset dir="${project.resources.dir}">\r
+ <exclude name="thumbs.db" />\r
+ </fileset>\r
<manifest>\r
<attribute name="Main-Class" value="${project.mainclass}" />\r
</manifest>\r
<mkdir dir="${basedir}/site" />\r
<copy todir="${basedir}/site">\r
<!-- Copy selected Gitblit resources -->\r
- <fileset dir="${basedir}/src/com/gitblit/wicket/resources">\r
+ <fileset dir="${project.resources.dir}">\r
<include name="background.png" />\r
<include name="gitblit.css" />\r
<include name="markdown.css" />\r
<mkdir dir="${basedir}/deploy/docs" />\r
<copy todir="${basedir}/deploy/docs">\r
<!-- Copy selected Gitblit resources -->\r
- <fileset dir="${basedir}/src/com/gitblit/wicket/resources">\r
+ <fileset dir="${project.resources.dir}">\r
<include name="background.png" />\r
<include name="gitblit.css" />\r
<include name="markdown.css" />\r
\r
</java>\r
\r
- <!-- Create Zip deployment -->\r
- <property name="distribution.zipfile" value="gitblit-${gb.version}.zip" />\r
+ <!-- Create Zip deployment --> \r
<zip destfile="${distribution.zipfile}">\r
<fileset dir="${basedir}/deploy">\r
<include name="**/*" />\r
</target>\r
\r
\r
+ <!-- Build Gitblit WAR -->\r
+ <target name="buildWAR" description="Build the Gitblit WAR" depends="buildinfo">\r
+ <path id="master-classpath">\r
+ <fileset dir="${basedir}/ext">\r
+ <include name="*.jar" />\r
+ </fileset>\r
+ </path>\r
+ \r
+ <delete dir="${basedir}/war" />\r
+ <mkdir dir="${basedir}/war/WEB-INF/lib"/>\r
+ \r
+ <!-- Gitblit web.xml --> \r
+ <java classpath="${project.build.dir}" classname="com.gitblit.BuildWebXml">\r
+ <classpath refid="master-classpath" />\r
+ </java>\r
+\r
+ <!-- Gitblit resources -->\r
+ <copy todir="${basedir}/war">\r
+ <fileset dir="${project.resources.dir}">\r
+ <exclude name="thumbs.db" />\r
+ </fileset>\r
+ </copy>\r
+ \r
+ <!-- Gitblit library dependencies -->\r
+ <copy todir="${basedir}/war/WEB-INF/lib">\r
+ <fileset dir="${basedir}/ext">\r
+ <exclude name="*-sources.jar" />\r
+ <exclude name="*-javadoc.jar" />\r
+ <exclude name="jcommander*.jar" />\r
+ <exclude name="jetty*.jar" />\r
+ <exclude name="junit*.jar" />\r
+ <exclude name="servlet*.jar" />\r
+ </fileset>\r
+ </copy>\r
+\r
+ <!-- Gitblit classes -->\r
+ <mkdir dir="${basedir}/war/WEB-INF/classes"/>\r
+ <copy todir="${basedir}/war/WEB-INF/classes">\r
+ <fileset dir="${basedir}/bin">\r
+ <exclude name="WEB-INF/web.xml" />\r
+ <exclude name="com/gitblit/tests/" />\r
+ <exclude name="com/gitblit/Build*.class" />\r
+ <exclude name="com/gitblit/GitBlitServer*.class" />\r
+ <exclude name="com/gitblit/Launcher*.class" />\r
+ <exclude name="com/gitblit/MakeCertificate*.class" />\r
+ <exclude name="com/gitblit/Thumbnailer*.class" />\r
+ </fileset>\r
+ </copy>\r
+\r
+ <!-- Build the WAR file -->\r
+ <jar basedir="${basedir}/war" destfile="${distribution.warfile}" compress="true" />\r
+ </target>\r
+\r
+ \r
+ <!-- Publish binaries to github -->\r
+ <target name="publishBinaries" description="Publish the Gitblit distribution to Github">\r
+ <!-- TODO -->\r
+ <!-- https://github.com/oyvindkinsey/GitHubUploadTask -->\r
+ </target>\r
+\r
+ \r
<!-- Publish site to hosting service -->\r
<!-- You must add ext/commons-net-1.4.0.jar to your ANT classpath. -->\r
<target name="publishSite" description="Publish the Gitblit site to a webserver (requires ext/commons-net-1.4.0.jar)">\r
<fileset dir="${basedir}/site" />\r
</ftp>\r
</target>\r
- \r
\r
- <!-- Publish distribution to github -->\r
- <target name="publishDistribution" description="Publish the Gitblit distribution to Github">\r
- <!-- TODO -->\r
- <!-- https://github.com/oyvindkinsey/GitHubUploadTask -->\r
- </target>\r
-</project>\r
+</project>
\ No newline at end of file
# Git Servlet Settings\r
#\r
\r
-# Allow push/pull over http/https with JGit servlet\r
-# Changing this value requires a server restart.\r
+# Allow push/pull over http/https with JGit servlet.\r
git.enableGitServlet = true\r
\r
# Base folder for repositories\r
# e.g. c:/gitrepos\r
git.repositoriesFolder = git\r
\r
-# Export all repositories\r
-# Changing this value requires a server restart.\r
-# if false, each exported repository must have a .git/git-daemon-export-ok file\r
-git.exportAll = true\r
-\r
# Search the repositories folder subfolders for other repositories.\r
# Repositories MAY NOT be nested (i.e. one repository within another)\r
# but they may be grouped together in subfolders.\r
# Changing this value requires a server restart.\r
web.authenticateAdminPages = true\r
\r
-# Simple user realm file to authenticate users\r
+# Either a simple user realm file to authenticate users\r
+# OR a fully qualified class name that implements the ILoginService interface.\r
+# Any custom implementation must have a public default constructor.\r
# Changing this value requires a server restart.\r
realm.realmFile = users.properties\r
\r
# Example global regex substitutions\r
# Use !!! to separate the search pattern and the replace pattern\r
# searchpattern!!!replacepattern\r
-#regex.global.bug = \\b(Bug:)(\\s*[#]?|-){0,1}(\\d+)\\b!!!<a href="http://somehost/bug/$3">Bug-Id: $3</a>\r
-#regex.global.changeid = \\b(Change-Id:\\s*)([A-Za-z0-9]*)\\b!!!<a href="http://somehost/changeid/$2">Change-Id: $2</a>\r
+regex.global.bug = \\b(Bug:)(\\s*[#]?|-){0,1}(\\d+)\\b!!!<a href="http://somehost/bug/$3">Bug-Id: $3</a>\r
+regex.global.changeid = \\b(Change-Id:\\s*)([A-Za-z0-9]*)\\b!!!<a href="http://somehost/changeid/$2">Change-Id: $2</a>\r
\r
# Example per-repository regex substitutions overrides global\r
-#regex.myrepository.bug = \\b(Bug:)(\\s*[#]?|-){0,1}(\\d+)\\b!!!<a href="http://elsewhere/bug/$3">Bug-Id: $3</a>\r
+regex.myrepository.bug = \\b(Bug:)(\\s*[#]?|-){0,1}(\\d+)\\b!!!<a href="http://elsewhere/bug/$3">Bug-Id: $3</a>\r
\r
#\r
# Server Settings\r
# The temporary folder to decompress the gitblit webapp. \r
server.tempFolder = temp\r
\r
-# The common log4j logging pattern\r
-# http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html\r
-server.log4jPattern = %-5p %d{MM-dd HH:mm:ss.SSS} %-20.20c{1} %m%n\r
-\r
-# Alternatively, you may specify a logging pattern for your OS.\r
-# If the os pattern is blank, the common pattern is used.\r
-\r
-# This windows pattern fits (mostly) within the fixed bounds of a command prompt.\r
-server.log4jPattern.windows = %-5p %m%n\r
-\r
-server.log4jPattern.linux =\r
-\r
-\r
#\r
# Jetty Settings\r
#\r
\r
### Current Release\r
\r
-[%VERSION%](http://gitblit.com/%DISTRIBUTION%) based on [%JGIT%][jgit] (*%BUILDDATE%*)\r
+%VERSION% ([go](http://gitblit.com/%GO%)|[war](http://gitblit.com/%WAR%)) based on [%JGIT%][jgit] (*%BUILDDATE%*)\r
\r
sources @ [Github][gitbltsrc]\r
\r
2. Offer useful features for serving Git repositories. If feature is complex, refer to #1.\r
3. All dependencies must be retrievable from a publicly accessible [Maven](http://maven.apache.org) repository.<br/>This is to ensure authenticity of dependencies and to keep the Gitblit distribution svelte. \r
\r
-### Features\r
-- Out-of-the-box integrated stack requiring minimal configuration\r
+### Gitblit Features\r
- JGit SmartHTTP servlet\r
- Browser and git client authentication\r
- Four repository access control configurations and a Read-Only flag\r
- Administrators may create, edit, rename, or delete repositories through the web UI\r
- Administrators may create, edit, rename, or delete users through the web UI\r
- Repository Owners may edit repositories through the web UI\r
-- Automatically generates a self-signed certificate for https communications\r
- Git-notes support\r
- Branch metrics (uses Google Charts)\r
- HEAD and branch RSS feeds\r
- Markdown file view support\r
- Syntax highlighting for popular source code types\r
- Customizable regular expression substitution for commit messages (i.e. bug or code review link integration)\r
-- Single text file for server configuration\r
- Single text file for users configuration\r
- Optional utility pages\r
<ul class='noBullets'>\r
<li>![tickets](bug_16x16.png) Ticgit ticket pages *(based on last MIT release bf57b032 2009-01-27)*</li>\r
</ul>\r
\r
+### Gitblit-Go Features\r
+- Out-of-the-box integrated stack requiring minimal configuration\r
+- Automatically generates a self-signed certificate for https communications\r
+- Single text file for server configuration\r
+\r
### Limitations\r
-- [%JGIT%][jgit] does not currently [garbage collect or repack](http://www.kernel.org/pub/software/scm/git/docs/git-gc.html)\r
- HTTP/HTTPS are the only supported protocols\r
- Access controls are not path-based, they are repository-based\r
- Only Administrators can create, rename or delete repositories\r
-- Gitblit is an integrated, full-stack solution. There is no WAR build at this time.\r
\r
### Caveats\r
- Gitblit may eat your data. Use at your own risk.\r
- Code documentation\r
- Unit testing\r
- Update Build.java to JGit 1.0.0, when its released\r
-- WAR solution\r
\r
### Idea List\r
- Consider clone remote repository feature\r
![block diagram](architecture.png "Gitblit Architecture")\r
\r
### Bundled Dependencies\r
-The following dependencies are bundled with the Gitblit zip distribution file.\r
+The following dependencies are bundled with Gitblit.\r
\r
- [google-code-prettify](http://code.google.com/p/google-code-prettify) (Apache 2.0)\r
- [JavaService](http://forge.ow2.org/projects/javaservice) (BSD and LGPL)\r
- other icons courtesy of [FatCow Hosting](http://www.fatcow.com/free-icons) (Creative Commons CC-BY)\r
\r
### Downloaded Dependencies\r
-The following dependencies are automatically downloaded from the Apache Maven repository and from the Eclipse Maven repository when Gitblit is launched for the first time.\r
+The following dependencies are automatically downloaded by Gitblit-Go (or already bundled with the WAR) from the Apache Maven repository and from the Eclipse Maven repository when Gitblit is launched for the first time.\r
\r
- [JGit][jgit] (EDL 1.0)\r
- [Wicket](http://wicket.apache.org) (Apache 2.0)\r
-## Server Setup and Configuration\r
+## Gitblit-Go Setup and Configuration\r
\r
-1. Download and unzip [Gitblit %VERSION%](http://gitblit.com/%DISTRIBUTION%).<br/>\r
+1. Download and unzip [Gitblit-Go %VERSION%](http://gitblit.com/%GO%).<br/>\r
*Its best to eliminate spaces in the path name as that can cause troubleshooting headaches.* \r
2. The server itself is configured through a simple text file.<br/>\r
Open `gitblit.properties` in your favorite text editor and make sure to review and set:\r
3. The repository is clone-restricted and your password changed.\r
4. A regression in Gitblit. :(\r
\r
-### Why can't I access Gitblit from another machine?\r
+### Why can't I access Gitblit-Go from another machine?\r
Please check *server.httpBindInterface* and *server.httpsBindInterface* in `gitblit.properties`.\r
\r
-### How do I run Gitblit on port 80 or 443 in Linux?\r
+### How do I run Gitblit-Go on port 80 or 443 in Linux?\r
Linux requires root permissions to serve on ports < 1024.<br/>\r
Run the server as *root* (security concern) or change the ports you are serving to 8080 (http) and/or 8443 (https). \r
\r
No. Gitblit is based on [JGit][jgit] which is a pure Java implementation of the [Git version control system][git].<br/>\r
Everything you need for Gitblit is either in the zip distribution file or automatically downloaded on execution.\r
\r
-### What about periodic Git garbage collection (git-gc)?\r
-Good question. I'm not sure.\r
-\r
-Git repositories grow and grow and periodically need to be repacked every once in a while. Git calls this process [garbage collection](http://www.kernel.org/pub/software/scm/git/docs/git-gc.html) (which is not to be confused with [garbage collection](http://en.wikipedia.org/wiki/Garbage_collection_(computer_science)).)\r
-\r
-[JGit's][jgit] documentation is sparse and its unclear whether or not JGit performs this function.\r
-\r
### Can I run Gitblit in conjunction with my existing Git tooling?\r
-Yes. You can configure Gitblit to only be a repository viewer.\r
+Yes.\r
\r
### Do I need a JDK or can I use a JRE?\r
Gitblit will run just fine with a JRE. Gitblit can optionally use `keytool` from the JDK to generate self-signed certificates, but normally Gitblit uses [BouncyCastle][bouncycastle] for that need.\r
\r
-### I want to deploy Gitblit into my own servlet container. Where is the WAR?\r
-At this time there is no WAR build available.\r
-\r
### Does Gitblit use a database to store its data?\r
No. Gitblit stores its repository configuration information within the `.git/config` file and its user information in `users.properties` or whatever filename is configured in `gitblit.properties`.\r
\r
\r
Gitblit's simple authentication and authorization mechanism can be used to facilitate one or more of the [workflows outlined here](http://progit.org/book/ch5-1.html). Should you require more fine-grained access controls you might consider using [gitolite](https://github.com/sitaramc/gitolite).\r
\r
+### Can I authenticate users against XYZ?\r
+Yes. The login service is pluggable. You may write your own authentication module by implementing the *ILoginService* interface. Set the fully qualified classname as the *realm.realmFile* property.\r
+\r
### Why doesn't Gitblit support SSH?\r
Gitblit could integrate [Apache Mina][mina] to provide SSH access. However, doing so violates Gitblit's first design principle: [KISS](http://en.wikipedia.org/wiki/KISS_principle).<br/>\r
SSH support requires creating, exchanging, and managing SSH keys (arguably not more complicated than managing users). While this is possible, JGit's SmartHTTP implementation is a simpler and universal transport mechanism.\r
--- /dev/null
+/*\r
+ Git:Blit css.\r
+*/\r
+html, body, table, dl, dt, dd, ol, ul, li, form, a, span, tr, th, td, div, em {\r
+ font-family: verdana, sans-serif;\r
+ font-size: 12px;\r
+ line-height: 1.35em;\r
+ margin: 0;\r
+ padding: 0;\r
+ border: 0;\r
+ outline: 0;\r
+}\r
+\r
+body {\r
+ width: 980px;\r
+ margin: 5px;\r
+ background-color: #ffffff;\r
+ color: #000000;\r
+ margin-right: auto;\r
+ margin-left: auto; \r
+ padding: 0px;\r
+ background: url(background.png) repeat-x scroll 0 0 #FFFFFF;\r
+}\r
+\r
+pre, code, pre.prettyprint, pre.plainprint {\r
+ color: black;\r
+ font-family: monospace;\r
+ font-size:12px;\r
+ border:0px;\r
+}\r
+\r
+pre.prettyprint ol {\r
+ padding-left:25px;\r
+}\r
+\r
+/* age0: age < 60*60*2 */\r
+.age0 {\r
+ color: #008000;\r
+ font-style: italic;\r
+ font-weight: bold;\r
+}\r
+\r
+/* age1: 60*60*2 <= age < 60*60*24*2 */\r
+.age1 {\r
+ color: #008000;\r
+ font-style: italic;\r
+}\r
+\r
+/* age2: 60*60*24*2 <= age */\r
+.age2 {\r
+ font-style: italic;\r
+}\r
+\r
+img.inlineIcon {\r
+ padding-left: 1px;\r
+ padding-right: 1px;\r
+}\r
+\r
+a {\r
+ color: #0000cc;\r
+}\r
+\r
+a:hover, a:visited, a:active {\r
+ color: #880000;\r
+}\r
+\r
+img.logo {\r
+ float: right;\r
+ border-width: 0px;\r
+}\r
+\r
+img.activityGraph {\r
+ float: right;\r
+ border-width: 0px;\r
+ padding: 8px;\r
+}\r
+\r
+div.repositories_message {\r
+ line-height: inherit;\r
+}\r
+\r
+div.header, div.commitHeader {\r
+ background-color: #D2C3AF;\r
+ padding: 3px;\r
+ border: 1px solid #808080;\r
+}\r
+\r
+div.header {\r
+ border-radius: 3px 3px 0 0;\r
+}\r
+\r
+div.commitHeader {\r
+ border-radius: 3px;\r
+}\r
+\r
+div.header a, div.commitHeader a {\r
+ color: black;\r
+ text-decoration: none;\r
+ font-weight: bold;\r
+}\r
+\r
+div.header a:hover, div.commitHeader a:hover {\r
+ text-decoration: underline;\r
+}\r
+\r
+div.pager {\r
+ padding: 0px 0px 15px 5px;\r
+}\r
+\r
+span.empty {\r
+ font-size: 0.9em;\r
+ font-style: italic;\r
+ padding-left:10px;\r
+ color: #008000;\r
+}\r
+\r
+span.link {\r
+ color: #888;\r
+}\r
+\r
+span.link, span.link a {\r
+ font-family: sans-serif;\r
+ font-size: 11px; \r
+}\r
+\r
+span.link em, div.link span em {\r
+ font-style: normal;\r
+ font-family: sans-serif;\r
+ font-size: 11px; \r
+}\r
+\r
+div.page_header {\r
+ height: 25px;\r
+ padding: 5px;\r
+ font-family: sans-serif;\r
+ font-weight: bold;\r
+ font-size: 150%;\r
+ color: #888;\r
+ background: transparent;\r
+}\r
+\r
+div.page_header span { \r
+ font-family: inherit;\r
+ font-size: inherit; \r
+}\r
+\r
+div.page_header a {\r
+ font-size: inherit; \r
+ font-family: inherit;\r
+ text-decoration: none;\r
+}\r
+\r
+div.page_header a:visited {\r
+ color: #000000;\r
+}\r
+\r
+div.page_header a:hover {\r
+ color: #E66C2C;\r
+ text-decoration: underline;\r
+}\r
+\r
+div.page_footer {\r
+ clear: both;\r
+ height: 17px;\r
+ color: black;\r
+ background-color: #ffffff;\r
+ padding: 5px;\r
+ border-top: 1px solid #bbb;\r
+ font-style: italic;\r
+}\r
+\r
+div.page_nav {\r
+ color: #ddd;\r
+ background-color: #000070;\r
+ padding: 7px;\r
+ border-radius: 3px;\r
+}\r
+\r
+div.page_nav a {\r
+ color: yellow;\r
+ text-decoration: none;\r
+}\r
+\r
+div.page_nav a:hover { \r
+ text-decoration: underline;\r
+}\r
+\r
+div.page_nav em {\r
+ font-style: normal;\r
+}\r
+\r
+div.page_nav2 {\r
+ padding: 2px 5px 7px 5px; \r
+}\r
+\r
+div.admin_nav {\r
+ border: 1px solid #888;\r
+ border-bottom: 0px;\r
+ background:#dae0d2;\r
+ text-align: right;\r
+ padding: 5px 5px 5px 2px; \r
+}\r
+\r
+div.admin_nav a {\r
+ text-decoration: none;\r
+}\r
+\r
+div.admin_nav a:hover { \r
+ text-decoration: underline;\r
+}\r
+\r
+div.search {\r
+ color:yellow;\r
+ text-align:right;\r
+ float:right;\r
+ padding:4px 4px 3px 3px;\r
+ border-left: 1px solid #8080f0;\r
+ margin: 0px;\r
+ height: 23px;\r
+}\r
+\r
+div.search input {\r
+ vertical-align: top;\r
+ background: url(search-icon.png) no-repeat 4px center;\r
+ color: #ddd;\r
+ background-color: #000070;\r
+ border: 1px solid transparent;\r
+ padding: 2px 2px 2px 22px;\r
+ margin: 0px;\r
+}\r
+\r
+div.search input:hover, div.search input:focus {\r
+ color: white;\r
+ border-bottom: 1px solid orange; \r
+ outline: none;\r
+}\r
+\r
+div.page_path {\r
+ padding: 8px;\r
+ font-weight: bold;\r
+ border: solid #bbb;\r
+ border-width: 0px 0px 1px;\r
+}\r
+\r
+div.commit_message {\r
+ font-family: monospace;\r
+ padding: 8px;\r
+ border: solid #bbb;\r
+ border-width: 1px 0px 0px;\r
+}\r
+\r
+div.commit_message a {\r
+ font-family: monospace;\r
+}\r
+\r
+div.bug_open, span.bug_open {\r
+ padding: 2px;\r
+ background-color: #803333;\r
+ color: white; \r
+ text-align: center;\r
+}\r
+\r
+div.bug_resolved, span.bug_resolved {\r
+ padding: 2px;\r
+ background-color: #408040;\r
+ color: white;\r
+ text-align: center;\r
+}\r
+\r
+div.bug_invalid, span.bug_invalid {\r
+ padding: 2px;\r
+ background-color: gray;\r
+ text-align: center;\r
+}\r
+\r
+div.bug_hold, span.bug_hold {\r
+ padding: 2px;\r
+ background-color: orange;\r
+ text-align: center;\r
+}\r
+\r
+div.diff {\r
+ font-family: monospace;\r
+ overflow: auto;\r
+}\r
+\r
+div.diff.header {\r
+ -moz-border-bottom-colors: none;\r
+ -moz-border-image: none;\r
+ -moz-border-left-colors: none;\r
+ -moz-border-right-colors: none;\r
+ -moz-border-top-colors: none;\r
+ background-color: #EDECE6;\r
+ border-color: #D9D8D1;\r
+ border-style: solid;\r
+ border-width: 1px;\r
+ font-weight: bold;\r
+ margin-top: 10px;\r
+ padding: 4px 0 2px;\r
+}\r
+\r
+div.diff.extended_header {\r
+ background-color: #F6F5EE;\r
+ padding: 2px 0;\r
+ font-family: inherit;\r
+}\r
+\r
+span.diff.add {\r
+ color: #008800;\r
+ font-family: inherit;\r
+}\r
+\r
+span.diff.remove {\r
+ color: #FFDDDD;\r
+ font-family: inherit;\r
+}\r
+\r
+span.diff.unchanged {\r
+ color: inherit;\r
+ font-family: inherit;\r
+}\r
+\r
+div.diff.hunk_header {\r
+ -moz-border-bottom-colors: none;\r
+ -moz-border-image: none;\r
+ -moz-border-left-colors: none;\r
+ -moz-border-right-colors: none;\r
+ -moz-border-top-colors: none;\r
+ border-color: #FFE0FF;\r
+ border-style: dotted;\r
+ border-width: 1px 0 0;\r
+ margin-top: 2px;\r
+ font-family: inherit;\r
+}\r
+\r
+span.diff.hunk_info {\r
+ background-color: #FFEEFF; \r
+ color: #990099;\r
+ font-family: inherit;\r
+}\r
+\r
+span.diff.hunk_section { \r
+ color: #AA22AA;\r
+ font-family: inherit;\r
+}\r
+\r
+div.diff.add2 {\r
+ background-color: #DDFFDD;\r
+ font-family: inherit;\r
+}\r
+\r
+div.diff.remove2 {\r
+ background-color: #FFDDDD;\r
+ font-family: inherit;\r
+}\r
+\r
+div.diff table {\r
+ border-right: 1px solid #bbb;\r
+ border-bottom: 1px solid #bbb;\r
+ width: 100%;\r
+}\r
+\r
+div.diff table th, div.diff table td {\r
+ margin: 0px;\r
+ padding: 0px;\r
+ font-family: monospace; \r
+}\r
+\r
+div.diff table th {\r
+ background-color: #faf8dc;\r
+ border-left: 1px solid #bbb; \r
+ text-align: center;\r
+ color: #999;\r
+ padding-left: 5px;\r
+ padding-right: 5px;\r
+ width: 30px;\r
+}\r
+\r
+div.diff table th.header {\r
+ background-color: #D2C3AF;\r
+ border-right: 0px;\r
+ border-bottom: 1px solid #808080;\r
+ font-family: inherit;\r
+ font-size:0.9em;\r
+ color: black;\r
+ padding: 2px;\r
+ text-align: left;\r
+}\r
+\r
+div.diff table td.hunk_header {\r
+ background-color: #dAe2e5 !important; \r
+ border-bottom: 1px solid #bac2c5;\r
+ color: #555;\r
+}\r
+\r
+div.diff table td {\r
+ border-left: 1px solid #bbb;\r
+ background-color: #fbfbfb;\r
+}\r
+\r
+td.changeType {\r
+ width: 15px;\r
+}\r
+\r
+span.addition, span.modification, span.deletion, span.rename {\r
+ border: 1px solid #888;\r
+ float: left;\r
+ height: 0.8em;\r
+ margin: 0.2em 0.5em 0 0;\r
+ overflow: hidden;\r
+ width: 0.8em;\r
+}\r
+\r
+span.addition {\r
+ background-color: #ccffcc;\r
+}\r
+\r
+span.modification {\r
+ background-color: #ffdd88;\r
+}\r
+\r
+span.deletion {\r
+ background-color: #f8bbbb;\r
+}\r
+\r
+span.rename {\r
+ background-color: #cAc2f5;\r
+}\r
+\r
+div.commitLegend {\r
+ float: right;\r
+ padding: 0.4em 0.4em 0.2em 0.4em;\r
+ vertical-align:top;\r
+ margin: 0px;\r
+}\r
+\r
+div.commitLegend span {\r
+ font-size: 0.9em;\r
+ vertical-align: top;\r
+}\r
+\r
+div.references {\r
+ float: right;\r
+ text-align: right;\r
+}\r
+\r
+a.list {\r
+ text-decoration: none;\r
+ color: #000000;\r
+}\r
+\r
+a.list.subject {\r
+ font-weight: bold;\r
+}\r
+\r
+a.list.name {\r
+ font-weight: bold; \r
+}\r
+\r
+a.list:hover {\r
+ text-decoration: underline;\r
+ color: #880000;\r
+}\r
+\r
+table {\r
+ border-spacing: 0px;\r
+}\r
+\r
+th {\r
+ padding: 2px 5px;\r
+ font-size: 100%;\r
+ text-align: left;\r
+}\r
+\r
+table.screenshots td {\r
+ text-align: center;\r
+ padding-bottom: 10px;\r
+}\r
+\r
+table.screenshots img {\r
+ border: 1px solid #ccc;\r
+ margin: 5px;\r
+}\r
+\r
+table.plain {\r
+ padding: 8px;\r
+}\r
+\r
+table.plain td {\r
+ white-space: nowrap;\r
+}\r
+\r
+table.plain td.edit { \r
+ padding: 3px;\r
+}\r
+\r
+table.plain td.editButton {\r
+ padding:0px;\r
+ padding-top: 10px;\r
+}\r
+\r
+table.plain td.edit input {\r
+ margin: 0px;\r
+ outline: 1px solid transparent;\r
+ border: 1px solid #ccc; \r
+ padding-left:5px;\r
+}\r
+\r
+table.plain td.edit input:focus, table.plain td.edit input:hover{\r
+ border: 1px solid orange;\r
+}\r
+\r
+table.pretty, table.comments {\r
+ margin-bottom:5px;\r
+ border-spacing: 0px;\r
+ border-left: 1px solid #bbb;\r
+ border-right: 1px solid #bbb; \r
+}\r
+\r
+table.pretty, table.comments, table.repositories, table.gitnotes {\r
+ width:100%;\r
+}\r
+\r
+table.pretty td.icon {\r
+ padding: 0px 0px 0px 2px; \r
+ width: 18px;\r
+}\r
+\r
+table.pretty td.icon img {\r
+ vertical-align: top;\r
+}\r
+\r
+table.pretty td {\r
+ padding: 2px 4px;\r
+}\r
+\r
+table.comments td {\r
+ padding: 4px;\r
+ line-height: 17px;\r
+}\r
+\r
+table.repositories {\r
+ margin-bottom:5px;\r
+ border-spacing: 0px;\r
+}\r
+\r
+table.repositories th {\r
+ background-color:#D2C3AF;\r
+ padding: 4px;\r
+ border-top: 1px solid #808080;\r
+ border-bottom: 1px solid #808080;\r
+}\r
+\r
+table.repositories th.left, table.repositories td.left {\r
+ border-left: 1px solid #808080;\r
+ padding-left: 5px;\r
+}\r
+\r
+table.repositories td.left {\r
+ padding-left: 10px;\r
+}\r
+\r
+table.repositories th.right, table.repositories td.right {\r
+ border-right: 1px solid #808080;\r
+}\r
+\r
+table.repositories td {\r
+ padding: 2px;\r
+}\r
+\r
+table.repositories td.rightAlign { \r
+ text-align: right;\r
+ border-right: 1px solid #808080;\r
+} \r
+\r
+table.repositories td.icon img {\r
+ vertical-align: top;\r
+}\r
+\r
+table.repositories th a {\r
+ color:black;/*#ddd;*/\r
+ text-decoration: none;\r
+ font-weight: normal;\r
+}\r
+\r
+table.repositories th a:hover {\r
+ text-decoration: underline;\r
+}\r
+\r
+table.repositories th.wicket_orderDown a, table.repositories th.wicket_orderUp a {\r
+ color: black;\r
+ font-weight: bold;\r
+}\r
+\r
+table.repositories tr.group {\r
+ background-color: #E66C2C;\r
+}\r
+\r
+table.repositories tr.group td {\r
+ font-weight: bold; \r
+ border-bottom: 1px solid orange;\r
+ color: white;\r
+ background-color: #E66C2C;\r
+ border-left: 1px solid #808080;\r
+ border-right: 1px solid #808080;\r
+ padding-left: 5px;\r
+}\r
+\r
+table.palette { border:0;}\r
+table.palette td.header { \r
+ font-weight: bold; \r
+ background-color: #D2C3AF !important;\r
+ padding: 3px !important; \r
+ border: 1px solid #808080 !important;\r
+ border-bottom: 0px solid !important;\r
+ border-radius: 3px 3px 0 0;\r
+}\r
+table.palette td.pane {\r
+ padding: 0px; \r
+}\r
+\r
+table.gitnotes { \r
+ padding-bottom: 5px;\r
+}\r
+table.gitnotes td {\r
+ border-top: 1px solid #ccc;\r
+ padding-top: 3px;\r
+ vertical-align:top;\r
+}\r
+\r
+table.gitnotes td table td {\r
+ border: none;\r
+ padding-top: 0px;\r
+}\r
+\r
+table.gitnotes td.info {\r
+}\r
+\r
+table.gitnotes td.message {\r
+ width: 65%;\r
+ border-left: 1px solid #ccc;\r
+}\r
+\r
+table.annotated {\r
+ width: 100%;\r
+ border: 1px solid #bbb;\r
+}\r
+\r
+table.annotated tr.even {\r
+ background-color: white;\r
+}\r
+\r
+table.annotated tr.odd {\r
+ background-color: #fdfbdf;\r
+}\r
+\r
+tr th a { padding-right: 15px; background-position: right; background-repeat:no-repeat; }\r
+tr th.wicket_orderDown a {background-image: url(arrow_down.png); }\r
+tr th.wicket_orderUp a { background-image: url(arrow_up.png); }\r
+tr th.wicket_orderNone a { background-image: url(arrow_off.png); }\r
+\r
+tr.light {\r
+ background-color: #ffffff;\r
+}\r
+\r
+tr.light td {\r
+ border-bottom: 1px solid #bbb; \r
+}\r
+\r
+tr.dark {\r
+ background-color: #faf8dc;\r
+ border-bottom: 1px solid #bbb; \r
+}\r
+\r
+tr.dark td {\r
+ border-bottom: 1px solid #bbb; \r
+}\r
+\r
+/* currently both use the same, but it can change */\r
+tr.light:hover,\r
+tr.dark:hover {\r
+ /*background-color: #0099b7;*/\r
+ background-color: #000070;\r
+ color: white;\r
+}\r
+\r
+tr.light:hover a,\r
+tr.dark:hover a {\r
+ color: white; \r
+}\r
+\r
+td {\r
+ padding-left: 7px;\r
+ padding-right: 7px;\r
+}\r
+\r
+td.author {\r
+ font-style: italic;\r
+}\r
+\r
+td.date {\r
+ font-style: italic; \r
+}\r
+\r
+span.sha1, span.sha1 a, span.sha1 a span {\r
+ font-family: monospace;\r
+ font-size: 13px;\r
+}\r
+\r
+td.mode {\r
+ text-align: right;\r
+ font-family: monospace;\r
+ width: 8em;\r
+ padding-right:15px;\r
+}\r
+\r
+td.size {\r
+ text-align: right;\r
+ width: 8em; \r
+ padding-right:15px;\r
+}\r
+\r
+td.rightAlign {\r
+ text-align: right;\r
+}\r
+\r
+td.treeLinks {\r
+ text-align: right;\r
+ width: 13em;\r
+}\r
+\r
+span.metricsTitle {\r
+ font-size: 2em;\r
+}\r
+\r
+span .tagRef, span .headRef, span .localBranch, span .remoteBranch, span .otherRef { \r
+ padding: 0px 3px;\r
+ margin-right:2px;\r
+ font-family: sans-serif;\r
+ font-size: 9px;\r
+ font-weight: normal;\r
+ border: 1px solid;\r
+ color: black; \r
+}\r
+\r
+span .tagRef a span, span .headRef a span, span .localBranch a span, span .remoteBranch a span, span .otherRef a span {\r
+ font-size: 9px;\r
+}\r
+\r
+span .tagRef a, span .headRef a, span .localBranch a, span .remoteBranch a, span .otherRef a {\r
+ text-decoration: none;\r
+ color: black !important;\r
+}\r
+\r
+span .tagRef a:hover, span .headRef a:hover, span .localBranch a:hover, span .remoteBranch a:hover, span .otherRef a:hover {\r
+ color: black !important;\r
+ text-decoration: underline;\r
+}\r
+\r
+span .otherRef {\r
+ background-color: #b0e0f0;\r
+ border-color: #80aaaa; \r
+}\r
+\r
+span .remoteBranch {\r
+ background-color: #cAc2f5;\r
+ border-color: #6c6cbf;\r
+}\r
+\r
+span .tagRef {\r
+ background-color: #ffffaa;\r
+ border-color: #ffcc00;\r
+}\r
+\r
+span .headRef {\r
+ background-color: #ffaaff;\r
+ border-color: #ff00ee;\r
+}\r
+\r
+span .localBranch {\r
+ background-color: #ccffcc;\r
+ border-color: #00cc33;\r
+}\r
+\r
+.feedbackPanelERROR { \r
+ color: red;\r
+ list-style-image: url(bullet_error.png);\r
+ font-weight: bold; \r
+ vertical-align: top;\r
+ padding:0; \r
+ margin:0; \r
+}\r
+\r
+.feedbackPanelINFO {\r
+ color: green;\r
+ list-style: none;\r
+ font-weight: bold; \r
+ padding:0;\r
+ margin:0;\r
+}\r
+\r
+/* google-code-prettify line numbers */\r
+li.L0,\r
+li.L1,\r
+li.L2,\r
+li.L3,\r
+li.L4,\r
+li.L5,\r
+li.L6,\r
+li.L7,\r
+li.L8,\r
+li.L9 { color: #888; border-left: 1px solid #ccc; padding-left:5px; list-style-type: decimal !important; }\r
+\r
+/* Alternate shading for lines */\r
+li.L1,\r
+li.L3,\r
+li.L5,\r
+li.L7,\r
+li.L9 { background: #fafafa !important; }
\ No newline at end of file
--- /dev/null
+/*\r
+ * Git:Blit Markdown CSS definition.\r
+ */\r
+\r
+div.markdown {\r
+ line-height: 1.4em;\r
+}\r
+\r
+div.markdown h1,\r
+div.markdown h2, \r
+div.markdown h3, \r
+div.markdown h4, \r
+div.markdown h5, \r
+div.markdown h6 {\r
+ border: 0 none !important;\r
+}\r
+\r
+div.markdown h1 { \r
+ margin-top: 1em;\r
+ margin-bottom: 0.5em;\r
+ padding-bottom: 0.5em;\r
+ border-bottom: 2px solid #000080 !important;\r
+}\r
+\r
+div.markdown h2 {\r
+ margin-top: 1em;\r
+ margin-bottom: 0.5em; \r
+ padding-bottom: 0.5em;\r
+ border-bottom: 2px solid #000080 !important; \r
+}\r
+\r
+div.markdown pre {\r
+ background-color: #f8f8f8; \r
+ border: 1px solid #2f6fab;\r
+ border-radius: 3px;\r
+ overflow: auto;\r
+ padding: 5px;\r
+}\r
+\r
+div.markdown pre code {\r
+ background-color: inherit;\r
+ border: none; \r
+ padding: 0;\r
+}\r
+\r
+div.markdown code {\r
+ background-color: #ffffe0;\r
+ border: 1px solid orange;\r
+ border-radius: 3px;\r
+ padding: 0 0.2em;\r
+}\r
+\r
+div.markdown a {\r
+ text-decoration: underline; \r
+}\r
+\r
+div.markdown ul, div.markdown ol {\r
+ padding-left: 30px;\r
+}\r
+\r
+div.markdown li {\r
+ margin: 0.2em 0 0 0em; padding: 0px;\r
+}\r
+\r
+div.markdown em {\r
+ color: #b05000;\r
+}
\ No newline at end of file
--- /dev/null
+## Welcome to Gitblit\r
+\r
+A quick and easy way to host or view your own [Git](http://www.git-scm.com) repositories.\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<web-app version="2.4"\r
+ xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">\r
+\r
+ <!-- PARAMS --> \r
+ \r
+ <!-- Gitblit Context Listener --><!-- STRIP \r
+ <listener>\r
+ <listener-class>com.gitblit.GitBlit</listener-class>\r
+ </listener>STRIP --> \r
+ \r
+ \r
+ <!-- Git Servlet\r
+ <url-pattern> MUST match: \r
+ * GitFilter\r
+ * com.gitblit.Constants.GIT_PATH\r
+ * Wicket Filter ignorePaths parameter --><!-- STRIP\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>\r
+ <servlet-mapping>\r
+ <servlet-name>GitServlet</servlet-name> \r
+ <url-pattern>/git/*</url-pattern>\r
+ </servlet-mapping>STRIP -->\r
+ \r
+ \r
+ <!-- Syndication Servlet\r
+ <url-pattern> MUST match: \r
+ * SyndicationFilter\r
+ * com.gitblit.Constants.SYNDICATION_PATH\r
+ * Wicket Filter ignorePaths parameter -->\r
+ <servlet>\r
+ <servlet-name>SyndicationServlet</servlet-name>\r
+ <servlet-class>com.gitblit.SyndicationServlet</servlet-class> \r
+ </servlet>\r
+ <servlet-mapping>\r
+ <servlet-name>SyndicationServlet</servlet-name>\r
+ <url-pattern>/feed/*</url-pattern>\r
+ </servlet-mapping>\r
+ \r
+ \r
+ <!-- Zip Servlet\r
+ <url-pattern> MUST match: \r
+ * ZipServlet\r
+ * com.gitblit.Constants.ZIP_PATH\r
+ * Wicket Filter ignorePaths parameter -->\r
+ <servlet>\r
+ <servlet-name>ZipServlet</servlet-name>\r
+ <servlet-class>com.gitblit.DownloadZipServlet</servlet-class> \r
+ </servlet>\r
+ <servlet-mapping>\r
+ <servlet-name>ZipServlet</servlet-name>\r
+ <url-pattern>/zip/*</url-pattern>\r
+ </servlet-mapping>\r
+ \r
+\r
+ <!-- Git Access Restriction Filter\r
+ <url-pattern> MUST match: \r
+ * GitServlet\r
+ * com.gitblit.Constants.GIT_PATH\r
+ * Wicket Filter ignorePaths parameter -->\r
+ <filter>\r
+ <filter-name>GitFilter</filter-name>\r
+ <filter-class>com.gitblit.GitFilter</filter-class>\r
+ </filter>\r
+ <filter-mapping>\r
+ <filter-name>GitFilter</filter-name>\r
+ <url-pattern>/git/*</url-pattern>\r
+ </filter-mapping>\r
+ \r
+ \r
+ <!-- Syndication Restriction Filter\r
+ <url-pattern> MUST match: \r
+ * SyndicationServlet\r
+ * com.gitblit.Constants.SYNDICATION_PATH\r
+ * Wicket Filter ignorePaths parameter -->\r
+ <filter>\r
+ <filter-name>SyndicationFilter</filter-name>\r
+ <filter-class>com.gitblit.SyndicationFilter</filter-class>\r
+ </filter>\r
+ <filter-mapping>\r
+ <filter-name>SyndicationFilter</filter-name>\r
+ <url-pattern>/feed/*</url-pattern>\r
+ </filter-mapping>\r
+\r
+ \r
+ <!-- Wicket Filter -->\r
+ <filter>\r
+ <filter-name>wicketFilter</filter-name>\r
+ <filter-class>\r
+ org.apache.wicket.protocol.http.WicketFilter\r
+ </filter-class>\r
+ <init-param>\r
+ <param-name>applicationClassName</param-name>\r
+ <param-value>com.gitblit.wicket.GitBlitWebApp</param-value>\r
+ </init-param>\r
+ <init-param>\r
+ <param-name>ignorePaths</param-name>\r
+ <!-- Paths should match \r
+ * SyndicationFilter <url-pattern>\r
+ * SyndicationServlet <url-pattern>\r
+ * com.gitblit.Constants.SYNDICATION_PATH\r
+ * GitFilter <url-pattern>\r
+ * GitServlet <url-pattern>\r
+ * com.gitblit.Constants.GIT_PATH\r
+ * ZipServlet <url-pattern>\r
+ * com.gitblit.Constants.ZIP_PATH -->\r
+ <param-value>git/,feed/,zip/</param-value>\r
+ </init-param>\r
+ </filter>\r
+ <filter-mapping>\r
+ <filter-name>wicketFilter</filter-name>\r
+ <url-pattern>/*</url-pattern>\r
+ </filter-mapping>\r
+</web-app>
\ No newline at end of file
package com.gitblit;\r
\r
import java.io.IOException;\r
+import java.nio.charset.Charset;\r
import java.security.Principal;\r
import java.text.MessageFormat;\r
import java.util.Enumeration;\r
import javax.servlet.http.HttpServletResponse;\r
import javax.servlet.http.HttpSession;\r
\r
+import org.eclipse.jgit.util.Base64;\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
\r
if (authorization != null && authorization.startsWith(BASIC)) {\r
// Authorization: Basic base64credentials\r
String base64Credentials = authorization.substring(BASIC.length()).trim();\r
- String credentials = StringUtils.decodeBase64(base64Credentials);\r
+ String credentials = new String(Base64.decode(base64Credentials),\r
+ Charset.forName("UTF-8"));\r
if (GitBlit.isDebugMode()) {\r
logger.info(MessageFormat.format("AUTH: {0} ({1})", authorization, credentials));\r
}\r
// authenticated request permitted.\r
// pass processing to the restricted servlet.\r
newSession(accessRequest, httpResponse);\r
- logger.info("ARF: " + fullUrl + " (" + HttpServletResponse.SC_CONTINUE + ") authenticated");\r
+ logger.info("ARF: " + fullUrl + " (" + HttpServletResponse.SC_CONTINUE\r
+ + ") authenticated");\r
chain.doFilter(accessRequest, httpResponse);\r
return;\r
}\r
}\r
\r
if (GitBlit.isDebugMode()) {\r
- logger.info("ARF: " + fullUrl + " (" + HttpServletResponse.SC_CONTINUE + ") unauthenticated");\r
+ logger.info("ARF: " + fullUrl + " (" + HttpServletResponse.SC_CONTINUE\r
+ + ") unauthenticated");\r
}\r
// unauthenticated request permitted.\r
// pass processing to the restricted servlet.\r
@Override\r
public void destroy() {\r
}\r
- \r
+\r
/**\r
* Wraps a standard HttpServletRequest and overrides user principal methods.\r
*/\r
public static class AccessRestrictionRequest extends ServletRequestWrapper {\r
\r
private UserModel user;\r
- \r
+\r
public AccessRestrictionRequest(HttpServletRequest req) {\r
super(req);\r
user = new UserModel("anonymous");\r
}\r
- \r
+\r
void setUser(UserModel user) {\r
this.user = user;\r
}\r
"c7adc475ca40c288c93054e0f4fe58f3a98c0cb5");\r
\r
public static final MavenObject JETTY = new MavenObject("Jetty",\r
- "org/eclipse/jetty/aggregate", "jetty-all", "7.4.1.v20110513", 1500000, 1000000,\r
- 4100000, "1e2de9ed25a7c6ae38717d5ffdc7cfcd6be4bd46",\r
- "7b6279d16ce8f663537d9faf55ea353e748dbbaa",\r
- "fa06212e751296f1a7abc15c843b135bf49a112b");\r
+ "org/eclipse/jetty/aggregate", "jetty-webapp", "7.4.2.v20110526", 1000000, 680000,\r
+ 2720000, "56331143afa22d24d9faba96e86e6371b0686c7c",\r
+ "9f38230fd589e29c8be0fc3c80fb51c5093c2e1e",\r
+ "0d48212889c25252c5c14bef62703e28215d80cc");\r
\r
public static final MavenObject SERVLET = new MavenObject("Servlet 2.5", "javax/servlet",\r
"servlet-api", "2.5", 105000, 158000, 0,\r
"3d32d958b2f7aa58388af5701ea3aafc433e573f",\r
"c37518b67ea85af485dd61fe854137eeacc50318");\r
\r
- public static final MavenObject JUNIT = new MavenObject("JUnit", "junit", "junit", "3.8.2",\r
- 120000, 0, 0, "07e4cde26b53a9a0e3fe5b00d1dbbc7cc1d46060", "", "");\r
+ public static final MavenObject JUNIT = new MavenObject("JUnit", "junit", "junit", "4.8.2",\r
+ 237000, 0, 0, "c94f54227b08100974c36170dcb53329435fe5ad", "", "");\r
\r
public static final MavenObject MARKDOWNPAPERS = new MavenObject("MarkdownPapers",\r
"org/tautua/markdownpapers", "markdownpapers-core", "1.0.0", 87000, 58000, 278000,\r
--- /dev/null
+/*\r
+ * Copyright 2011 gitblit.com.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package com.gitblit;\r
+\r
+import java.io.File;\r
+import java.io.FileInputStream;\r
+import java.io.FileOutputStream;\r
+import java.io.FileReader;\r
+import java.text.MessageFormat;\r
+import java.util.ArrayList;\r
+import java.util.Collections;\r
+import java.util.List;\r
+import java.util.Properties;\r
+\r
+public class BuildWebXml {\r
+ private static final String PARAMS = "<!-- PARAMS -->";\r
+ \r
+ private static final String [] STRIP_TOKENS = { "<!-- STRIP", "STRIP -->" };\r
+\r
+ 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";\r
+\r
+ public static void main(String[] args) throws Exception {\r
+ // Read the current Gitblit properties\r
+ // TODO extract the comments and inject them into web.xml too\r
+ FileInputStream fis = new FileInputStream(new File("distrib/gitblit.properties"));\r
+ Properties fileSettings = new Properties(); \r
+ fileSettings.load(fis);\r
+ fis.close();\r
+ List<String> keys = new ArrayList<String>(fileSettings.stringPropertyNames());\r
+ Collections.sort(keys);\r
+ \r
+ StringBuilder parameters = new StringBuilder();\r
+ for (String key : keys) {\r
+ if (!skipKey(key)) {\r
+ String value = fileSettings.getProperty(key);\r
+ parameters.append(MessageFormat.format(PARAM_PATTERN, key, value));\r
+ }\r
+ }\r
+\r
+ // Read the prototype web.xml file\r
+ File webxml = new File("src/WEB-INF/web.xml");\r
+ char [] buffer = new char[(int) webxml.length()];\r
+ FileReader reader = new FileReader(webxml);\r
+ reader.read(buffer);\r
+ reader.close();\r
+ String webXmlContent = new String(buffer);\r
+\r
+ // Insert the Gitblit properties into the prototype web.xml\r
+ for (String stripToken:STRIP_TOKENS) {\r
+ webXmlContent = webXmlContent.replace(stripToken, "");\r
+ }\r
+ int idx = webXmlContent.indexOf(PARAMS);\r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append(webXmlContent.substring(0, idx));\r
+ sb.append(parameters.toString());\r
+ sb.append(webXmlContent.substring(idx + PARAMS.length()));\r
+\r
+ // Save the merged web.xml to the war build folder\r
+ FileOutputStream os = new FileOutputStream(new File("war/WEB-INF/web.xml"), false);\r
+ os.write(sb.toString().getBytes());\r
+ os.close();\r
+ }\r
+\r
+ private static boolean skipKey(String key) {\r
+ return key.startsWith(Keys.server._ROOT);\r
+ }\r
+}\r
\r
public static final String PROPERTIES_FILE = "gitblit.properties";\r
\r
- public static final String GIT_SERVLET_PATH = "/git/";\r
+ public static final String GIT_PATH = "/git/";\r
\r
- public static final String ZIP_SERVLET_PATH = "/zip/";\r
+ public static final String ZIP_PATH = "/zip/";\r
\r
- public static final String SYNDICATION_SERVLET_PATH = "/feed/";\r
+ public static final String SYNDICATION_PATH = "/feed/";\r
\r
- public static final String RESOURCE_PATH = "/com/gitblit/wicket/resources/";\r
-\r
public static final String BORDER = "***********************************************************";\r
\r
public static enum AccessRestrictionType {\r
if (baseURL.length() > 0 && baseURL.charAt(baseURL.length() - 1) == '/') {\r
baseURL = baseURL.substring(0, baseURL.length() - 1);\r
}\r
- return baseURL + Constants.ZIP_SERVLET_PATH + "?r=" + repository\r
+ return baseURL + Constants.ZIP_PATH + "?r=" + repository\r
+ (path == null ? "" : ("&p=" + path))\r
+ (objectId == null ? "" : ("&h=" + objectId));\r
}\r
if (user.password.equalsIgnoreCase(md5)) {\r
returnedUser = user;\r
}\r
- }\r
- if (user.password.equals(new String(password))) {\r
+ } else if (user.password.equals(new String(password))) {\r
returnedUser = user;\r
}\r
return returnedUser;\r
\r
public class GitBlit implements ServletContextListener {\r
\r
- private static final GitBlit GITBLIT;\r
+ private static GitBlit gitblit;\r
\r
private final Logger logger = LoggerFactory.getLogger(GitBlit.class);\r
\r
\r
private File repositoriesFolder;\r
\r
- private boolean exportAll;\r
+ private boolean exportAll = true;\r
\r
private ILoginService loginService;\r
\r
private IStoredSettings storedSettings;\r
\r
- static {\r
- GITBLIT = new GitBlit();\r
- }\r
-\r
- private GitBlit() {\r
+ public GitBlit() {\r
+ if (gitblit == null) {\r
+ // Singleton reference when running in standard servlet container\r
+ gitblit = this;\r
+ }\r
}\r
\r
public static GitBlit self() {\r
- return GITBLIT;\r
+ if (gitblit == null) {\r
+ gitblit = new GitBlit();\r
+ }\r
+ return gitblit;\r
}\r
\r
public static boolean getBoolean(String key, boolean defaultValue) {\r
- return GITBLIT.storedSettings.getBoolean(key, defaultValue);\r
+ return self().storedSettings.getBoolean(key, defaultValue);\r
}\r
\r
public static int getInteger(String key, int defaultValue) {\r
- return GITBLIT.storedSettings.getInteger(key, defaultValue);\r
+ return self().storedSettings.getInteger(key, defaultValue);\r
}\r
\r
public static String getString(String key, String defaultValue) {\r
- return GITBLIT.storedSettings.getString(key, defaultValue);\r
+ return self().storedSettings.getString(key, defaultValue);\r
}\r
\r
public static List<String> getStrings(String key) {\r
- return GITBLIT.storedSettings.getStrings(key);\r
+ return self().storedSettings.getStrings(key);\r
}\r
\r
public static List<String> getAllKeys(String startingWith) {\r
- return GITBLIT.storedSettings.getAllKeys(startingWith);\r
+ return self().storedSettings.getAllKeys(startingWith);\r
}\r
\r
public static boolean isDebugMode() {\r
- return GITBLIT.storedSettings.getBoolean(Keys.web.debugMode, false);\r
+ return self().storedSettings.getBoolean(Keys.web.debugMode, false);\r
}\r
\r
public List<String> getOtherCloneUrls(String repositoryName) {\r
}\r
\r
public void setLoginService(ILoginService loginService) {\r
+ logger.info("Setting up login service " + loginService.toString());\r
this.loginService = loginService;\r
}\r
\r
public void configureContext(IStoredSettings settings) {\r
logger.info("Reading configuration from " + settings.toString());\r
this.storedSettings = settings;\r
- repositoriesFolder = new File(settings.getString(Keys.git.repositoriesFolder, "repos"));\r
- exportAll = settings.getBoolean(Keys.git.exportAll, true);\r
+ repositoriesFolder = new File(settings.getString(Keys.git.repositoriesFolder, "git"));\r
+ logger.info("Git repositories folder " + repositoriesFolder.getAbsolutePath());\r
repositoryResolver = new FileResolver<Void>(repositoriesFolder, exportAll);\r
+ String realm = settings.getString(Keys.realm.realmFile, "users.properties");\r
+ ILoginService loginService = null;\r
+ try {\r
+ // Check to see if this "file" is a login service class\r
+ Class<?> realmClass = Class.forName(realm);\r
+ if (ILoginService.class.isAssignableFrom(realmClass)) {\r
+ loginService = (ILoginService) realmClass.newInstance();\r
+ }\r
+ } catch (Throwable t) {\r
+ // Not a login service class OR other issue\r
+ // Use default file login service\r
+ File realmFile = new File(realm);\r
+ if (!realmFile.exists()) {\r
+ try {\r
+ realmFile.createNewFile();\r
+ } catch (IOException x) {\r
+ logger.error(\r
+ MessageFormat.format("COULD NOT CREATE REALM FILE {0}!", realmFile), x);\r
+ }\r
+ }\r
+ loginService = new FileLoginService(realmFile);\r
+ }\r
+ setLoginService(loginService);\r
}\r
\r
@Override\r
import java.util.ArrayList;\r
import java.util.List;\r
\r
-import org.apache.log4j.ConsoleAppender;\r
-import org.apache.log4j.PatternLayout;\r
-import org.apache.wicket.protocol.http.ContextParamWebApplicationFactory;\r
-import org.apache.wicket.protocol.http.WicketFilter;\r
import org.eclipse.jetty.server.Connector;\r
import org.eclipse.jetty.server.Server;\r
import org.eclipse.jetty.server.bio.SocketConnector;\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.FilterHolder;\r
import org.eclipse.jetty.servlet.FilterMapping;\r
import org.eclipse.jetty.servlet.ServletHolder;\r
import org.eclipse.jetty.util.thread.QueuedThreadPool;\r
import com.beust.jcommander.ParameterException;\r
import com.beust.jcommander.Parameters;\r
import com.gitblit.utils.StringUtils;\r
-import com.gitblit.wicket.GitBlitWebApp;\r
\r
public class GitBlitServer {\r
\r
*/\r
private static void start(Params params) {\r
FileSettings settings = params.FILESETTINGS;\r
- String pattern = settings.getString(Keys.server.log4jPattern,\r
- "%-5p %d{MM-dd HH:mm:ss.SSS} %-20.20c{1} %m%n");\r
-\r
- // allow os override of logging pattern\r
- String os = System.getProperty("os.name").toLowerCase();\r
- if (os.indexOf("windows") > -1) {\r
- String winPattern = settings.getString(Keys.server.log4jPattern_windows, pattern);\r
- if (!StringUtils.isEmpty(winPattern)) {\r
- pattern = winPattern;\r
- }\r
- } else if (os.indexOf("linux") > -1) {\r
- String linuxPattern = settings.getString(Keys.server.log4jPattern_linux, pattern);\r
- if (!StringUtils.isEmpty(linuxPattern)) {\r
- pattern = linuxPattern;\r
- }\r
- }\r
-\r
- PatternLayout layout = new PatternLayout(pattern);\r
- org.apache.log4j.Logger rootLogger = org.apache.log4j.Logger.getRootLogger();\r
- rootLogger.addAppender(new ConsoleAppender(layout));\r
\r
logger = LoggerFactory.getLogger(GitBlitServer.class);\r
logger.info(Constants.BORDER);\r
sessionManager.setSecureCookies(params.port <= 0 && params.securePort > 0);\r
rootContext.getSessionHandler().setSessionManager(sessionManager);\r
\r
- // Wicket Filter\r
- String wicketPathSpec = "/*";\r
- FilterHolder wicketFilter = new FilterHolder(WicketFilter.class);\r
- wicketFilter.setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM,\r
- GitBlitWebApp.class.getName());\r
- wicketFilter.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, wicketPathSpec);\r
- wicketFilter.setInitParameter(WicketFilter.IGNORE_PATHS_PARAM, "git/,feed/,zip/");\r
- rootContext.addFilter(wicketFilter, wicketPathSpec, FilterMapping.DEFAULT);\r
-\r
// JGit Filter and Servlet\r
- if (settings.getBoolean(Keys.git.enableGitServlet, true)) {\r
- String jgitPathSpec = Constants.GIT_SERVLET_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",\r
- settings.getBoolean(Keys.git.exportAll, true) ? "1" : "0");\r
- }\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
- // Syndication Filter and Servlet\r
- String feedPathSpec = Constants.SYNDICATION_SERVLET_PATH + "*";\r
- rootContext.addFilter(SyndicationFilter.class, feedPathSpec, FilterMapping.DEFAULT);\r
- rootContext.addServlet(SyndicationServlet.class, feedPathSpec);\r
-\r
- // Zip Servlet\r
- rootContext.addServlet(DownloadZipServlet.class, Constants.ZIP_SERVLET_PATH + "*");\r
-\r
- // Login Service\r
+ // Ensure there is a defined Login Service\r
String realmUsers = params.realmFile;\r
if (StringUtils.isEmpty(realmUsers)) {\r
logger.error(MessageFormat.format("PLEASE SPECIFY {0}!!", Keys.realm.realmFile));\r
return;\r
}\r
- File realmFile = new File(realmUsers);\r
- if (!realmFile.exists()) {\r
- try {\r
- realmFile.createNewFile();\r
- } catch (IOException x) {\r
- logger.error(MessageFormat.format("COULD NOT CREATE REALM FILE {0}!", realmUsers),\r
- x);\r
- return;\r
- }\r
- }\r
- logger.info("Setting up login service from " + realmUsers);\r
- FileLoginService loginService = new FileLoginService(realmFile);\r
- GitBlit.self().setLoginService(loginService);\r
-\r
- logger.info("Git repositories folder "\r
- + new File(params.repositoriesFolder).getAbsolutePath());\r
+ \r
+ // Update settings\r
+// settings.put(Keys.realm.realmFile, params.realmFile);\r
+// settings.put(Keys.git.repositoriesFolder, params.repositoriesFolder);\r
\r
// Set the server's contexts\r
server.setHandler(rootContext);\r
\r
@Override\r
protected boolean canAccess(RepositoryModel repository, UserModel user, String urlRequestType) {\r
+ if (!GitBlit.getBoolean(Keys.git.enableGitServlet, true)) {\r
+ // Git Servlet disabled\r
+ return false;\r
+ }\r
if (repository.isFrozen || repository.accessRestriction.atLeast(AccessRestrictionType.PUSH)) {\r
boolean authorizedUser = user.canAccessRepository(repository.name);\r
if (urlRequestType.equals(gitReceivePack)) {\r
boolean renameRole(String oldRole, String newRole);\r
\r
boolean deleteRole(String role);\r
+ \r
+ String toString();\r
}\r
public abstract class IStoredSettings {\r
\r
protected final Logger logger;\r
- \r
+\r
public IStoredSettings(Class<? extends IStoredSettings> clazz) {\r
logger = LoggerFactory.getLogger(clazz);\r
}\r
- \r
+\r
protected abstract Properties read();\r
\r
public List<String> getAllKeys(String startingWith) {\r
- startingWith = startingWith.toLowerCase();\r
List<String> keys = new ArrayList<String>();\r
Properties props = read();\r
- for (Object o : props.keySet()) {\r
- String key = o.toString();\r
- if (key.toLowerCase().startsWith(startingWith)) {\r
- keys.add(key);\r
+ if (StringUtils.isEmpty(startingWith)) {\r
+ keys.addAll(props.stringPropertyNames());\r
+ } else {\r
+ startingWith = startingWith.toLowerCase();\r
+ for (Object o : props.keySet()) {\r
+ String key = o.toString();\r
+ if (key.toLowerCase().startsWith(startingWith)) {\r
+ keys.add(key);\r
+ }\r
}\r
}\r
return keys;\r
}\r
StringBuilder url = new StringBuilder();\r
url.append(baseURL);\r
- url.append(Constants.SYNDICATION_SERVLET_PATH);\r
+ url.append(Constants.SYNDICATION_PATH);\r
url.append(repository);\r
if (!StringUtils.isEmpty(objectId) || length > 0) {\r
StringBuilder parameters = new StringBuilder("?");\r
\r
public static List<PathChangeModel> getFilesInCommit(Repository r, RevCommit commit) {\r
List<PathChangeModel> list = new ArrayList<PathChangeModel>();\r
- RevWalk rw = new RevWalk(r);\r
- TreeWalk tw = new TreeWalk(r);\r
+ RevWalk rw = new RevWalk(r); \r
try {\r
if (commit == null) {\r
ObjectId object = r.resolve(Constants.HEAD);\r
commit = rw.parseCommit(object);\r
- }\r
- RevTree commitTree = commit.getTree();\r
+ } \r
\r
- tw.reset();\r
- tw.setRecursive(true);\r
if (commit.getParentCount() == 0) {\r
- tw.addTree(commitTree);\r
+ TreeWalk tw = new TreeWalk(r);\r
+ tw.reset();\r
+ tw.setRecursive(true);\r
+ tw.addTree(commit.getTree());\r
while (tw.next()) {\r
list.add(new PathChangeModel(tw.getPathString(), tw.getPathString(), 0, tw\r
.getRawMode(0), commit.getId().getName(), ChangeType.ADD));\r
}\r
+ tw.release();\r
} else {\r
RevCommit parent = rw.parseCommit(commit.getParent(0).getId());\r
- RevTree parentTree = parent.getTree();\r
- tw.addTree(parentTree);\r
- tw.addTree(commitTree);\r
- tw.setFilter(TreeFilter.ANY_DIFF);\r
-\r
- RawTextComparator cmp = RawTextComparator.DEFAULT;\r
DiffFormatter df = new DiffFormatter(DisabledOutputStream.INSTANCE);\r
df.setRepository(r);\r
- df.setDiffComparator(cmp);\r
+ df.setDiffComparator(RawTextComparator.DEFAULT);\r
df.setDetectRenames(true);\r
- List<DiffEntry> diffs = df.scan(parentTree, commitTree);\r
+ List<DiffEntry> diffs = df.scan(parent.getTree(), commit.getTree());\r
for (DiffEntry diff : diffs) {\r
if (diff.getChangeType().equals(ChangeType.DELETE)) {\r
list.add(new PathChangeModel(diff.getOldPath(), diff.getOldPath(), 0, diff\r
} catch (Throwable t) {\r
LOGGER.error("failed to determine files in commit!", t);\r
} finally {\r
- rw.dispose();\r
- tw.release();\r
+ rw.dispose(); \r
}\r
return list;\r
}\r
package com.gitblit.utils;\r
\r
import java.io.UnsupportedEncodingException;\r
-import java.nio.charset.Charset;\r
import java.security.MessageDigest;\r
import java.security.NoSuchAlgorithmException;\r
import java.util.ArrayList;\r
import java.util.List;\r
import java.util.regex.PatternSyntaxException;\r
\r
-import org.eclipse.jetty.util.log.Log;\r
-import org.eclipse.jgit.util.Base64;\r
-\r
public class StringUtils {\r
\r
public static final String MD5_TYPE = "MD5:";\r
md.update(string.getBytes("iso-8859-1"));\r
byte[] digest = md.digest();\r
return toHex(digest);\r
- } catch (Exception e) {\r
- Log.warn(e);\r
- return null;\r
+ } catch (UnsupportedEncodingException u) {\r
+ throw new RuntimeException(u);\r
+ } catch (NoSuchAlgorithmException t) {\r
+ throw new RuntimeException(t);\r
}\r
}\r
\r
}\r
return sb.toString();\r
}\r
-\r
- public static String decodeBase64(String base64) {\r
- return new String(Base64.decode(base64), Charset.forName("UTF-8"));\r
- }\r
-\r
+ \r
public static String getRootPath(String path) {\r
if (path.indexOf('/') > -1) {\r
return path.substring(0, path.lastIndexOf('/'));\r
feed.setDescription(description);\r
SyndImageImpl image = new SyndImageImpl();\r
image.setTitle(Constants.NAME);\r
- image.setUrl(hostUrl + Constants.RESOURCE_PATH + "gitblt_25.png");\r
+ image.setUrl(hostUrl + "/gitblt_25.png");\r
image.setLink(hostUrl);\r
feed.setImage(image);\r
\r
gb.missingUsername = Missing Username\r
gb.edit = edit\r
gb.searchTypeTooltip = Select Search Type\r
-gb.searchTooltip = Search Git:Blit\r
+gb.searchTooltip = Search Gitblit\r
gb.delete = delete\r
gb.docs = docs\r
gb.accessRestriction = access restriction\r
gb.useTicketsDescription = distributed Ticgit issues\r
gb.useDocsDescription = enumerates Markdown documentation in repository\r
gb.showRemoteBranchesDescription = show remote branches\r
-gb.canAdminDescription = can administer Git:Blit server\r
+gb.canAdminDescription = can administer Gitblit server\r
gb.permittedUsers = permitted users\r
gb.isFrozen = is frozen\r
gb.isFrozenDescription = deny push operations\r
}\r
\r
public static ContextImage newImage(String wicketId, String file, String tooltip) {\r
- ContextImage img = new ContextImage(wicketId, com.gitblit.Constants.RESOURCE_PATH + file);\r
+ ContextImage img = new ContextImage(wicketId, file);\r
if (!StringUtils.isEmpty(tooltip)) {\r
setHtmlTooltip(img, tooltip);\r
}\r
}\r
\r
public static ContextRelativeResource getResource(String file) {\r
- return new ContextRelativeResource(com.gitblit.Constants.RESOURCE_PATH + file);\r
+ return new ContextRelativeResource(file);\r
}\r
\r
public static String getHostURL(Request request) {\r
xml:lang="en" \r
lang="en"> \r
\r
- <!-- Head with Wicket-controlled resources in this package -->\r
+ <!-- Head -->\r
<wicket:head>\r
<title wicket:id="title">[page title]</title>\r
- <wicket:link>\r
- <link rel="stylesheet" type="text/css" href="/com/gitblit/wicket/resources/gitblit.css"/>\r
- <link rel="shortcut icon" href="/com/gitblit/wicket/resources/gitblt-favicon.png" type="image/png" />\r
- </wicket:link>\r
+ <link rel="stylesheet" type="text/css" href="gitblit.css"/>\r
+ <link rel="icon" href="gitblt-favicon.png" type="image/png" />\r
</wicket:head>\r
\r
<body>\r
<!-- page header -->\r
<div class="page_header">\r
<a title="gitblit homepage" href="http://gitblit.com/">\r
- <wicket:link>\r
- <img src="/com/gitblit/wicket/resources/gitblt_25.png" width="79" height="25" alt="gitblit" class="logo"/>\r
- </wicket:link>\r
+ <img src="gitblt_25.png" width="79" height="25" alt="gitblit" class="logo"/>\r
</a>\r
<span>\r
- <a href="/"><span wicket:id="siteName">[site name]</span></a> / <span wicket:id="repositoryName">[repository name]</span> <span wicket:id="pageName">[page name]</span>\r
+ <span wicket:id="siteName">[site name]</span> / <span wicket:id="repositoryName">[repository name]</span> <span wicket:id="pageName">[page name]</span>\r
</span> \r
</div>\r
\r
if (siteName == null || siteName.trim().length() == 0) {\r
siteName = Constants.NAME;\r
}\r
- add(new Label("siteName", siteName));\r
+ add(new LinkPanel("siteName", null, siteName, RepositoriesPage.class, null));\r
add(new LinkPanel("repositoryName", null, repositoryName, SummaryPage.class,\r
WicketUtils.newRepositoryParameter(repositoryName)));\r
add(new Label("pageName", pageName));\r
HttpServletRequest req = servletWebRequest.getHttpServletRequest();\r
return req.getServerName();\r
}\r
+ \r
+ public void warn(String message, Throwable t) {\r
+ logger.warn(message, t);\r
+ }\r
\r
public void error(String message, boolean redirect) {\r
logger.error(message);\r
.newPathParameter(repositoryName, entry.commitId, entry.path)));\r
item.add(new BookmarkablePageLink<Void>("raw", RawPage.class, WicketUtils\r
.newPathParameter(repositoryName, entry.commitId, entry.path)));\r
- item.add(new BookmarkablePageLink<Void>("blame", BlobPage.class).setEnabled(false));\r
+ item.add(new BookmarkablePageLink<Void>("blame", BlamePage.class,\r
+ WicketUtils.newPathParameter(repositoryName, entry.commitId, entry.path)));\r
item.add(new BookmarkablePageLink<Void>("history", HistoryPage.class, WicketUtils\r
.newPathParameter(repositoryName, entry.commitId, entry.path)));\r
WicketUtils.setAlternatingBackground(item, counter);\r
<!-- Head with Wicket-controlled resources in this package -->\r
<wicket:head>\r
<title wicket:id="title">[page title]</title>\r
- <wicket:link>\r
- <link rel="stylesheet" type="text/css" href="/com/gitblit/wicket/resources/gitblit.css"/>\r
- <link rel="shortcut icon" href="/com/gitblit/wicket/resources/gitblt-favicon.png" type="image/png" />\r
- </wicket:link>\r
+ <link rel="stylesheet" type="text/css" href="gitblit.css"/>\r
+ <link rel="shortcut icon" href="gitblt-favicon.png" type="image/png" />\r
</wicket:head>\r
\r
<body onload="document.getElementById('username').focus();">\r
<div>\r
<div style="padding-top: 10px;text-align:center;">\r
- <wicket:link>\r
- <img src="/com/gitblit/wicket/resources/gitblt_25.png" alt="Git:Blit"/><br/>\r
- </wicket:link>\r
+ <img src="gitblt_25.png" alt="Gitblit"/><br/>\r
<div style="padding-top:30px;font-weight:bold;" wicket:id="name">[name]</div>\r
</div>\r
\r
\r
<!-- contribute markdown css to the page header -->\r
<wicket:head>\r
- <wicket:link>\r
- <link href="/com/gitblit/wicket/resources/markdown.css" type="text/css" rel="stylesheet" />\r
- </wicket:link>\r
+ <link href="markdown.css" type="text/css" rel="stylesheet" />\r
</wicket:head>\r
\r
<body>\r
<wicket:extend>\r
<!-- markdown nav links --> \r
<div class="page_nav2">\r
- <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>\r
+ <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>\r
</div> \r
\r
<!-- markdown content -->\r
RevCommit commit = JGitUtils.getCommit(r, objectId);\r
\r
// markdown page links\r
- add(new Label("blameLink", getString("gb.blame")));\r
+ add(new BookmarkablePageLink<Void>("blameLink", BlamePage.class,\r
+ WicketUtils.newPathParameter(repositoryName, objectId, markdownPath)));\r
add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class,\r
WicketUtils.newPathParameter(repositoryName, objectId, markdownPath)));\r
add(new BookmarkablePageLink<Void>("rawLink", RawPage.class, WicketUtils.newPathParameter(\r
xml:lang="en" \r
lang="en"> \r
<wicket:head>\r
- <wicket:link>\r
- <link href="/com/gitblit/wicket/resources/markdown.css" type="text/css" rel="stylesheet" />\r
- </wicket:link>\r
+ <link href="markdown.css" type="text/css" rel="stylesheet" />\r
</wicket:head>\r
\r
<body>\r
message = MarkdownUtils.transformMarkdown(reader);\r
} catch (Throwable t) {\r
message = "Failed to read " + file;\r
- error(message, t, false);\r
+ warn(message, t);\r
}\r
} else {\r
message = messageSource + " is not a valid file.";\r
<!-- page nav links -->\r
<div class="page_nav">\r
<a style="text-decoration: none;" wicket:id="syndication">\r
- <img style="border:0px;vertical-align:middle;" src="/com/gitblit/wicket/resources/feed_16x16.png"></img>\r
+ <img style="border:0px;vertical-align:middle;" src="feed_16x16.png"></img>\r
</a> \r
<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>\r
</div>\r
import org.eclipse.jgit.lib.PersonIdent;\r
import org.eclipse.jgit.lib.Repository;\r
import org.eclipse.jgit.revwalk.RevCommit;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
\r
import com.gitblit.GitBlit;\r
import com.gitblit.Keys;\r
\r
private RepositoryModel m;\r
\r
- private final Logger logger = LoggerFactory.getLogger(RepositoryPage.class);\r
-\r
- private final Map<String, String> knownPages = new HashMap<String, String>() {\r
+ private final Map<String, PageRegistration> registeredPages = new HashMap<String, PageRegistration>() {\r
\r
private static final long serialVersionUID = 1L;\r
\r
{\r
- put("summary", "gb.summary");\r
- put("log", "gb.log");\r
- put("branches", "gb.branches");\r
- put("tags", "gb.tags");\r
- put("tree", "gb.tree");\r
- put("tickets", "gb.tickets");\r
- put("edit", "gb.edit");\r
+ put("summary", new PageRegistration("gb.summary", SummaryPage.class));\r
+ put("log", new PageRegistration("gb.log", LogPage.class));\r
+ put("branches", new PageRegistration("gb.branches", BranchesPage.class));\r
+ put("tags", new PageRegistration("gb.tags", TagsPage.class));\r
+ put("tree", new PageRegistration("gb.tree", TreePage.class));\r
+ put("tickets", new PageRegistration("gb.tickets", TicketsPage.class));\r
+ put("edit", new PageRegistration("gb.edit", EditRepositoryPage.class));\r
+ put("docs", new PageRegistration("gb.docs", DocsPage.class));\r
}\r
};\r
\r
RepositoryModel model = getRepositoryModel();\r
\r
// standard page links\r
- add(new BookmarkablePageLink<Void>("summary", SummaryPage.class,\r
- WicketUtils.newRepositoryParameter(repositoryName)));\r
- add(new BookmarkablePageLink<Void>("log", LogPage.class,\r
- WicketUtils.newRepositoryParameter(repositoryName)));\r
- add(new BookmarkablePageLink<Void>("branches", BranchesPage.class,\r
- WicketUtils.newRepositoryParameter(repositoryName)));\r
- add(new BookmarkablePageLink<Void>("tags", TagsPage.class,\r
- WicketUtils.newRepositoryParameter(repositoryName)));\r
- add(new BookmarkablePageLink<Void>("tree", TreePage.class,\r
- WicketUtils.newRepositoryParameter(repositoryName)));\r
+ addRegisteredPageLink("summary");\r
+ addRegisteredPageLink("log");\r
+ addRegisteredPageLink("branches");\r
+ addRegisteredPageLink("tags");\r
+ addRegisteredPageLink("tree");\r
\r
// per-repository extra page links\r
List<String> extraPageLinks = new ArrayList<String>();\r
-\r
- // Conditionally add tickets link\r
if (model.useTickets && TicgitUtils.getTicketsBranch(r) != null) {\r
extraPageLinks.add("tickets");\r
}\r
-\r
- // Conditionally add docs link\r
if (model.useDocs) {\r
extraPageLinks.add("docs");\r
}\r
extraPageLinks.add("edit");\r
}\r
\r
+ final String pageName = getPageName();\r
+ final String pageWicketId = getLinkWicketId(pageName);\r
ListDataProvider<String> extrasDp = new ListDataProvider<String>(extraPageLinks);\r
DataView<String> extrasView = new DataView<String>("extra", extrasDp) {\r
private static final long serialVersionUID = 1L;\r
\r
public void populateItem(final Item<String> item) {\r
String extra = item.getModelObject();\r
- if (extra.equals("tickets")) {\r
- item.add(new Label("extraSeparator", " | "));\r
- item.add(new LinkPanel("extraLink", null, getString("gb.tickets"),\r
- TicketsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
- } else if (extra.equals("docs")) {\r
- item.add(new Label("extraSeparator", " | "));\r
- item.add(new LinkPanel("extraLink", null, getString("gb.docs"), DocsPage.class,\r
- WicketUtils.newRepositoryParameter(repositoryName)));\r
- } else if (extra.equals("edit")) {\r
- item.add(new Label("extraSeparator", " | "));\r
- item.add(new LinkPanel("extraLink", null, getString("gb.edit"),\r
- EditRepositoryPage.class, WicketUtils\r
- .newRepositoryParameter(repositoryName)));\r
- }\r
+ PageRegistration pageReg = registeredPages.get(extra);\r
+ item.add(new Label("extraSeparator", " | "));\r
+ item.add(new LinkPanel("extraLink", null, getString(pageReg.translationKey),\r
+ pageReg.pageClass, WicketUtils.newRepositoryParameter(repositoryName))\r
+ .setEnabled(!extra.equals(pageWicketId)));\r
}\r
};\r
add(extrasView);\r
.getRelativePathPrefixToContextRoot(), repositoryName, null, 0)));\r
\r
// disable current page\r
- disablePageLink(getPageName());\r
+ disableRegisteredPageLink(pageName);\r
\r
// add floating search form\r
SearchForm searchForm = new SearchForm("searchForm", repositoryName);\r
setStatelessHint(true);\r
}\r
\r
- public void disablePageLink(String pageName) {\r
- for (String wicketId : knownPages.keySet()) {\r
- String key = knownPages.get(wicketId);\r
+ public String getLinkWicketId(String pageName) {\r
+ for (String wicketId : registeredPages.keySet()) {\r
+ String key = registeredPages.get(wicketId).translationKey;\r
String linkName = getString(key);\r
if (linkName.equals(pageName)) {\r
- Component c = get(wicketId);\r
- if (c != null) {\r
- c.setEnabled(false);\r
- }\r
- break;\r
+ return wicketId;\r
}\r
}\r
+ return null;\r
+ }\r
+\r
+ public void disableRegisteredPageLink(String pageName) {\r
+ String wicketId = getLinkWicketId(pageName);\r
+ if (!StringUtils.isEmpty(wicketId)) {\r
+ Component c = get(wicketId);\r
+ if (c != null) {\r
+ c.setEnabled(false);\r
+ }\r
+ }\r
+ }\r
+\r
+ private void addRegisteredPageLink(String key) {\r
+ PageRegistration pageReg = registeredPages.get(key);\r
+ add(new BookmarkablePageLink<Void>(key, pageReg.pageClass,\r
+ WicketUtils.newRepositoryParameter(repositoryName)));\r
}\r
\r
protected void addSyndicationDiscoveryLink() {\r
return WicketUtils.newPathParameter(repositoryName, objectId, path);\r
}\r
\r
+ private static class PageRegistration {\r
+ final String translationKey;\r
+ final Class<? extends BasePage> pageClass;\r
+\r
+ PageRegistration(String translationKey, Class<? extends BasePage> pageClass) {\r
+ this.translationKey = translationKey;\r
+ this.pageClass = pageClass;\r
+ }\r
+ }\r
+\r
private static class SearchForm extends StatelessForm<Void> {\r
private static final long serialVersionUID = 1L;\r
\r
lang="en"> \r
\r
<wicket:head>\r
- <wicket:link>\r
- <link href="/com/gitblit/wicket/resources/markdown.css" type="text/css" rel="stylesheet" />\r
- </wicket:link>\r
+ <link href="markdown.css" type="text/css" rel="stylesheet" />\r
</wicket:head>\r
\r
<body>\r
}\r
StringBuilder sb = new StringBuilder();\r
sb.append(WicketUtils.getHostURL(getRequestCycle().getRequest())); \r
- sb.append(Constants.GIT_SERVLET_PATH);\r
+ sb.append(Constants.GIT_PATH);\r
sb.append(repositoryName);\r
repositoryUrls.add(sb.toString());\r
} else {\r
<wicket:fragment wicket:id="adminLinks">\r
<!-- page nav links --> \r
<div class="admin_nav">\r
- <wicket:link>\r
- <img style="vertical-align: top;" src="/com/gitblit/wicket/resources/add_16x16.png"/>\r
- </wicket:link> \r
+ <img style="vertical-align: top;" src="add_16x16.png"/>\r
<a wicket:id="newRepository">\r
<wicket:message key="gb.newRepository"></wicket:message>\r
</a>\r
<wicket:fragment wicket:id="flatRepositoryHeader">\r
<tr>\r
<th class="left" wicket:id="orderByRepository">\r
- <wicket:link>\r
- <img style="vertical-align: top; border: 1px solid #888;" src="/com/gitblit/wicket/resources/gitweb-favicon.png"/>\r
- </wicket:link>\r
+ <img style="vertical-align: top; border: 1px solid #888;" src="gitweb-favicon.png"/>\r
<wicket:message key="gb.repository">Repository</wicket:message>\r
</th>\r
<th wicket:id="orderByDescription"><wicket:message key="gb.description">Description</wicket:message></th>\r
<wicket:fragment wicket:id="groupRepositoryHeader">\r
<tr>\r
<th class="left">\r
- <wicket:link>\r
- <img style="vertical-align: top; border: 1px solid #888;" src="/com/gitblit/wicket/resources/gitweb-favicon.png"/>\r
- </wicket:link>\r
+ <img style="vertical-align: top; border: 1px solid #888;" src="gitweb-favicon.png"/>\r
<wicket:message key="gb.repository">Repository</wicket:message>\r
</th>\r
<th><wicket:message key="gb.description">Description</wicket:message></th>\r
<td class="rightAlign">\r
<span wicket:id="repositoryLinks"></span>\r
<a style="text-decoration: none;" wicket:id="syndication">\r
- <img style="border:0px;vertical-align:middle;" src="/com/gitblit/wicket/resources/feed_16x16.png"></img>\r
+ <img style="border:0px;vertical-align:middle;" src="feed_16x16.png"></img>\r
</a>\r
</td> \r
</wicket:fragment>\r
<wicket:panel>\r
\r
<!-- header --> \r
- <div class="header" wicket:id="header">[search header]</div>\r
+ <div wicket:id="commitHeader">[search header]</div>\r
\r
+ <!-- header --> \r
+ <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>\r
<table class="pretty">\r
<tbody>\r
<tr wicket:id="commit">\r
import java.util.List;\r
import java.util.Map;\r
\r
+import org.apache.wicket.markup.html.basic.Label;\r
import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
import org.apache.wicket.markup.repeater.Item;\r
import org.apache.wicket.markup.repeater.data.DataView;\r
hasMore = commits.size() >= itemsPerPage;\r
\r
// header\r
- add(new LinkPanel("header", "title", commit == null ? "" : commit.getShortMessage(),\r
- CommitPage.class, WicketUtils.newObjectParameter(repositoryName,\r
- commit == null ? "" : commit.getName())));\r
+ add(new CommitHeaderPanel("commitHeader", repositoryName, commit));\r
+ \r
+ add(new Label("searchString", value));\r
+ add(new Label("searchType", searchType.toString()));\r
\r
ListDataProvider<RevCommit> dp = new ListDataProvider<RevCommit>(commits);\r
DataView<RevCommit> searchView = new DataView<RevCommit>("commit", dp) {\r
<table class="repositories">\r
<tr>\r
<th class="left">\r
- <wicket:link>\r
- <img style="vertical-align: top; border: 1px solid #888; background-color: white;" src="/com/gitblit/wicket/resources/user_16x16.png"/>\r
- </wicket:link>\r
+ <img style="vertical-align: top; border: 1px solid #888; background-color: white;" src="user_16x16.png"/>\r
<wicket:message key="gb.username">[username]</wicket:message>\r
</th>\r
<th class="right"></th>\r
<wicket:fragment wicket:id="adminLinks">\r
<!-- page nav links --> \r
<div class="admin_nav">\r
- <wicket:link>\r
- <img style="vertical-align: top;" src="/com/gitblit/wicket/resources/add_16x16.png"/>\r
- </wicket:link> \r
+ <img style="vertical-align: top;" src="add_16x16.png"/>\r
<a wicket:id="newUser">\r
<wicket:message key="gb.newUser"></wicket:message>\r
</a>\r
+++ /dev/null
-/*\r
- Git:Blit css.\r
-*/\r
-html, body, table, dl, dt, dd, ol, ul, li, form, a, span, tr, th, td, div, em {\r
- font-family: verdana, sans-serif;\r
- font-size: 12px;\r
- line-height: 1.35em;\r
- margin: 0;\r
- padding: 0;\r
- border: 0;\r
- outline: 0;\r
-}\r
-\r
-body {\r
- width: 980px;\r
- margin: 5px;\r
- background-color: #ffffff;\r
- color: #000000;\r
- margin-right: auto;\r
- margin-left: auto; \r
- padding: 0px;\r
- background: url(background.png) repeat-x scroll 0 0 #FFFFFF;\r
-}\r
-\r
-pre, code, pre.prettyprint, pre.plainprint {\r
- color: black;\r
- font-family: monospace;\r
- font-size:12px;\r
- border:0px;\r
-}\r
-\r
-pre.prettyprint ol {\r
- padding-left:25px;\r
-}\r
-\r
-/* age0: age < 60*60*2 */\r
-.age0 {\r
- color: #008000;\r
- font-style: italic;\r
- font-weight: bold;\r
-}\r
-\r
-/* age1: 60*60*2 <= age < 60*60*24*2 */\r
-.age1 {\r
- color: #008000;\r
- font-style: italic;\r
-}\r
-\r
-/* age2: 60*60*24*2 <= age */\r
-.age2 {\r
- font-style: italic;\r
-}\r
-\r
-img.inlineIcon {\r
- padding-left: 1px;\r
- padding-right: 1px;\r
-}\r
-\r
-a {\r
- color: #0000cc;\r
-}\r
-\r
-a:hover, a:visited, a:active {\r
- color: #880000;\r
-}\r
-\r
-img.logo {\r
- float: right;\r
- border-width: 0px;\r
-}\r
-\r
-img.activityGraph {\r
- float: right;\r
- border-width: 0px;\r
- padding: 8px;\r
-}\r
-\r
-div.repositories_message {\r
- line-height: inherit;\r
-}\r
-\r
-div.header, div.commitHeader {\r
- background-color: #D2C3AF;\r
- padding: 3px;\r
- border: 1px solid #808080;\r
-}\r
-\r
-div.header {\r
- border-radius: 3px 3px 0 0;\r
-}\r
-\r
-div.commitHeader {\r
- border-radius: 3px;\r
-}\r
-\r
-div.header a, div.commitHeader a {\r
- color: black;\r
- text-decoration: none;\r
- font-weight: bold;\r
-}\r
-\r
-div.header a:hover, div.commitHeader a:hover {\r
- text-decoration: underline;\r
-}\r
-\r
-div.pager {\r
- padding: 0px 0px 15px 5px;\r
-}\r
-\r
-span.empty {\r
- font-size: 0.9em;\r
- font-style: italic;\r
- padding-left:10px;\r
- color: #008000;\r
-}\r
-\r
-span.link {\r
- color: #888;\r
-}\r
-\r
-span.link, span.link a {\r
- font-family: sans-serif;\r
- font-size: 11px; \r
-}\r
-\r
-span.link em, div.link span em {\r
- font-style: normal;\r
- font-family: sans-serif;\r
- font-size: 11px; \r
-}\r
-\r
-div.page_header {\r
- height: 25px;\r
- padding: 5px;\r
- font-family: sans-serif;\r
- font-weight: bold;\r
- font-size: 150%;\r
- color: #888;\r
- background: transparent;\r
-}\r
-\r
-div.page_header span { \r
- font-family: inherit;\r
- font-size: inherit; \r
-}\r
-\r
-div.page_header a {\r
- font-size: inherit; \r
- font-family: inherit;\r
- text-decoration: none;\r
-}\r
-\r
-div.page_header a:visited {\r
- color: #000000;\r
-}\r
-\r
-div.page_header a:hover {\r
- color: #E66C2C;\r
- text-decoration: underline;\r
-}\r
-\r
-div.page_footer {\r
- clear: both;\r
- height: 17px;\r
- color: black;\r
- background-color: #ffffff;\r
- padding: 5px;\r
- border-top: 1px solid #bbb;\r
- font-style: italic;\r
-}\r
-\r
-div.page_nav {\r
- color: #ddd;\r
- background-color: #000070;\r
- padding: 7px;\r
- border-radius: 3px;\r
-}\r
-\r
-div.page_nav a {\r
- color: yellow;\r
- text-decoration: none;\r
-}\r
-\r
-div.page_nav a:hover { \r
- text-decoration: underline;\r
-}\r
-\r
-div.page_nav em {\r
- font-style: normal;\r
-}\r
-\r
-div.page_nav2 {\r
- padding: 2px 5px 7px 5px; \r
-}\r
-\r
-div.admin_nav {\r
- border: 1px solid #888;\r
- border-bottom: 0px;\r
- background:#dae0d2;\r
- text-align: right;\r
- padding: 5px 5px 5px 2px; \r
-}\r
-\r
-div.admin_nav a {\r
- text-decoration: none;\r
-}\r
-\r
-div.admin_nav a:hover { \r
- text-decoration: underline;\r
-}\r
-\r
-div.search {\r
- color:yellow;\r
- text-align:right;\r
- float:right;\r
- padding:4px 4px 3px 3px;\r
- border-left: 1px solid #8080f0;\r
- margin: 0px;\r
- height: 23px;\r
-}\r
-\r
-div.search input {\r
- vertical-align: top;\r
- background: url(/com/gitblit/wicket/resources/search-icon.png) no-repeat 4px center;\r
- color: #ddd;\r
- background-color: #000070;\r
- border: 1px solid transparent;\r
- padding: 2px 2px 2px 22px;\r
- margin: 0px;\r
-}\r
-\r
-div.search input:hover, div.search input:focus {\r
- color: white;\r
- border-bottom: 1px solid orange; \r
- outline: none;\r
-}\r
-\r
-div.page_path {\r
- padding: 8px;\r
- font-weight: bold;\r
- border: solid #bbb;\r
- border-width: 0px 0px 1px;\r
-}\r
-\r
-div.commit_message {\r
- font-family: monospace;\r
- padding: 8px;\r
- border: solid #bbb;\r
- border-width: 1px 0px 0px;\r
-}\r
-\r
-div.commit_message a {\r
- font-family: monospace;\r
-}\r
-\r
-div.bug_open, span.bug_open {\r
- padding: 2px;\r
- background-color: #803333;\r
- color: white; \r
- text-align: center;\r
-}\r
-\r
-div.bug_resolved, span.bug_resolved {\r
- padding: 2px;\r
- background-color: #408040;\r
- color: white;\r
- text-align: center;\r
-}\r
-\r
-div.bug_invalid, span.bug_invalid {\r
- padding: 2px;\r
- background-color: gray;\r
- text-align: center;\r
-}\r
-\r
-div.bug_hold, span.bug_hold {\r
- padding: 2px;\r
- background-color: orange;\r
- text-align: center;\r
-}\r
-\r
-div.diff {\r
- font-family: monospace;\r
- overflow: auto;\r
-}\r
-\r
-div.diff.header {\r
- -moz-border-bottom-colors: none;\r
- -moz-border-image: none;\r
- -moz-border-left-colors: none;\r
- -moz-border-right-colors: none;\r
- -moz-border-top-colors: none;\r
- background-color: #EDECE6;\r
- border-color: #D9D8D1;\r
- border-style: solid;\r
- border-width: 1px;\r
- font-weight: bold;\r
- margin-top: 10px;\r
- padding: 4px 0 2px;\r
-}\r
-\r
-div.diff.extended_header {\r
- background-color: #F6F5EE;\r
- padding: 2px 0;\r
- font-family: inherit;\r
-}\r
-\r
-span.diff.add {\r
- color: #008800;\r
- font-family: inherit;\r
-}\r
-\r
-span.diff.remove {\r
- color: #FFDDDD;\r
- font-family: inherit;\r
-}\r
-\r
-span.diff.unchanged {\r
- color: inherit;\r
- font-family: inherit;\r
-}\r
-\r
-div.diff.hunk_header {\r
- -moz-border-bottom-colors: none;\r
- -moz-border-image: none;\r
- -moz-border-left-colors: none;\r
- -moz-border-right-colors: none;\r
- -moz-border-top-colors: none;\r
- border-color: #FFE0FF;\r
- border-style: dotted;\r
- border-width: 1px 0 0;\r
- margin-top: 2px;\r
- font-family: inherit;\r
-}\r
-\r
-span.diff.hunk_info {\r
- background-color: #FFEEFF; \r
- color: #990099;\r
- font-family: inherit;\r
-}\r
-\r
-span.diff.hunk_section { \r
- color: #AA22AA;\r
- font-family: inherit;\r
-}\r
-\r
-div.diff.add2 {\r
- background-color: #DDFFDD;\r
- font-family: inherit;\r
-}\r
-\r
-div.diff.remove2 {\r
- background-color: #FFDDDD;\r
- font-family: inherit;\r
-}\r
-\r
-div.diff table {\r
- border-right: 1px solid #bbb;\r
- border-bottom: 1px solid #bbb;\r
- width: 100%;\r
-}\r
-\r
-div.diff table th, div.diff table td {\r
- margin: 0px;\r
- padding: 0px;\r
- font-family: monospace; \r
-}\r
-\r
-div.diff table th {\r
- background-color: #faf8dc;\r
- border-left: 1px solid #bbb; \r
- text-align: center;\r
- color: #999;\r
- padding-left: 5px;\r
- padding-right: 5px;\r
- width: 30px;\r
-}\r
-\r
-div.diff table th.header {\r
- background-color: #D2C3AF;\r
- border-right: 0px;\r
- border-bottom: 1px solid #808080;\r
- font-family: inherit;\r
- font-size:0.9em;\r
- color: black;\r
- padding: 2px;\r
- text-align: left;\r
-}\r
-\r
-div.diff table td.hunk_header {\r
- background-color: #dAe2e5 !important; \r
- border-bottom: 1px solid #bac2c5;\r
- color: #555;\r
-}\r
-\r
-div.diff table td {\r
- border-left: 1px solid #bbb;\r
- background-color: #fbfbfb;\r
-}\r
-\r
-td.changeType {\r
- width: 15px;\r
-}\r
-\r
-span.addition, span.modification, span.deletion, span.rename {\r
- border: 1px solid #888;\r
- float: left;\r
- height: 0.8em;\r
- margin: 0.2em 0.5em 0 0;\r
- overflow: hidden;\r
- width: 0.8em;\r
-}\r
-\r
-span.addition {\r
- background-color: #ccffcc;\r
-}\r
-\r
-span.modification {\r
- background-color: #ffdd88;\r
-}\r
-\r
-span.deletion {\r
- background-color: #f8bbbb;\r
-}\r
-\r
-span.rename {\r
- background-color: #cAc2f5;\r
-}\r
-\r
-div.commitLegend {\r
- float: right;\r
- padding: 0.4em 0.4em 0.2em 0.4em;\r
- vertical-align:top;\r
- margin: 0px;\r
-}\r
-\r
-div.commitLegend span {\r
- font-size: 0.9em;\r
- vertical-align: top;\r
-}\r
-\r
-div.references {\r
- float: right;\r
- text-align: right;\r
-}\r
-\r
-a.list {\r
- text-decoration: none;\r
- color: #000000;\r
-}\r
-\r
-a.list.subject {\r
- font-weight: bold;\r
-}\r
-\r
-a.list.name {\r
- font-weight: bold; \r
-}\r
-\r
-a.list:hover {\r
- text-decoration: underline;\r
- color: #880000;\r
-}\r
-\r
-table {\r
- border-spacing: 0px;\r
-}\r
-\r
-th {\r
- padding: 2px 5px;\r
- font-size: 100%;\r
- text-align: left;\r
-}\r
-\r
-table.screenshots td {\r
- text-align: center;\r
- padding-bottom: 10px;\r
-}\r
-\r
-table.screenshots img {\r
- border: 1px solid #ccc;\r
- margin: 5px;\r
-}\r
-\r
-table.plain {\r
- padding: 8px;\r
-}\r
-\r
-table.plain td {\r
- white-space: nowrap;\r
-}\r
-\r
-table.plain td.edit { \r
- padding: 3px;\r
-}\r
-\r
-table.plain td.editButton {\r
- padding:0px;\r
- padding-top: 10px;\r
-}\r
-\r
-table.plain td.edit input {\r
- margin: 0px;\r
- outline: 1px solid transparent;\r
- border: 1px solid #ccc; \r
- padding-left:5px;\r
-}\r
-\r
-table.plain td.edit input:focus, table.plain td.edit input:hover{\r
- border: 1px solid orange;\r
-}\r
-\r
-table.pretty, table.comments {\r
- margin-bottom:5px;\r
- border-spacing: 0px;\r
- border-left: 1px solid #bbb;\r
- border-right: 1px solid #bbb; \r
-}\r
-\r
-table.pretty, table.comments, table.repositories, table.gitnotes {\r
- width:100%;\r
-}\r
-\r
-table.pretty td.icon {\r
- padding: 0px 0px 0px 2px; \r
- width: 18px;\r
-}\r
-\r
-table.pretty td.icon img {\r
- vertical-align: top;\r
-}\r
-\r
-table.pretty td {\r
- padding: 2px 4px;\r
-}\r
-\r
-table.comments td {\r
- padding: 4px;\r
- line-height: 17px;\r
-}\r
-\r
-table.repositories {\r
- margin-bottom:5px;\r
- border-spacing: 0px;\r
-}\r
-\r
-table.repositories th {\r
- background-color:#D2C3AF;\r
- padding: 4px;\r
- border-top: 1px solid #808080;\r
- border-bottom: 1px solid #808080;\r
-}\r
-\r
-table.repositories th.left, table.repositories td.left {\r
- border-left: 1px solid #808080;\r
- padding-left: 5px;\r
-}\r
-\r
-table.repositories td.left {\r
- padding-left: 10px;\r
-}\r
-\r
-table.repositories th.right, table.repositories td.right {\r
- border-right: 1px solid #808080;\r
-}\r
-\r
-table.repositories td {\r
- padding: 2px;\r
-}\r
-\r
-table.repositories td.rightAlign { \r
- text-align: right;\r
- border-right: 1px solid #808080;\r
-} \r
-\r
-table.repositories td.icon img {\r
- vertical-align: top;\r
-}\r
-\r
-table.repositories th a {\r
- color:black;/*#ddd;*/\r
- text-decoration: none;\r
- font-weight: normal;\r
-}\r
-\r
-table.repositories th a:hover {\r
- text-decoration: underline;\r
-}\r
-\r
-table.repositories th.wicket_orderDown a, table.repositories th.wicket_orderUp a {\r
- color: black;\r
- font-weight: bold;\r
-}\r
-\r
-table.repositories tr.group {\r
- background-color: #E66C2C;\r
-}\r
-\r
-table.repositories tr.group td {\r
- font-weight: bold; \r
- border-bottom: 1px solid orange;\r
- color: white;\r
- background-color: #E66C2C;\r
- border-left: 1px solid #808080;\r
- border-right: 1px solid #808080;\r
- padding-left: 5px;\r
-}\r
-\r
-table.palette { border:0;}\r
-table.palette td.header { \r
- font-weight: bold; \r
- background-color: #D2C3AF !important;\r
- padding: 3px !important; \r
- border: 1px solid #808080 !important;\r
- border-bottom: 0px solid !important;\r
- border-radius: 3px 3px 0 0;\r
-}\r
-table.palette td.pane {\r
- padding: 0px; \r
-}\r
-\r
-table.gitnotes { \r
- padding-bottom: 5px;\r
-}\r
-table.gitnotes td {\r
- border-top: 1px solid #ccc;\r
- padding-top: 3px;\r
- vertical-align:top;\r
-}\r
-\r
-table.gitnotes td table td {\r
- border: none;\r
- padding-top: 0px;\r
-}\r
-\r
-table.gitnotes td.info {\r
-}\r
-\r
-table.gitnotes td.message {\r
- width: 65%;\r
- border-left: 1px solid #ccc;\r
-}\r
-\r
-table.annotated {\r
- width: 100%;\r
- border: 1px solid #bbb;\r
-}\r
-\r
-table.annotated tr.even {\r
- background-color: white;\r
-}\r
-\r
-table.annotated tr.odd {\r
- background-color: #fdfbdf;\r
-}\r
-\r
-tr th a { padding-right: 15px; background-position: right; background-repeat:no-repeat; }\r
-tr th.wicket_orderDown a {background-image: url(arrow_down.png); }\r
-tr th.wicket_orderUp a { background-image: url(arrow_up.png); }\r
-tr th.wicket_orderNone a { background-image: url(arrow_off.png); }\r
-\r
-tr.light {\r
- background-color: #ffffff;\r
-}\r
-\r
-tr.light td {\r
- border-bottom: 1px solid #bbb; \r
-}\r
-\r
-tr.dark {\r
- background-color: #faf8dc;\r
- border-bottom: 1px solid #bbb; \r
-}\r
-\r
-tr.dark td {\r
- border-bottom: 1px solid #bbb; \r
-}\r
-\r
-/* currently both use the same, but it can change */\r
-tr.light:hover,\r
-tr.dark:hover {\r
- /*background-color: #0099b7;*/\r
- background-color: #000070;\r
- color: white;\r
-}\r
-\r
-tr.light:hover a,\r
-tr.dark:hover a {\r
- color: white; \r
-}\r
-\r
-td {\r
- padding-left: 7px;\r
- padding-right: 7px;\r
-}\r
-\r
-td.author {\r
- font-style: italic;\r
-}\r
-\r
-td.date {\r
- font-style: italic; \r
-}\r
-\r
-span.sha1, span.sha1 a, span.sha1 a span {\r
- font-family: monospace;\r
- font-size: 13px;\r
-}\r
-\r
-td.mode {\r
- text-align: right;\r
- font-family: monospace;\r
- width: 8em;\r
- padding-right:15px;\r
-}\r
-\r
-td.size {\r
- text-align: right;\r
- width: 8em; \r
- padding-right:15px;\r
-}\r
-\r
-td.rightAlign {\r
- text-align: right;\r
-}\r
-\r
-td.treeLinks {\r
- text-align: right;\r
- width: 13em;\r
-}\r
-\r
-span.metricsTitle {\r
- font-size: 2em;\r
-}\r
-\r
-span .tagRef, span .headRef, span .localBranch, span .remoteBranch, span .otherRef { \r
- padding: 0px 3px;\r
- margin-right:2px;\r
- font-family: sans-serif;\r
- font-size: 9px;\r
- font-weight: normal;\r
- border: 1px solid;\r
- color: black; \r
-}\r
-\r
-span .tagRef a span, span .headRef a span, span .localBranch a span, span .remoteBranch a span, span .otherRef a span {\r
- font-size: 9px;\r
-}\r
-\r
-span .tagRef a, span .headRef a, span .localBranch a, span .remoteBranch a, span .otherRef a {\r
- text-decoration: none;\r
- color: black !important;\r
-}\r
-\r
-span .tagRef a:hover, span .headRef a:hover, span .localBranch a:hover, span .remoteBranch a:hover, span .otherRef a:hover {\r
- color: black !important;\r
- text-decoration: underline;\r
-}\r
-\r
-span .otherRef {\r
- background-color: #b0e0f0;\r
- border-color: #80aaaa; \r
-}\r
-\r
-span .remoteBranch {\r
- background-color: #cAc2f5;\r
- border-color: #6c6cbf;\r
-}\r
-\r
-span .tagRef {\r
- background-color: #ffffaa;\r
- border-color: #ffcc00;\r
-}\r
-\r
-span .headRef {\r
- background-color: #ffaaff;\r
- border-color: #ff00ee;\r
-}\r
-\r
-span .localBranch {\r
- background-color: #ccffcc;\r
- border-color: #00cc33;\r
-}\r
-\r
-.feedbackPanelERROR { \r
- color: red;\r
- list-style-image: url(bullet_error.png);\r
- font-weight: bold; \r
- vertical-align: top;\r
- padding:0; \r
- margin:0; \r
-}\r
-\r
-.feedbackPanelINFO {\r
- color: green;\r
- list-style: none;\r
- font-weight: bold; \r
- padding:0;\r
- margin:0;\r
-}\r
-\r
-/* google-code-prettify line numbers */\r
-li.L0,\r
-li.L1,\r
-li.L2,\r
-li.L3,\r
-li.L4,\r
-li.L5,\r
-li.L6,\r
-li.L7,\r
-li.L8,\r
-li.L9 { color: #888; border-left: 1px solid #ccc; padding-left:5px; list-style-type: decimal !important; }\r
-\r
-/* Alternate shading for lines */\r
-li.L1,\r
-li.L3,\r
-li.L5,\r
-li.L7,\r
-li.L9 { background: #fafafa !important; }
\ No newline at end of file
+++ /dev/null
-/*\r
- * Git:Blit Markdown CSS definition.\r
- */\r
-\r
-div.markdown {\r
- line-height: 1.4em;\r
-}\r
-\r
-div.markdown h1,\r
-div.markdown h2, \r
-div.markdown h3, \r
-div.markdown h4, \r
-div.markdown h5, \r
-div.markdown h6 {\r
- border: 0 none !important;\r
-}\r
-\r
-div.markdown h1 { \r
- margin-top: 1em;\r
- margin-bottom: 0.5em;\r
- padding-bottom: 0.5em;\r
- border-bottom: 2px solid #000080 !important;\r
-}\r
-\r
-div.markdown h2 {\r
- margin-top: 1em;\r
- margin-bottom: 0.5em; \r
- padding-bottom: 0.5em;\r
- border-bottom: 2px solid #000080 !important; \r
-}\r
-\r
-div.markdown pre {\r
- background-color: #f8f8f8; \r
- border: 1px solid #2f6fab;\r
- border-radius: 3px;\r
- overflow: auto;\r
- padding: 5px;\r
-}\r
-\r
-div.markdown pre code {\r
- background-color: inherit;\r
- border: none; \r
- padding: 0;\r
-}\r
-\r
-div.markdown code {\r
- background-color: #ffffe0;\r
- border: 1px solid orange;\r
- border-radius: 3px;\r
- padding: 0 0.2em;\r
-}\r
-\r
-div.markdown a {\r
- text-decoration: underline; \r
-}\r
-\r
-div.markdown ul, div.markdown ol {\r
- padding-left: 30px;\r
-}\r
-\r
-div.markdown li {\r
- margin: 0.2em 0 0 0em; padding: 0px;\r
-}\r
-\r
-div.markdown em {\r
- color: #b05000;\r
-}
\ No newline at end of file
+++ /dev/null
-## Welcome to Gitblit\r
-\r
-A quick and easy way to host or view your own [Git](http://www.git-scm.com) repositories.\r
-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