From: James Moger Date: Sat, 18 Jun 2011 12:28:47 +0000 (-0400) Subject: Mostly stable war build. X-Git-Tag: v0.5.0~10 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5450d08e4cd11176bcc50a5b3d001d291bd8982c;p=gitblit.git Mostly stable war build. Reorganization of resources. Dropped most hard-coded webapp configuration in favor of common web.xml file. Still contemplating configuring git servlet from web.xml too. --- diff --git a/.gitignore b/.gitignore index 1819e8ea..7cc5c3bc 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ /git /target /build.properties +/war +/*.war diff --git a/build.xml b/build.xml index ddb0dfbf..ee01de7d 100644 --- a/build.xml +++ b/build.xml @@ -5,17 +5,16 @@ + - - - - + + - + @@ -30,7 +29,7 @@ - + @@ -46,6 +45,13 @@ Building Gitblit ${gb.version} + + + + + + + @@ -62,8 +68,9 @@ + - + @@ -87,6 +94,9 @@ + + + @@ -97,7 +107,7 @@ - + @@ -211,7 +221,7 @@ - + @@ -284,8 +294,7 @@ - - + @@ -306,6 +315,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -318,11 +388,5 @@ - - - - - - - + \ No newline at end of file diff --git a/distrib/gitblit.properties b/distrib/gitblit.properties index 2d55a584..6adf11e5 100644 --- a/distrib/gitblit.properties +++ b/distrib/gitblit.properties @@ -2,8 +2,7 @@ # Git Servlet Settings # -# Allow push/pull over http/https with JGit servlet -# Changing this value requires a server restart. +# Allow push/pull over http/https with JGit servlet. git.enableGitServlet = true # Base folder for repositories @@ -12,11 +11,6 @@ git.enableGitServlet = true # e.g. c:/gitrepos git.repositoriesFolder = git -# Export all repositories -# Changing this value requires a server restart. -# if false, each exported repository must have a .git/git-daemon-export-ok file -git.exportAll = true - # Search the repositories folder subfolders for other repositories. # Repositories MAY NOT be nested (i.e. one repository within another) # but they may be grouped together in subfolders. @@ -36,7 +30,9 @@ web.authenticateViewPages = false # Changing this value requires a server restart. web.authenticateAdminPages = true -# Simple user realm file to authenticate users +# Either a simple user realm file to authenticate users +# OR a fully qualified class name that implements the ILoginService interface. +# Any custom implementation must have a public default constructor. # Changing this value requires a server restart. realm.realmFile = users.properties @@ -154,11 +150,11 @@ regex.global = true # Example global regex substitutions # Use !!! to separate the search pattern and the replace pattern # searchpattern!!!replacepattern -#regex.global.bug = \\b(Bug:)(\\s*[#]?|-){0,1}(\\d+)\\b!!!Bug-Id: $3 -#regex.global.changeid = \\b(Change-Id:\\s*)([A-Za-z0-9]*)\\b!!!Change-Id: $2 +regex.global.bug = \\b(Bug:)(\\s*[#]?|-){0,1}(\\d+)\\b!!!Bug-Id: $3 +regex.global.changeid = \\b(Change-Id:\\s*)([A-Za-z0-9]*)\\b!!!Change-Id: $2 # Example per-repository regex substitutions overrides global -#regex.myrepository.bug = \\b(Bug:)(\\s*[#]?|-){0,1}(\\d+)\\b!!!Bug-Id: $3 +regex.myrepository.bug = \\b(Bug:)(\\s*[#]?|-){0,1}(\\d+)\\b!!!Bug-Id: $3 # # Server Settings @@ -168,19 +164,6 @@ regex.global = true # The temporary folder to decompress the gitblit webapp. server.tempFolder = temp -# The common log4j logging pattern -# http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html -server.log4jPattern = %-5p %d{MM-dd HH:mm:ss.SSS} %-20.20c{1} %m%n - -# Alternatively, you may specify a logging pattern for your OS. -# If the os pattern is blank, the common pattern is used. - -# This windows pattern fits (mostly) within the fixed bounds of a command prompt. -server.log4jPattern.windows = %-5p %m%n - -server.log4jPattern.linux = - - # # Jetty Settings # diff --git a/docs/00_index.mkd b/docs/00_index.mkd index bcf41e11..7a2bc569 100644 --- a/docs/00_index.mkd +++ b/docs/00_index.mkd @@ -4,7 +4,7 @@ Its designed primarily as a tool for small workgroups who want to host [Git][git ### Current Release -[%VERSION%](http://gitblit.com/%DISTRIBUTION%) based on [%JGIT%][jgit]   (*%BUILDDATE%*) +%VERSION% ([go](http://gitblit.com/%GO%)|[war](http://gitblit.com/%WAR%)) based on [%JGIT%][jgit]   (*%BUILDDATE%*) sources @ [Github][gitbltsrc] @@ -13,8 +13,7 @@ sources @ [Github][gitbltsrc] 2. Offer useful features for serving Git repositories. If feature is complex, refer to #1. 3. All dependencies must be retrievable from a publicly accessible [Maven](http://maven.apache.org) repository.
This is to ensure authenticity of dependencies and to keep the Gitblit distribution svelte. -### Features -- Out-of-the-box integrated stack requiring minimal configuration +### Gitblit Features - JGit SmartHTTP servlet - Browser and git client authentication - Four repository access control configurations and a Read-Only flag @@ -29,7 +28,6 @@ sources @ [Github][gitbltsrc] - Administrators may create, edit, rename, or delete repositories through the web UI - Administrators may create, edit, rename, or delete users through the web UI - Repository Owners may edit repositories through the web UI -- Automatically generates a self-signed certificate for https communications - Git-notes support - Branch metrics (uses Google Charts) - HEAD and branch RSS feeds @@ -41,7 +39,6 @@ sources @ [Github][gitbltsrc] - Markdown file view support - Syntax highlighting for popular source code types - Customizable regular expression substitution for commit messages (i.e. bug or code review link integration) -- Single text file for server configuration - Single text file for users configuration - Optional utility pages
    @@ -49,12 +46,15 @@ sources @ [Github][gitbltsrc]
  • ![tickets](bug_16x16.png) Ticgit ticket pages *(based on last MIT release bf57b032 2009-01-27)*
+### Gitblit-Go Features +- Out-of-the-box integrated stack requiring minimal configuration +- Automatically generates a self-signed certificate for https communications +- Single text file for server configuration + ### Limitations -- [%JGIT%][jgit] does not currently [garbage collect or repack](http://www.kernel.org/pub/software/scm/git/docs/git-gc.html) - HTTP/HTTPS are the only supported protocols - Access controls are not path-based, they are repository-based - Only Administrators can create, rename or delete repositories -- Gitblit is an integrated, full-stack solution. There is no WAR build at this time. ### Caveats - Gitblit may eat your data. Use at your own risk. @@ -64,7 +64,6 @@ sources @ [Github][gitbltsrc] - Code documentation - Unit testing - Update Build.java to JGit 1.0.0, when its released -- WAR solution ### Idea List - Consider clone remote repository feature @@ -90,7 +89,7 @@ Gitblit is distributed under the terms of the [Apache Software Foundation licens ![block diagram](architecture.png "Gitblit Architecture") ### Bundled Dependencies -The following dependencies are bundled with the Gitblit zip distribution file. +The following dependencies are bundled with Gitblit. - [google-code-prettify](http://code.google.com/p/google-code-prettify) (Apache 2.0) - [JavaService](http://forge.ow2.org/projects/javaservice) (BSD and LGPL) @@ -99,7 +98,7 @@ The following dependencies are bundled with the Gitblit zip distribution file. - other icons courtesy of [FatCow Hosting](http://www.fatcow.com/free-icons) (Creative Commons CC-BY) ### Downloaded Dependencies -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. +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. - [JGit][jgit] (EDL 1.0) - [Wicket](http://wicket.apache.org) (Apache 2.0) diff --git a/docs/00_setup.mkd b/docs/00_setup.mkd index ccf38b83..02816e7f 100644 --- a/docs/00_setup.mkd +++ b/docs/00_setup.mkd @@ -1,6 +1,6 @@ -## Server Setup and Configuration +## Gitblit-Go Setup and Configuration -1. Download and unzip [Gitblit %VERSION%](http://gitblit.com/%DISTRIBUTION%).
+1. Download and unzip [Gitblit-Go %VERSION%](http://gitblit.com/%GO%).
*Its best to eliminate spaces in the path name as that can cause troubleshooting headaches.* 2. The server itself is configured through a simple text file.
Open `gitblit.properties` in your favorite text editor and make sure to review and set: diff --git a/docs/01_faq.mkd b/docs/01_faq.mkd index 3605387a..552c89d2 100644 --- a/docs/01_faq.mkd +++ b/docs/01_faq.mkd @@ -12,10 +12,10 @@ There are a few ways this can occur: 3. The repository is clone-restricted and your password changed. 4. A regression in Gitblit. :( -### Why can't I access Gitblit from another machine? +### Why can't I access Gitblit-Go from another machine? Please check *server.httpBindInterface* and *server.httpsBindInterface* in `gitblit.properties`. -### How do I run Gitblit on port 80 or 443 in Linux? +### How do I run Gitblit-Go on port 80 or 443 in Linux? Linux requires root permissions to serve on ports < 1024.
Run the server as *root* (security concern) or change the ports you are serving to 8080 (http) and/or 8443 (https). @@ -47,22 +47,12 @@ Gitblit eliminates all that complication with its 100% Java stack and simple sin No. Gitblit is based on [JGit][jgit] which is a pure Java implementation of the [Git version control system][git].
Everything you need for Gitblit is either in the zip distribution file or automatically downloaded on execution. -### What about periodic Git garbage collection (git-gc)? -Good question. I'm not sure. - -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)).) - -[JGit's][jgit] documentation is sparse and its unclear whether or not JGit performs this function. - ### Can I run Gitblit in conjunction with my existing Git tooling? -Yes. You can configure Gitblit to only be a repository viewer. +Yes. ### Do I need a JDK or can I use a JRE? 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. -### I want to deploy Gitblit into my own servlet container. Where is the WAR? -At this time there is no WAR build available. - ### Does Gitblit use a database to store its data? 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`. @@ -76,6 +66,9 @@ No. Access restrictions apply to the repository as a whole. 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). +### Can I authenticate users against XYZ? +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. + ### Why doesn't Gitblit support SSH? 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).
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. diff --git a/resources/add_16x16.png b/resources/add_16x16.png new file mode 100644 index 00000000..0ea124a7 Binary files /dev/null and b/resources/add_16x16.png differ diff --git a/resources/arrow_down.png b/resources/arrow_down.png new file mode 100644 index 00000000..f31cc819 Binary files /dev/null and b/resources/arrow_down.png differ diff --git a/resources/arrow_off.png b/resources/arrow_off.png new file mode 100644 index 00000000..f9b1ced2 Binary files /dev/null and b/resources/arrow_off.png differ diff --git a/resources/arrow_up.png b/resources/arrow_up.png new file mode 100644 index 00000000..63031c33 Binary files /dev/null and b/resources/arrow_up.png differ diff --git a/resources/background.png b/resources/background.png new file mode 100644 index 00000000..6f75e43d Binary files /dev/null and b/resources/background.png differ diff --git a/resources/blank.png b/resources/blank.png new file mode 100644 index 00000000..109296b9 Binary files /dev/null and b/resources/blank.png differ diff --git a/resources/book_16x16.png b/resources/book_16x16.png new file mode 100644 index 00000000..e48ff95e Binary files /dev/null and b/resources/book_16x16.png differ diff --git a/resources/bug_16x16.png b/resources/bug_16x16.png new file mode 100644 index 00000000..c7299fd7 Binary files /dev/null and b/resources/bug_16x16.png differ diff --git a/resources/bullet_error.png b/resources/bullet_error.png new file mode 100644 index 00000000..b2e6b752 Binary files /dev/null and b/resources/bullet_error.png differ diff --git a/resources/cold_16x16.png b/resources/cold_16x16.png new file mode 100644 index 00000000..79cb7567 Binary files /dev/null and b/resources/cold_16x16.png differ diff --git a/resources/commit_branch_16x16.png b/resources/commit_branch_16x16.png new file mode 100644 index 00000000..d1fe7175 Binary files /dev/null and b/resources/commit_branch_16x16.png differ diff --git a/resources/commit_divide_16x16.png b/resources/commit_divide_16x16.png new file mode 100644 index 00000000..e611bd57 Binary files /dev/null and b/resources/commit_divide_16x16.png differ diff --git a/resources/commit_join_16x16.png b/resources/commit_join_16x16.png new file mode 100644 index 00000000..51e7de97 Binary files /dev/null and b/resources/commit_join_16x16.png differ diff --git a/resources/commit_merge_16x16.png b/resources/commit_merge_16x16.png new file mode 100644 index 00000000..5a066e59 Binary files /dev/null and b/resources/commit_merge_16x16.png differ diff --git a/resources/commit_up_16x16.png b/resources/commit_up_16x16.png new file mode 100644 index 00000000..30d005f2 Binary files /dev/null and b/resources/commit_up_16x16.png differ diff --git a/resources/feed_16x16.png b/resources/feed_16x16.png new file mode 100644 index 00000000..99987a30 Binary files /dev/null and b/resources/feed_16x16.png differ diff --git a/resources/file_16x16.png b/resources/file_16x16.png new file mode 100644 index 00000000..eda44886 Binary files /dev/null and b/resources/file_16x16.png differ diff --git a/resources/file_acrobat_16x16.png b/resources/file_acrobat_16x16.png new file mode 100644 index 00000000..f1627837 Binary files /dev/null and b/resources/file_acrobat_16x16.png differ diff --git a/resources/file_c_16x16.png b/resources/file_c_16x16.png new file mode 100644 index 00000000..44045a9b Binary files /dev/null and b/resources/file_c_16x16.png differ diff --git a/resources/file_code_16x16.png b/resources/file_code_16x16.png new file mode 100644 index 00000000..931b0d6a Binary files /dev/null and b/resources/file_code_16x16.png differ diff --git a/resources/file_cpp_16x16.png b/resources/file_cpp_16x16.png new file mode 100644 index 00000000..d3f55ee0 Binary files /dev/null and b/resources/file_cpp_16x16.png differ diff --git a/resources/file_cs_16x16.png b/resources/file_cs_16x16.png new file mode 100644 index 00000000..80130209 Binary files /dev/null and b/resources/file_cs_16x16.png differ diff --git a/resources/file_doc_16x16.png b/resources/file_doc_16x16.png new file mode 100644 index 00000000..225c3b09 Binary files /dev/null and b/resources/file_doc_16x16.png differ diff --git a/resources/file_excel_16x16.png b/resources/file_excel_16x16.png new file mode 100644 index 00000000..04e03327 Binary files /dev/null and b/resources/file_excel_16x16.png differ diff --git a/resources/file_h_16x16.png b/resources/file_h_16x16.png new file mode 100644 index 00000000..3f7f5394 Binary files /dev/null and b/resources/file_h_16x16.png differ diff --git a/resources/file_java_16x16.png b/resources/file_java_16x16.png new file mode 100644 index 00000000..16620e5c Binary files /dev/null and b/resources/file_java_16x16.png differ diff --git a/resources/file_php_16x16.png b/resources/file_php_16x16.png new file mode 100644 index 00000000..4ac56183 Binary files /dev/null and b/resources/file_php_16x16.png differ diff --git a/resources/file_ppt_16x16.png b/resources/file_ppt_16x16.png new file mode 100644 index 00000000..44bbf26f Binary files /dev/null and b/resources/file_ppt_16x16.png differ diff --git a/resources/file_ruby_16x16.png b/resources/file_ruby_16x16.png new file mode 100644 index 00000000..f29349da Binary files /dev/null and b/resources/file_ruby_16x16.png differ diff --git a/resources/file_settings_16x16.png b/resources/file_settings_16x16.png new file mode 100644 index 00000000..92953fec Binary files /dev/null and b/resources/file_settings_16x16.png differ diff --git a/resources/file_vs_16x16.png b/resources/file_vs_16x16.png new file mode 100644 index 00000000..645fa7a0 Binary files /dev/null and b/resources/file_vs_16x16.png differ diff --git a/resources/file_world_16x16.png b/resources/file_world_16x16.png new file mode 100644 index 00000000..0a4fa8be Binary files /dev/null and b/resources/file_world_16x16.png differ diff --git a/resources/file_zip_16x16.png b/resources/file_zip_16x16.png new file mode 100644 index 00000000..15845924 Binary files /dev/null and b/resources/file_zip_16x16.png differ diff --git a/resources/folder_16x16.png b/resources/folder_16x16.png new file mode 100644 index 00000000..f1ed9abe Binary files /dev/null and b/resources/folder_16x16.png differ diff --git a/resources/gitblit.css b/resources/gitblit.css new file mode 100644 index 00000000..29474188 --- /dev/null +++ b/resources/gitblit.css @@ -0,0 +1,819 @@ +/* + Git:Blit css. +*/ +html, body, table, dl, dt, dd, ol, ul, li, form, a, span, tr, th, td, div, em { + font-family: verdana, sans-serif; + font-size: 12px; + line-height: 1.35em; + margin: 0; + padding: 0; + border: 0; + outline: 0; +} + +body { + width: 980px; + margin: 5px; + background-color: #ffffff; + color: #000000; + margin-right: auto; + margin-left: auto; + padding: 0px; + background: url(background.png) repeat-x scroll 0 0 #FFFFFF; +} + +pre, code, pre.prettyprint, pre.plainprint { + color: black; + font-family: monospace; + font-size:12px; + border:0px; +} + +pre.prettyprint ol { + padding-left:25px; +} + +/* age0: age < 60*60*2 */ +.age0 { + color: #008000; + font-style: italic; + font-weight: bold; +} + +/* age1: 60*60*2 <= age < 60*60*24*2 */ +.age1 { + color: #008000; + font-style: italic; +} + +/* age2: 60*60*24*2 <= age */ +.age2 { + font-style: italic; +} + +img.inlineIcon { + padding-left: 1px; + padding-right: 1px; +} + +a { + color: #0000cc; +} + +a:hover, a:visited, a:active { + color: #880000; +} + +img.logo { + float: right; + border-width: 0px; +} + +img.activityGraph { + float: right; + border-width: 0px; + padding: 8px; +} + +div.repositories_message { + line-height: inherit; +} + +div.header, div.commitHeader { + background-color: #D2C3AF; + padding: 3px; + border: 1px solid #808080; +} + +div.header { + border-radius: 3px 3px 0 0; +} + +div.commitHeader { + border-radius: 3px; +} + +div.header a, div.commitHeader a { + color: black; + text-decoration: none; + font-weight: bold; +} + +div.header a:hover, div.commitHeader a:hover { + text-decoration: underline; +} + +div.pager { + padding: 0px 0px 15px 5px; +} + +span.empty { + font-size: 0.9em; + font-style: italic; + padding-left:10px; + color: #008000; +} + +span.link { + color: #888; +} + +span.link, span.link a { + font-family: sans-serif; + font-size: 11px; +} + +span.link em, div.link span em { + font-style: normal; + font-family: sans-serif; + font-size: 11px; +} + +div.page_header { + height: 25px; + padding: 5px; + font-family: sans-serif; + font-weight: bold; + font-size: 150%; + color: #888; + background: transparent; +} + +div.page_header span { + font-family: inherit; + font-size: inherit; +} + +div.page_header a { + font-size: inherit; + font-family: inherit; + text-decoration: none; +} + +div.page_header a:visited { + color: #000000; +} + +div.page_header a:hover { + color: #E66C2C; + text-decoration: underline; +} + +div.page_footer { + clear: both; + height: 17px; + color: black; + background-color: #ffffff; + padding: 5px; + border-top: 1px solid #bbb; + font-style: italic; +} + +div.page_nav { + color: #ddd; + background-color: #000070; + padding: 7px; + border-radius: 3px; +} + +div.page_nav a { + color: yellow; + text-decoration: none; +} + +div.page_nav a:hover { + text-decoration: underline; +} + +div.page_nav em { + font-style: normal; +} + +div.page_nav2 { + padding: 2px 5px 7px 5px; +} + +div.admin_nav { + border: 1px solid #888; + border-bottom: 0px; + background:#dae0d2; + text-align: right; + padding: 5px 5px 5px 2px; +} + +div.admin_nav a { + text-decoration: none; +} + +div.admin_nav a:hover { + text-decoration: underline; +} + +div.search { + color:yellow; + text-align:right; + float:right; + padding:4px 4px 3px 3px; + border-left: 1px solid #8080f0; + margin: 0px; + height: 23px; +} + +div.search input { + vertical-align: top; + background: url(search-icon.png) no-repeat 4px center; + color: #ddd; + background-color: #000070; + border: 1px solid transparent; + padding: 2px 2px 2px 22px; + margin: 0px; +} + +div.search input:hover, div.search input:focus { + color: white; + border-bottom: 1px solid orange; + outline: none; +} + +div.page_path { + padding: 8px; + font-weight: bold; + border: solid #bbb; + border-width: 0px 0px 1px; +} + +div.commit_message { + font-family: monospace; + padding: 8px; + border: solid #bbb; + border-width: 1px 0px 0px; +} + +div.commit_message a { + font-family: monospace; +} + +div.bug_open, span.bug_open { + padding: 2px; + background-color: #803333; + color: white; + text-align: center; +} + +div.bug_resolved, span.bug_resolved { + padding: 2px; + background-color: #408040; + color: white; + text-align: center; +} + +div.bug_invalid, span.bug_invalid { + padding: 2px; + background-color: gray; + text-align: center; +} + +div.bug_hold, span.bug_hold { + padding: 2px; + background-color: orange; + text-align: center; +} + +div.diff { + font-family: monospace; + overflow: auto; +} + +div.diff.header { + -moz-border-bottom-colors: none; + -moz-border-image: none; + -moz-border-left-colors: none; + -moz-border-right-colors: none; + -moz-border-top-colors: none; + background-color: #EDECE6; + border-color: #D9D8D1; + border-style: solid; + border-width: 1px; + font-weight: bold; + margin-top: 10px; + padding: 4px 0 2px; +} + +div.diff.extended_header { + background-color: #F6F5EE; + padding: 2px 0; + font-family: inherit; +} + +span.diff.add { + color: #008800; + font-family: inherit; +} + +span.diff.remove { + color: #FFDDDD; + font-family: inherit; +} + +span.diff.unchanged { + color: inherit; + font-family: inherit; +} + +div.diff.hunk_header { + -moz-border-bottom-colors: none; + -moz-border-image: none; + -moz-border-left-colors: none; + -moz-border-right-colors: none; + -moz-border-top-colors: none; + border-color: #FFE0FF; + border-style: dotted; + border-width: 1px 0 0; + margin-top: 2px; + font-family: inherit; +} + +span.diff.hunk_info { + background-color: #FFEEFF; + color: #990099; + font-family: inherit; +} + +span.diff.hunk_section { + color: #AA22AA; + font-family: inherit; +} + +div.diff.add2 { + background-color: #DDFFDD; + font-family: inherit; +} + +div.diff.remove2 { + background-color: #FFDDDD; + font-family: inherit; +} + +div.diff table { + border-right: 1px solid #bbb; + border-bottom: 1px solid #bbb; + width: 100%; +} + +div.diff table th, div.diff table td { + margin: 0px; + padding: 0px; + font-family: monospace; +} + +div.diff table th { + background-color: #faf8dc; + border-left: 1px solid #bbb; + text-align: center; + color: #999; + padding-left: 5px; + padding-right: 5px; + width: 30px; +} + +div.diff table th.header { + background-color: #D2C3AF; + border-right: 0px; + border-bottom: 1px solid #808080; + font-family: inherit; + font-size:0.9em; + color: black; + padding: 2px; + text-align: left; +} + +div.diff table td.hunk_header { + background-color: #dAe2e5 !important; + border-bottom: 1px solid #bac2c5; + color: #555; +} + +div.diff table td { + border-left: 1px solid #bbb; + background-color: #fbfbfb; +} + +td.changeType { + width: 15px; +} + +span.addition, span.modification, span.deletion, span.rename { + border: 1px solid #888; + float: left; + height: 0.8em; + margin: 0.2em 0.5em 0 0; + overflow: hidden; + width: 0.8em; +} + +span.addition { + background-color: #ccffcc; +} + +span.modification { + background-color: #ffdd88; +} + +span.deletion { + background-color: #f8bbbb; +} + +span.rename { + background-color: #cAc2f5; +} + +div.commitLegend { + float: right; + padding: 0.4em 0.4em 0.2em 0.4em; + vertical-align:top; + margin: 0px; +} + +div.commitLegend span { + font-size: 0.9em; + vertical-align: top; +} + +div.references { + float: right; + text-align: right; +} + +a.list { + text-decoration: none; + color: #000000; +} + +a.list.subject { + font-weight: bold; +} + +a.list.name { + font-weight: bold; +} + +a.list:hover { + text-decoration: underline; + color: #880000; +} + +table { + border-spacing: 0px; +} + +th { + padding: 2px 5px; + font-size: 100%; + text-align: left; +} + +table.screenshots td { + text-align: center; + padding-bottom: 10px; +} + +table.screenshots img { + border: 1px solid #ccc; + margin: 5px; +} + +table.plain { + padding: 8px; +} + +table.plain td { + white-space: nowrap; +} + +table.plain td.edit { + padding: 3px; +} + +table.plain td.editButton { + padding:0px; + padding-top: 10px; +} + +table.plain td.edit input { + margin: 0px; + outline: 1px solid transparent; + border: 1px solid #ccc; + padding-left:5px; +} + +table.plain td.edit input:focus, table.plain td.edit input:hover{ + border: 1px solid orange; +} + +table.pretty, table.comments { + margin-bottom:5px; + border-spacing: 0px; + border-left: 1px solid #bbb; + border-right: 1px solid #bbb; +} + +table.pretty, table.comments, table.repositories, table.gitnotes { + width:100%; +} + +table.pretty td.icon { + padding: 0px 0px 0px 2px; + width: 18px; +} + +table.pretty td.icon img { + vertical-align: top; +} + +table.pretty td { + padding: 2px 4px; +} + +table.comments td { + padding: 4px; + line-height: 17px; +} + +table.repositories { + margin-bottom:5px; + border-spacing: 0px; +} + +table.repositories th { + background-color:#D2C3AF; + padding: 4px; + border-top: 1px solid #808080; + border-bottom: 1px solid #808080; +} + +table.repositories th.left, table.repositories td.left { + border-left: 1px solid #808080; + padding-left: 5px; +} + +table.repositories td.left { + padding-left: 10px; +} + +table.repositories th.right, table.repositories td.right { + border-right: 1px solid #808080; +} + +table.repositories td { + padding: 2px; +} + +table.repositories td.rightAlign { + text-align: right; + border-right: 1px solid #808080; +} + +table.repositories td.icon img { + vertical-align: top; +} + +table.repositories th a { + color:black;/*#ddd;*/ + text-decoration: none; + font-weight: normal; +} + +table.repositories th a:hover { + text-decoration: underline; +} + +table.repositories th.wicket_orderDown a, table.repositories th.wicket_orderUp a { + color: black; + font-weight: bold; +} + +table.repositories tr.group { + background-color: #E66C2C; +} + +table.repositories tr.group td { + font-weight: bold; + border-bottom: 1px solid orange; + color: white; + background-color: #E66C2C; + border-left: 1px solid #808080; + border-right: 1px solid #808080; + padding-left: 5px; +} + +table.palette { border:0;} +table.palette td.header { + font-weight: bold; + background-color: #D2C3AF !important; + padding: 3px !important; + border: 1px solid #808080 !important; + border-bottom: 0px solid !important; + border-radius: 3px 3px 0 0; +} +table.palette td.pane { + padding: 0px; +} + +table.gitnotes { + padding-bottom: 5px; +} +table.gitnotes td { + border-top: 1px solid #ccc; + padding-top: 3px; + vertical-align:top; +} + +table.gitnotes td table td { + border: none; + padding-top: 0px; +} + +table.gitnotes td.info { +} + +table.gitnotes td.message { + width: 65%; + border-left: 1px solid #ccc; +} + +table.annotated { + width: 100%; + border: 1px solid #bbb; +} + +table.annotated tr.even { + background-color: white; +} + +table.annotated tr.odd { + background-color: #fdfbdf; +} + +tr th a { padding-right: 15px; background-position: right; background-repeat:no-repeat; } +tr th.wicket_orderDown a {background-image: url(arrow_down.png); } +tr th.wicket_orderUp a { background-image: url(arrow_up.png); } +tr th.wicket_orderNone a { background-image: url(arrow_off.png); } + +tr.light { + background-color: #ffffff; +} + +tr.light td { + border-bottom: 1px solid #bbb; +} + +tr.dark { + background-color: #faf8dc; + border-bottom: 1px solid #bbb; +} + +tr.dark td { + border-bottom: 1px solid #bbb; +} + +/* currently both use the same, but it can change */ +tr.light:hover, +tr.dark:hover { + /*background-color: #0099b7;*/ + background-color: #000070; + color: white; +} + +tr.light:hover a, +tr.dark:hover a { + color: white; +} + +td { + padding-left: 7px; + padding-right: 7px; +} + +td.author { + font-style: italic; +} + +td.date { + font-style: italic; +} + +span.sha1, span.sha1 a, span.sha1 a span { + font-family: monospace; + font-size: 13px; +} + +td.mode { + text-align: right; + font-family: monospace; + width: 8em; + padding-right:15px; +} + +td.size { + text-align: right; + width: 8em; + padding-right:15px; +} + +td.rightAlign { + text-align: right; +} + +td.treeLinks { + text-align: right; + width: 13em; +} + +span.metricsTitle { + font-size: 2em; +} + +span .tagRef, span .headRef, span .localBranch, span .remoteBranch, span .otherRef { + padding: 0px 3px; + margin-right:2px; + font-family: sans-serif; + font-size: 9px; + font-weight: normal; + border: 1px solid; + color: black; +} + +span .tagRef a span, span .headRef a span, span .localBranch a span, span .remoteBranch a span, span .otherRef a span { + font-size: 9px; +} + +span .tagRef a, span .headRef a, span .localBranch a, span .remoteBranch a, span .otherRef a { + text-decoration: none; + color: black !important; +} + +span .tagRef a:hover, span .headRef a:hover, span .localBranch a:hover, span .remoteBranch a:hover, span .otherRef a:hover { + color: black !important; + text-decoration: underline; +} + +span .otherRef { + background-color: #b0e0f0; + border-color: #80aaaa; +} + +span .remoteBranch { + background-color: #cAc2f5; + border-color: #6c6cbf; +} + +span .tagRef { + background-color: #ffffaa; + border-color: #ffcc00; +} + +span .headRef { + background-color: #ffaaff; + border-color: #ff00ee; +} + +span .localBranch { + background-color: #ccffcc; + border-color: #00cc33; +} + +.feedbackPanelERROR { + color: red; + list-style-image: url(bullet_error.png); + font-weight: bold; + vertical-align: top; + padding:0; + margin:0; +} + +.feedbackPanelINFO { + color: green; + list-style: none; + font-weight: bold; + padding:0; + margin:0; +} + +/* google-code-prettify line numbers */ +li.L0, +li.L1, +li.L2, +li.L3, +li.L4, +li.L5, +li.L6, +li.L7, +li.L8, +li.L9 { color: #888; border-left: 1px solid #ccc; padding-left:5px; list-style-type: decimal !important; } + +/* Alternate shading for lines */ +li.L1, +li.L3, +li.L5, +li.L7, +li.L9 { background: #fafafa !important; } \ No newline at end of file diff --git a/resources/gitblt-favicon.png b/resources/gitblt-favicon.png new file mode 100644 index 00000000..c3c6dc1b Binary files /dev/null and b/resources/gitblt-favicon.png differ diff --git a/resources/gitblt-logo.png b/resources/gitblt-logo.png new file mode 100644 index 00000000..7ec945b5 Binary files /dev/null and b/resources/gitblt-logo.png differ diff --git a/resources/gitblt2.png b/resources/gitblt2.png new file mode 100644 index 00000000..c1642941 Binary files /dev/null and b/resources/gitblt2.png differ diff --git a/resources/gitblt_25.png b/resources/gitblt_25.png new file mode 100644 index 00000000..ad580fad Binary files /dev/null and b/resources/gitblt_25.png differ diff --git a/resources/gitweb-favicon.png b/resources/gitweb-favicon.png new file mode 100644 index 00000000..de637c06 Binary files /dev/null and b/resources/gitweb-favicon.png differ diff --git a/resources/lock_16x16.png b/resources/lock_16x16.png new file mode 100644 index 00000000..ddf83d95 Binary files /dev/null and b/resources/lock_16x16.png differ diff --git a/resources/lock_go_16x16.png b/resources/lock_go_16x16.png new file mode 100644 index 00000000..63d42859 Binary files /dev/null and b/resources/lock_go_16x16.png differ diff --git a/resources/lock_pull_16x16.png b/resources/lock_pull_16x16.png new file mode 100644 index 00000000..85c5c53e Binary files /dev/null and b/resources/lock_pull_16x16.png differ diff --git a/resources/markdown.css b/resources/markdown.css new file mode 100644 index 00000000..41bc4392 --- /dev/null +++ b/resources/markdown.css @@ -0,0 +1,67 @@ +/* + * Git:Blit Markdown CSS definition. + */ + +div.markdown { + line-height: 1.4em; +} + +div.markdown h1, +div.markdown h2, +div.markdown h3, +div.markdown h4, +div.markdown h5, +div.markdown h6 { + border: 0 none !important; +} + +div.markdown h1 { + margin-top: 1em; + margin-bottom: 0.5em; + padding-bottom: 0.5em; + border-bottom: 2px solid #000080 !important; +} + +div.markdown h2 { + margin-top: 1em; + margin-bottom: 0.5em; + padding-bottom: 0.5em; + border-bottom: 2px solid #000080 !important; +} + +div.markdown pre { + background-color: #f8f8f8; + border: 1px solid #2f6fab; + border-radius: 3px; + overflow: auto; + padding: 5px; +} + +div.markdown pre code { + background-color: inherit; + border: none; + padding: 0; +} + +div.markdown code { + background-color: #ffffe0; + border: 1px solid orange; + border-radius: 3px; + padding: 0 0.2em; +} + +div.markdown a { + text-decoration: underline; +} + +div.markdown ul, div.markdown ol { + padding-left: 30px; +} + +div.markdown li { + margin: 0.2em 0 0 0em; padding: 0px; +} + +div.markdown em { + color: #b05000; +} \ No newline at end of file diff --git a/resources/pixel.png b/resources/pixel.png new file mode 100644 index 00000000..4d5f6df1 Binary files /dev/null and b/resources/pixel.png differ diff --git a/resources/search-icon.png b/resources/search-icon.png new file mode 100644 index 00000000..90e8d2c6 Binary files /dev/null and b/resources/search-icon.png differ diff --git a/resources/shield_16x16.png b/resources/shield_16x16.png new file mode 100644 index 00000000..4eb8031c Binary files /dev/null and b/resources/shield_16x16.png differ diff --git a/resources/tag_16x16.png b/resources/tag_16x16.png new file mode 100644 index 00000000..7e75cba0 Binary files /dev/null and b/resources/tag_16x16.png differ diff --git a/resources/user_16x16.png b/resources/user_16x16.png new file mode 100644 index 00000000..d5edd4d4 Binary files /dev/null and b/resources/user_16x16.png differ diff --git a/resources/welcome.mkd b/resources/welcome.mkd new file mode 100644 index 00000000..130cd8ac --- /dev/null +++ b/resources/welcome.mkd @@ -0,0 +1,3 @@ +## Welcome to Gitblit + +A quick and easy way to host or view your own [Git](http://www.git-scm.com) repositories. diff --git a/src/WEB-INF/web.xml b/src/WEB-INF/web.xml new file mode 100644 index 00000000..d5d3288f --- /dev/null +++ b/src/WEB-INF/web.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + SyndicationServlet + com.gitblit.SyndicationServlet + + + SyndicationServlet + /feed/* + + + + + + ZipServlet + com.gitblit.DownloadZipServlet + + + ZipServlet + /zip/* + + + + + + GitFilter + com.gitblit.GitFilter + + + GitFilter + /git/* + + + + + + SyndicationFilter + com.gitblit.SyndicationFilter + + + SyndicationFilter + /feed/* + + + + + + wicketFilter + + org.apache.wicket.protocol.http.WicketFilter + + + applicationClassName + com.gitblit.wicket.GitBlitWebApp + + + ignorePaths + + git/,feed/,zip/ + + + + wicketFilter + /* + + \ No newline at end of file diff --git a/src/com/gitblit/AccessRestrictionFilter.java b/src/com/gitblit/AccessRestrictionFilter.java index 3aca1039..625eaa99 100644 --- a/src/com/gitblit/AccessRestrictionFilter.java +++ b/src/com/gitblit/AccessRestrictionFilter.java @@ -16,6 +16,7 @@ package com.gitblit; import java.io.IOException; +import java.nio.charset.Charset; import java.security.Principal; import java.text.MessageFormat; import java.util.Enumeration; @@ -32,6 +33,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import org.eclipse.jgit.util.Base64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -114,7 +116,8 @@ public abstract class AccessRestrictionFilter implements Filter { if (authorization != null && authorization.startsWith(BASIC)) { // Authorization: Basic base64credentials String base64Credentials = authorization.substring(BASIC.length()).trim(); - String credentials = StringUtils.decodeBase64(base64Credentials); + String credentials = new String(Base64.decode(base64Credentials), + Charset.forName("UTF-8")); if (GitBlit.isDebugMode()) { logger.info(MessageFormat.format("AUTH: {0} ({1})", authorization, credentials)); } @@ -131,7 +134,8 @@ public abstract class AccessRestrictionFilter implements Filter { // authenticated request permitted. // pass processing to the restricted servlet. newSession(accessRequest, httpResponse); - logger.info("ARF: " + fullUrl + " (" + HttpServletResponse.SC_CONTINUE + ") authenticated"); + logger.info("ARF: " + fullUrl + " (" + HttpServletResponse.SC_CONTINUE + + ") authenticated"); chain.doFilter(accessRequest, httpResponse); return; } @@ -163,7 +167,8 @@ public abstract class AccessRestrictionFilter implements Filter { } if (GitBlit.isDebugMode()) { - logger.info("ARF: " + fullUrl + " (" + HttpServletResponse.SC_CONTINUE + ") unauthenticated"); + logger.info("ARF: " + fullUrl + " (" + HttpServletResponse.SC_CONTINUE + + ") unauthenticated"); } // unauthenticated request permitted. // pass processing to the restricted servlet. @@ -202,19 +207,19 @@ public abstract class AccessRestrictionFilter implements Filter { @Override public void destroy() { } - + /** * Wraps a standard HttpServletRequest and overrides user principal methods. */ public static class AccessRestrictionRequest extends ServletRequestWrapper { private UserModel user; - + public AccessRestrictionRequest(HttpServletRequest req) { super(req); user = new UserModel("anonymous"); } - + void setUser(UserModel user) { this.user = user; } diff --git a/src/com/gitblit/Build.java b/src/com/gitblit/Build.java index 30c4aa00..90224f08 100644 --- a/src/com/gitblit/Build.java +++ b/src/com/gitblit/Build.java @@ -312,10 +312,10 @@ public class Build { "c7adc475ca40c288c93054e0f4fe58f3a98c0cb5"); public static final MavenObject JETTY = new MavenObject("Jetty", - "org/eclipse/jetty/aggregate", "jetty-all", "7.4.1.v20110513", 1500000, 1000000, - 4100000, "1e2de9ed25a7c6ae38717d5ffdc7cfcd6be4bd46", - "7b6279d16ce8f663537d9faf55ea353e748dbbaa", - "fa06212e751296f1a7abc15c843b135bf49a112b"); + "org/eclipse/jetty/aggregate", "jetty-webapp", "7.4.2.v20110526", 1000000, 680000, + 2720000, "56331143afa22d24d9faba96e86e6371b0686c7c", + "9f38230fd589e29c8be0fc3c80fb51c5093c2e1e", + "0d48212889c25252c5c14bef62703e28215d80cc"); public static final MavenObject SERVLET = new MavenObject("Servlet 2.5", "javax/servlet", "servlet-api", "2.5", 105000, 158000, 0, @@ -363,8 +363,8 @@ public class Build { "3d32d958b2f7aa58388af5701ea3aafc433e573f", "c37518b67ea85af485dd61fe854137eeacc50318"); - public static final MavenObject JUNIT = new MavenObject("JUnit", "junit", "junit", "3.8.2", - 120000, 0, 0, "07e4cde26b53a9a0e3fe5b00d1dbbc7cc1d46060", "", ""); + public static final MavenObject JUNIT = new MavenObject("JUnit", "junit", "junit", "4.8.2", + 237000, 0, 0, "c94f54227b08100974c36170dcb53329435fe5ad", "", ""); public static final MavenObject MARKDOWNPAPERS = new MavenObject("MarkdownPapers", "org/tautua/markdownpapers", "markdownpapers-core", "1.0.0", 87000, 58000, 278000, diff --git a/src/com/gitblit/BuildWebXml.java b/src/com/gitblit/BuildWebXml.java new file mode 100644 index 00000000..3b687f6d --- /dev/null +++ b/src/com/gitblit/BuildWebXml.java @@ -0,0 +1,80 @@ +/* + * Copyright 2011 gitblit.com. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gitblit; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Properties; + +public class BuildWebXml { + private static final String PARAMS = ""; + + private static final String [] STRIP_TOKENS = { "" }; + + private static final String PARAM_PATTERN = "\n\t\n\t\t{0}\n\t\t{1}\n\t\n"; + + public static void main(String[] args) throws Exception { + // Read the current Gitblit properties + // TODO extract the comments and inject them into web.xml too + FileInputStream fis = new FileInputStream(new File("distrib/gitblit.properties")); + Properties fileSettings = new Properties(); + fileSettings.load(fis); + fis.close(); + List keys = new ArrayList(fileSettings.stringPropertyNames()); + Collections.sort(keys); + + StringBuilder parameters = new StringBuilder(); + for (String key : keys) { + if (!skipKey(key)) { + String value = fileSettings.getProperty(key); + parameters.append(MessageFormat.format(PARAM_PATTERN, key, value)); + } + } + + // Read the prototype web.xml file + File webxml = new File("src/WEB-INF/web.xml"); + char [] buffer = new char[(int) webxml.length()]; + FileReader reader = new FileReader(webxml); + reader.read(buffer); + reader.close(); + String webXmlContent = new String(buffer); + + // Insert the Gitblit properties into the prototype web.xml + for (String stripToken:STRIP_TOKENS) { + webXmlContent = webXmlContent.replace(stripToken, ""); + } + int idx = webXmlContent.indexOf(PARAMS); + StringBuilder sb = new StringBuilder(); + sb.append(webXmlContent.substring(0, idx)); + sb.append(parameters.toString()); + sb.append(webXmlContent.substring(idx + PARAMS.length())); + + // Save the merged web.xml to the war build folder + FileOutputStream os = new FileOutputStream(new File("war/WEB-INF/web.xml"), false); + os.write(sb.toString().getBytes()); + os.close(); + } + + private static boolean skipKey(String key) { + return key.startsWith(Keys.server._ROOT); + } +} diff --git a/src/com/gitblit/Constants.java b/src/com/gitblit/Constants.java index 68e7b67e..b874a7b0 100644 --- a/src/com/gitblit/Constants.java +++ b/src/com/gitblit/Constants.java @@ -33,14 +33,12 @@ public class Constants { public static final String PROPERTIES_FILE = "gitblit.properties"; - public static final String GIT_SERVLET_PATH = "/git/"; + public static final String GIT_PATH = "/git/"; - public static final String ZIP_SERVLET_PATH = "/zip/"; + public static final String ZIP_PATH = "/zip/"; - public static final String SYNDICATION_SERVLET_PATH = "/feed/"; + public static final String SYNDICATION_PATH = "/feed/"; - public static final String RESOURCE_PATH = "/com/gitblit/wicket/resources/"; - public static final String BORDER = "***********************************************************"; public static enum AccessRestrictionType { diff --git a/src/com/gitblit/DownloadZipServlet.java b/src/com/gitblit/DownloadZipServlet.java index 3b02cbac..d36b94d2 100644 --- a/src/com/gitblit/DownloadZipServlet.java +++ b/src/com/gitblit/DownloadZipServlet.java @@ -44,7 +44,7 @@ public class DownloadZipServlet extends HttpServlet { if (baseURL.length() > 0 && baseURL.charAt(baseURL.length() - 1) == '/') { baseURL = baseURL.substring(0, baseURL.length() - 1); } - return baseURL + Constants.ZIP_SERVLET_PATH + "?r=" + repository + return baseURL + Constants.ZIP_PATH + "?r=" + repository + (path == null ? "" : ("&p=" + path)) + (objectId == null ? "" : ("&h=" + objectId)); } diff --git a/src/com/gitblit/FileLoginService.java b/src/com/gitblit/FileLoginService.java index b59a7763..e239efc4 100644 --- a/src/com/gitblit/FileLoginService.java +++ b/src/com/gitblit/FileLoginService.java @@ -53,8 +53,7 @@ public class FileLoginService extends FileSettings implements ILoginService { if (user.password.equalsIgnoreCase(md5)) { returnedUser = user; } - } - if (user.password.equals(new String(password))) { + } else if (user.password.equals(new String(password))) { returnedUser = user; } return returnedUser; diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java index fa593f92..1fa8b60f 100644 --- a/src/com/gitblit/GitBlit.java +++ b/src/com/gitblit/GitBlit.java @@ -45,7 +45,7 @@ import com.gitblit.utils.StringUtils; public class GitBlit implements ServletContextListener { - private static final GitBlit GITBLIT; + private static GitBlit gitblit; private final Logger logger = LoggerFactory.getLogger(GitBlit.class); @@ -53,45 +53,48 @@ public class GitBlit implements ServletContextListener { private File repositoriesFolder; - private boolean exportAll; + private boolean exportAll = true; private ILoginService loginService; private IStoredSettings storedSettings; - static { - GITBLIT = new GitBlit(); - } - - private GitBlit() { + public GitBlit() { + if (gitblit == null) { + // Singleton reference when running in standard servlet container + gitblit = this; + } } public static GitBlit self() { - return GITBLIT; + if (gitblit == null) { + gitblit = new GitBlit(); + } + return gitblit; } public static boolean getBoolean(String key, boolean defaultValue) { - return GITBLIT.storedSettings.getBoolean(key, defaultValue); + return self().storedSettings.getBoolean(key, defaultValue); } public static int getInteger(String key, int defaultValue) { - return GITBLIT.storedSettings.getInteger(key, defaultValue); + return self().storedSettings.getInteger(key, defaultValue); } public static String getString(String key, String defaultValue) { - return GITBLIT.storedSettings.getString(key, defaultValue); + return self().storedSettings.getString(key, defaultValue); } public static List getStrings(String key) { - return GITBLIT.storedSettings.getStrings(key); + return self().storedSettings.getStrings(key); } public static List getAllKeys(String startingWith) { - return GITBLIT.storedSettings.getAllKeys(startingWith); + return self().storedSettings.getAllKeys(startingWith); } public static boolean isDebugMode() { - return GITBLIT.storedSettings.getBoolean(Keys.web.debugMode, false); + return self().storedSettings.getBoolean(Keys.web.debugMode, false); } public List getOtherCloneUrls(String repositoryName) { @@ -103,6 +106,7 @@ public class GitBlit implements ServletContextListener { } public void setLoginService(ILoginService loginService) { + logger.info("Setting up login service " + loginService.toString()); this.loginService = loginService; } @@ -353,9 +357,32 @@ public class GitBlit implements ServletContextListener { public void configureContext(IStoredSettings settings) { logger.info("Reading configuration from " + settings.toString()); this.storedSettings = settings; - repositoriesFolder = new File(settings.getString(Keys.git.repositoriesFolder, "repos")); - exportAll = settings.getBoolean(Keys.git.exportAll, true); + repositoriesFolder = new File(settings.getString(Keys.git.repositoriesFolder, "git")); + logger.info("Git repositories folder " + repositoriesFolder.getAbsolutePath()); repositoryResolver = new FileResolver(repositoriesFolder, exportAll); + String realm = settings.getString(Keys.realm.realmFile, "users.properties"); + ILoginService loginService = null; + try { + // Check to see if this "file" is a login service class + Class realmClass = Class.forName(realm); + if (ILoginService.class.isAssignableFrom(realmClass)) { + loginService = (ILoginService) realmClass.newInstance(); + } + } catch (Throwable t) { + // Not a login service class OR other issue + // Use default file login service + File realmFile = new File(realm); + if (!realmFile.exists()) { + try { + realmFile.createNewFile(); + } catch (IOException x) { + logger.error( + MessageFormat.format("COULD NOT CREATE REALM FILE {0}!", realmFile), x); + } + } + loginService = new FileLoginService(realmFile); + } + setLoginService(loginService); } @Override diff --git a/src/com/gitblit/GitBlitServer.java b/src/com/gitblit/GitBlitServer.java index 4b6df709..3687e4db 100644 --- a/src/com/gitblit/GitBlitServer.java +++ b/src/com/gitblit/GitBlitServer.java @@ -30,10 +30,6 @@ import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; -import org.apache.log4j.ConsoleAppender; -import org.apache.log4j.PatternLayout; -import org.apache.wicket.protocol.http.ContextParamWebApplicationFactory; -import org.apache.wicket.protocol.http.WicketFilter; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.bio.SocketConnector; @@ -42,7 +38,6 @@ import org.eclipse.jetty.server.session.HashSessionManager; import org.eclipse.jetty.server.ssl.SslConnector; import org.eclipse.jetty.server.ssl.SslSelectChannelConnector; import org.eclipse.jetty.server.ssl.SslSocketConnector; -import org.eclipse.jetty.servlet.FilterHolder; import org.eclipse.jetty.servlet.FilterMapping; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.thread.QueuedThreadPool; @@ -56,7 +51,6 @@ import com.beust.jcommander.Parameter; import com.beust.jcommander.ParameterException; import com.beust.jcommander.Parameters; import com.gitblit.utils.StringUtils; -import com.gitblit.wicket.GitBlitWebApp; public class GitBlitServer { @@ -121,26 +115,6 @@ public class GitBlitServer { */ private static void start(Params params) { FileSettings settings = params.FILESETTINGS; - String pattern = settings.getString(Keys.server.log4jPattern, - "%-5p %d{MM-dd HH:mm:ss.SSS} %-20.20c{1} %m%n"); - - // allow os override of logging pattern - String os = System.getProperty("os.name").toLowerCase(); - if (os.indexOf("windows") > -1) { - String winPattern = settings.getString(Keys.server.log4jPattern_windows, pattern); - if (!StringUtils.isEmpty(winPattern)) { - pattern = winPattern; - } - } else if (os.indexOf("linux") > -1) { - String linuxPattern = settings.getString(Keys.server.log4jPattern_linux, pattern); - if (!StringUtils.isEmpty(linuxPattern)) { - pattern = linuxPattern; - } - } - - PatternLayout layout = new PatternLayout(pattern); - org.apache.log4j.Logger rootLogger = org.apache.log4j.Logger.getRootLogger(); - rootLogger.addAppender(new ConsoleAppender(layout)); logger = LoggerFactory.getLogger(GitBlitServer.class); logger.info(Constants.BORDER); @@ -223,55 +197,23 @@ public class GitBlitServer { sessionManager.setSecureCookies(params.port <= 0 && params.securePort > 0); rootContext.getSessionHandler().setSessionManager(sessionManager); - // Wicket Filter - String wicketPathSpec = "/*"; - FilterHolder wicketFilter = new FilterHolder(WicketFilter.class); - wicketFilter.setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM, - GitBlitWebApp.class.getName()); - wicketFilter.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, wicketPathSpec); - wicketFilter.setInitParameter(WicketFilter.IGNORE_PATHS_PARAM, "git/,feed/,zip/"); - rootContext.addFilter(wicketFilter, wicketPathSpec, FilterMapping.DEFAULT); - // JGit Filter and Servlet - if (settings.getBoolean(Keys.git.enableGitServlet, true)) { - String jgitPathSpec = Constants.GIT_SERVLET_PATH + "*"; - rootContext.addFilter(GitFilter.class, jgitPathSpec, FilterMapping.DEFAULT); - ServletHolder jGitServlet = rootContext.addServlet(GitServlet.class, jgitPathSpec); - jGitServlet.setInitParameter("base-path", params.repositoriesFolder); - jGitServlet.setInitParameter("export-all", - settings.getBoolean(Keys.git.exportAll, true) ? "1" : "0"); - } + String jgitPathSpec = Constants.GIT_PATH + "*"; + rootContext.addFilter(GitFilter.class, jgitPathSpec, FilterMapping.DEFAULT); + ServletHolder jGitServlet = rootContext.addServlet(GitServlet.class, jgitPathSpec); + jGitServlet.setInitParameter("base-path", params.repositoriesFolder); + jGitServlet.setInitParameter("export-all", "1"); - // Syndication Filter and Servlet - String feedPathSpec = Constants.SYNDICATION_SERVLET_PATH + "*"; - rootContext.addFilter(SyndicationFilter.class, feedPathSpec, FilterMapping.DEFAULT); - rootContext.addServlet(SyndicationServlet.class, feedPathSpec); - - // Zip Servlet - rootContext.addServlet(DownloadZipServlet.class, Constants.ZIP_SERVLET_PATH + "*"); - - // Login Service + // Ensure there is a defined Login Service String realmUsers = params.realmFile; if (StringUtils.isEmpty(realmUsers)) { logger.error(MessageFormat.format("PLEASE SPECIFY {0}!!", Keys.realm.realmFile)); return; } - File realmFile = new File(realmUsers); - if (!realmFile.exists()) { - try { - realmFile.createNewFile(); - } catch (IOException x) { - logger.error(MessageFormat.format("COULD NOT CREATE REALM FILE {0}!", realmUsers), - x); - return; - } - } - logger.info("Setting up login service from " + realmUsers); - FileLoginService loginService = new FileLoginService(realmFile); - GitBlit.self().setLoginService(loginService); - - logger.info("Git repositories folder " - + new File(params.repositoriesFolder).getAbsolutePath()); + + // Update settings +// settings.put(Keys.realm.realmFile, params.realmFile); +// settings.put(Keys.git.repositoriesFolder, params.repositoriesFolder); // Set the server's contexts server.setHandler(rootContext); diff --git a/src/com/gitblit/GitFilter.java b/src/com/gitblit/GitFilter.java index 5bd7b330..b3104426 100644 --- a/src/com/gitblit/GitFilter.java +++ b/src/com/gitblit/GitFilter.java @@ -65,6 +65,10 @@ public class GitFilter extends AccessRestrictionFilter { @Override protected boolean canAccess(RepositoryModel repository, UserModel user, String urlRequestType) { + if (!GitBlit.getBoolean(Keys.git.enableGitServlet, true)) { + // Git Servlet disabled + return false; + } if (repository.isFrozen || repository.accessRestriction.atLeast(AccessRestrictionType.PUSH)) { boolean authorizedUser = user.canAccessRepository(repository.name); if (urlRequestType.equals(gitReceivePack)) { diff --git a/src/com/gitblit/ILoginService.java b/src/com/gitblit/ILoginService.java index d7bfd017..0e706cf3 100644 --- a/src/com/gitblit/ILoginService.java +++ b/src/com/gitblit/ILoginService.java @@ -42,4 +42,6 @@ public interface ILoginService { boolean renameRole(String oldRole, String newRole); boolean deleteRole(String role); + + String toString(); } diff --git a/src/com/gitblit/IStoredSettings.java b/src/com/gitblit/IStoredSettings.java index 7108c068..403a0676 100644 --- a/src/com/gitblit/IStoredSettings.java +++ b/src/com/gitblit/IStoredSettings.java @@ -27,21 +27,25 @@ import com.gitblit.utils.StringUtils; public abstract class IStoredSettings { protected final Logger logger; - + public IStoredSettings(Class clazz) { logger = LoggerFactory.getLogger(clazz); } - + protected abstract Properties read(); public List getAllKeys(String startingWith) { - startingWith = startingWith.toLowerCase(); List keys = new ArrayList(); Properties props = read(); - for (Object o : props.keySet()) { - String key = o.toString(); - if (key.toLowerCase().startsWith(startingWith)) { - keys.add(key); + if (StringUtils.isEmpty(startingWith)) { + keys.addAll(props.stringPropertyNames()); + } else { + startingWith = startingWith.toLowerCase(); + for (Object o : props.keySet()) { + String key = o.toString(); + if (key.toLowerCase().startsWith(startingWith)) { + keys.add(key); + } } } return keys; diff --git a/src/com/gitblit/SyndicationServlet.java b/src/com/gitblit/SyndicationServlet.java index 19865fe5..66dc467a 100644 --- a/src/com/gitblit/SyndicationServlet.java +++ b/src/com/gitblit/SyndicationServlet.java @@ -43,7 +43,7 @@ public class SyndicationServlet extends HttpServlet { } StringBuilder url = new StringBuilder(); url.append(baseURL); - url.append(Constants.SYNDICATION_SERVLET_PATH); + url.append(Constants.SYNDICATION_PATH); url.append(repository); if (!StringUtils.isEmpty(objectId) || length > 0) { StringBuilder parameters = new StringBuilder("?"); diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java index e8bb3bf2..5656efb3 100644 --- a/src/com/gitblit/utils/JGitUtils.java +++ b/src/com/gitblit/utils/JGitUtils.java @@ -402,36 +402,30 @@ public class JGitUtils { public static List getFilesInCommit(Repository r, RevCommit commit) { List list = new ArrayList(); - RevWalk rw = new RevWalk(r); - TreeWalk tw = new TreeWalk(r); + RevWalk rw = new RevWalk(r); try { if (commit == null) { ObjectId object = r.resolve(Constants.HEAD); commit = rw.parseCommit(object); - } - RevTree commitTree = commit.getTree(); + } - tw.reset(); - tw.setRecursive(true); if (commit.getParentCount() == 0) { - tw.addTree(commitTree); + TreeWalk tw = new TreeWalk(r); + tw.reset(); + tw.setRecursive(true); + tw.addTree(commit.getTree()); while (tw.next()) { list.add(new PathChangeModel(tw.getPathString(), tw.getPathString(), 0, tw .getRawMode(0), commit.getId().getName(), ChangeType.ADD)); } + tw.release(); } else { RevCommit parent = rw.parseCommit(commit.getParent(0).getId()); - RevTree parentTree = parent.getTree(); - tw.addTree(parentTree); - tw.addTree(commitTree); - tw.setFilter(TreeFilter.ANY_DIFF); - - RawTextComparator cmp = RawTextComparator.DEFAULT; DiffFormatter df = new DiffFormatter(DisabledOutputStream.INSTANCE); df.setRepository(r); - df.setDiffComparator(cmp); + df.setDiffComparator(RawTextComparator.DEFAULT); df.setDetectRenames(true); - List diffs = df.scan(parentTree, commitTree); + List diffs = df.scan(parent.getTree(), commit.getTree()); for (DiffEntry diff : diffs) { if (diff.getChangeType().equals(ChangeType.DELETE)) { list.add(new PathChangeModel(diff.getOldPath(), diff.getOldPath(), 0, diff @@ -447,8 +441,7 @@ public class JGitUtils { } catch (Throwable t) { LOGGER.error("failed to determine files in commit!", t); } finally { - rw.dispose(); - tw.release(); + rw.dispose(); } return list; } diff --git a/src/com/gitblit/utils/StringUtils.java b/src/com/gitblit/utils/StringUtils.java index 363efc9c..b53b5e15 100644 --- a/src/com/gitblit/utils/StringUtils.java +++ b/src/com/gitblit/utils/StringUtils.java @@ -16,16 +16,12 @@ package com.gitblit.utils; import java.io.UnsupportedEncodingException; -import java.nio.charset.Charset; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.List; import java.util.regex.PatternSyntaxException; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jgit.util.Base64; - public class StringUtils { public static final String MD5_TYPE = "MD5:"; @@ -152,9 +148,10 @@ public class StringUtils { md.update(string.getBytes("iso-8859-1")); byte[] digest = md.digest(); return toHex(digest); - } catch (Exception e) { - Log.warn(e); - return null; + } catch (UnsupportedEncodingException u) { + throw new RuntimeException(u); + } catch (NoSuchAlgorithmException t) { + throw new RuntimeException(t); } } @@ -168,11 +165,7 @@ public class StringUtils { } return sb.toString(); } - - public static String decodeBase64(String base64) { - return new String(Base64.decode(base64), Charset.forName("UTF-8")); - } - + public static String getRootPath(String path) { if (path.indexOf('/') > -1) { return path.substring(0, path.lastIndexOf('/')); diff --git a/src/com/gitblit/utils/SyndicationUtils.java b/src/com/gitblit/utils/SyndicationUtils.java index 5763af3f..80a1b288 100644 --- a/src/com/gitblit/utils/SyndicationUtils.java +++ b/src/com/gitblit/utils/SyndicationUtils.java @@ -48,7 +48,7 @@ public class SyndicationUtils { feed.setDescription(description); SyndImageImpl image = new SyndImageImpl(); image.setTitle(Constants.NAME); - image.setUrl(hostUrl + Constants.RESOURCE_PATH + "gitblt_25.png"); + image.setUrl(hostUrl + "/gitblt_25.png"); image.setLink(hostUrl); feed.setImage(image); diff --git a/src/com/gitblit/wicket/GitBlitWebApp.properties b/src/com/gitblit/wicket/GitBlitWebApp.properties index 50a4ef42..2ed61fa6 100644 --- a/src/com/gitblit/wicket/GitBlitWebApp.properties +++ b/src/com/gitblit/wicket/GitBlitWebApp.properties @@ -66,7 +66,7 @@ gb.filesRenamed = {0} files renamed gb.missingUsername = Missing Username gb.edit = edit gb.searchTypeTooltip = Select Search Type -gb.searchTooltip = Search Git:Blit +gb.searchTooltip = Search Gitblit gb.delete = delete gb.docs = docs gb.accessRestriction = access restriction @@ -86,7 +86,7 @@ gb.viewRestricted = authenticated view, clone, & push gb.useTicketsDescription = distributed Ticgit issues gb.useDocsDescription = enumerates Markdown documentation in repository gb.showRemoteBranchesDescription = show remote branches -gb.canAdminDescription = can administer Git:Blit server +gb.canAdminDescription = can administer Gitblit server gb.permittedUsers = permitted users gb.isFrozen = is frozen gb.isFrozenDescription = deny push operations diff --git a/src/com/gitblit/wicket/WicketUtils.java b/src/com/gitblit/wicket/WicketUtils.java index 54f9648c..1897acac 100644 --- a/src/com/gitblit/wicket/WicketUtils.java +++ b/src/com/gitblit/wicket/WicketUtils.java @@ -169,7 +169,7 @@ public class WicketUtils { } public static ContextImage newImage(String wicketId, String file, String tooltip) { - ContextImage img = new ContextImage(wicketId, com.gitblit.Constants.RESOURCE_PATH + file); + ContextImage img = new ContextImage(wicketId, file); if (!StringUtils.isEmpty(tooltip)) { setHtmlTooltip(img, tooltip); } @@ -177,7 +177,7 @@ public class WicketUtils { } public static ContextRelativeResource getResource(String file) { - return new ContextRelativeResource(com.gitblit.Constants.RESOURCE_PATH + file); + return new ContextRelativeResource(file); } public static String getHostURL(Request request) { diff --git a/src/com/gitblit/wicket/pages/BasePage.html b/src/com/gitblit/wicket/pages/BasePage.html index 0da37d40..cc19fbcc 100644 --- a/src/com/gitblit/wicket/pages/BasePage.html +++ b/src/com/gitblit/wicket/pages/BasePage.html @@ -4,25 +4,21 @@ xml:lang="en" lang="en"> - + [page title] - - - - + + diff --git a/src/com/gitblit/wicket/pages/BasePage.java b/src/com/gitblit/wicket/pages/BasePage.java index 9031befd..5a0eb90f 100644 --- a/src/com/gitblit/wicket/pages/BasePage.java +++ b/src/com/gitblit/wicket/pages/BasePage.java @@ -63,7 +63,7 @@ public abstract class BasePage extends WebPage { if (siteName == null || siteName.trim().length() == 0) { siteName = Constants.NAME; } - add(new Label("siteName", siteName)); + add(new LinkPanel("siteName", null, siteName, RepositoriesPage.class, null)); add(new LinkPanel("repositoryName", null, repositoryName, SummaryPage.class, WicketUtils.newRepositoryParameter(repositoryName))); add(new Label("pageName", pageName)); @@ -122,6 +122,10 @@ public abstract class BasePage extends WebPage { HttpServletRequest req = servletWebRequest.getHttpServletRequest(); return req.getServerName(); } + + public void warn(String message, Throwable t) { + logger.warn(message, t); + } public void error(String message, boolean redirect) { logger.error(message); diff --git a/src/com/gitblit/wicket/pages/DocsPage.java b/src/com/gitblit/wicket/pages/DocsPage.java index 7f41b71b..2f899bbe 100644 --- a/src/com/gitblit/wicket/pages/DocsPage.java +++ b/src/com/gitblit/wicket/pages/DocsPage.java @@ -64,7 +64,8 @@ public class DocsPage extends RepositoryPage { .newPathParameter(repositoryName, entry.commitId, entry.path))); item.add(new BookmarkablePageLink("raw", RawPage.class, WicketUtils .newPathParameter(repositoryName, entry.commitId, entry.path))); - item.add(new BookmarkablePageLink("blame", BlobPage.class).setEnabled(false)); + item.add(new BookmarkablePageLink("blame", BlamePage.class, + WicketUtils.newPathParameter(repositoryName, entry.commitId, entry.path))); item.add(new BookmarkablePageLink("history", HistoryPage.class, WicketUtils .newPathParameter(repositoryName, entry.commitId, entry.path))); WicketUtils.setAlternatingBackground(item, counter); diff --git a/src/com/gitblit/wicket/pages/LoginPage.html b/src/com/gitblit/wicket/pages/LoginPage.html index 280453d5..5f9b779f 100644 --- a/src/com/gitblit/wicket/pages/LoginPage.html +++ b/src/com/gitblit/wicket/pages/LoginPage.html @@ -7,18 +7,14 @@ [page title] - - - - + +
- - Git:Blit
-
+ Gitblit
[name]
diff --git a/src/com/gitblit/wicket/pages/MarkdownPage.html b/src/com/gitblit/wicket/pages/MarkdownPage.html index a0f60904..1293f786 100644 --- a/src/com/gitblit/wicket/pages/MarkdownPage.html +++ b/src/com/gitblit/wicket/pages/MarkdownPage.html @@ -6,16 +6,14 @@ - - - + diff --git a/src/com/gitblit/wicket/pages/MarkdownPage.java b/src/com/gitblit/wicket/pages/MarkdownPage.java index 9202fb88..aaf12bad 100644 --- a/src/com/gitblit/wicket/pages/MarkdownPage.java +++ b/src/com/gitblit/wicket/pages/MarkdownPage.java @@ -39,7 +39,8 @@ public class MarkdownPage extends RepositoryPage { RevCommit commit = JGitUtils.getCommit(r, objectId); // markdown page links - add(new Label("blameLink", getString("gb.blame"))); + add(new BookmarkablePageLink("blameLink", BlamePage.class, + WicketUtils.newPathParameter(repositoryName, objectId, markdownPath))); add(new BookmarkablePageLink("historyLink", HistoryPage.class, WicketUtils.newPathParameter(repositoryName, objectId, markdownPath))); add(new BookmarkablePageLink("rawLink", RawPage.class, WicketUtils.newPathParameter( diff --git a/src/com/gitblit/wicket/pages/RepositoriesPage.html b/src/com/gitblit/wicket/pages/RepositoriesPage.html index da91cb2e..c8ab5978 100644 --- a/src/com/gitblit/wicket/pages/RepositoriesPage.html +++ b/src/com/gitblit/wicket/pages/RepositoriesPage.html @@ -4,9 +4,7 @@ xml:lang="en" lang="en"> - - - + diff --git a/src/com/gitblit/wicket/pages/RepositoriesPage.java b/src/com/gitblit/wicket/pages/RepositoriesPage.java index b0e5e579..f97adff5 100644 --- a/src/com/gitblit/wicket/pages/RepositoriesPage.java +++ b/src/com/gitblit/wicket/pages/RepositoriesPage.java @@ -86,7 +86,7 @@ public class RepositoriesPage extends BasePage { message = MarkdownUtils.transformMarkdown(reader); } catch (Throwable t) { message = "Failed to read " + file; - error(message, t, false); + warn(message, t); } } else { message = messageSource + " is not a valid file."; diff --git a/src/com/gitblit/wicket/pages/RepositoryPage.html b/src/com/gitblit/wicket/pages/RepositoryPage.html index cff7d068..e793a1e9 100644 --- a/src/com/gitblit/wicket/pages/RepositoryPage.html +++ b/src/com/gitblit/wicket/pages/RepositoryPage.html @@ -19,7 +19,7 @@ diff --git a/src/com/gitblit/wicket/pages/RepositoryPage.java b/src/com/gitblit/wicket/pages/RepositoryPage.java index cf14ee19..00ed7554 100644 --- a/src/com/gitblit/wicket/pages/RepositoryPage.java +++ b/src/com/gitblit/wicket/pages/RepositoryPage.java @@ -40,8 +40,6 @@ import org.eclipse.jgit.diff.DiffEntry.ChangeType; import org.eclipse.jgit.lib.PersonIdent; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.revwalk.RevCommit; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import com.gitblit.GitBlit; import com.gitblit.Keys; @@ -65,20 +63,19 @@ public abstract class RepositoryPage extends BasePage { private RepositoryModel m; - private final Logger logger = LoggerFactory.getLogger(RepositoryPage.class); - - private final Map knownPages = new HashMap() { + private final Map registeredPages = new HashMap() { private static final long serialVersionUID = 1L; { - put("summary", "gb.summary"); - put("log", "gb.log"); - put("branches", "gb.branches"); - put("tags", "gb.tags"); - put("tree", "gb.tree"); - put("tickets", "gb.tickets"); - put("edit", "gb.edit"); + put("summary", new PageRegistration("gb.summary", SummaryPage.class)); + put("log", new PageRegistration("gb.log", LogPage.class)); + put("branches", new PageRegistration("gb.branches", BranchesPage.class)); + put("tags", new PageRegistration("gb.tags", TagsPage.class)); + put("tree", new PageRegistration("gb.tree", TreePage.class)); + put("tickets", new PageRegistration("gb.tickets", TicketsPage.class)); + put("edit", new PageRegistration("gb.edit", EditRepositoryPage.class)); + put("docs", new PageRegistration("gb.docs", DocsPage.class)); } }; @@ -95,26 +92,17 @@ public abstract class RepositoryPage extends BasePage { RepositoryModel model = getRepositoryModel(); // standard page links - add(new BookmarkablePageLink("summary", SummaryPage.class, - WicketUtils.newRepositoryParameter(repositoryName))); - add(new BookmarkablePageLink("log", LogPage.class, - WicketUtils.newRepositoryParameter(repositoryName))); - add(new BookmarkablePageLink("branches", BranchesPage.class, - WicketUtils.newRepositoryParameter(repositoryName))); - add(new BookmarkablePageLink("tags", TagsPage.class, - WicketUtils.newRepositoryParameter(repositoryName))); - add(new BookmarkablePageLink("tree", TreePage.class, - WicketUtils.newRepositoryParameter(repositoryName))); + addRegisteredPageLink("summary"); + addRegisteredPageLink("log"); + addRegisteredPageLink("branches"); + addRegisteredPageLink("tags"); + addRegisteredPageLink("tree"); // per-repository extra page links List extraPageLinks = new ArrayList(); - - // Conditionally add tickets link if (model.useTickets && TicgitUtils.getTicketsBranch(r) != null) { extraPageLinks.add("tickets"); } - - // Conditionally add docs link if (model.useDocs) { extraPageLinks.add("docs"); } @@ -135,26 +123,19 @@ public abstract class RepositoryPage extends BasePage { extraPageLinks.add("edit"); } + final String pageName = getPageName(); + final String pageWicketId = getLinkWicketId(pageName); ListDataProvider extrasDp = new ListDataProvider(extraPageLinks); DataView extrasView = new DataView("extra", extrasDp) { private static final long serialVersionUID = 1L; public void populateItem(final Item item) { String extra = item.getModelObject(); - if (extra.equals("tickets")) { - item.add(new Label("extraSeparator", " | ")); - item.add(new LinkPanel("extraLink", null, getString("gb.tickets"), - TicketsPage.class, WicketUtils.newRepositoryParameter(repositoryName))); - } else if (extra.equals("docs")) { - item.add(new Label("extraSeparator", " | ")); - item.add(new LinkPanel("extraLink", null, getString("gb.docs"), DocsPage.class, - WicketUtils.newRepositoryParameter(repositoryName))); - } else if (extra.equals("edit")) { - item.add(new Label("extraSeparator", " | ")); - item.add(new LinkPanel("extraLink", null, getString("gb.edit"), - EditRepositoryPage.class, WicketUtils - .newRepositoryParameter(repositoryName))); - } + PageRegistration pageReg = registeredPages.get(extra); + item.add(new Label("extraSeparator", " | ")); + item.add(new LinkPanel("extraLink", null, getString(pageReg.translationKey), + pageReg.pageClass, WicketUtils.newRepositoryParameter(repositoryName)) + .setEnabled(!extra.equals(pageWicketId))); } }; add(extrasView); @@ -163,7 +144,7 @@ public abstract class RepositoryPage extends BasePage { .getRelativePathPrefixToContextRoot(), repositoryName, null, 0))); // disable current page - disablePageLink(getPageName()); + disableRegisteredPageLink(pageName); // add floating search form SearchForm searchForm = new SearchForm("searchForm", repositoryName); @@ -174,18 +155,31 @@ public abstract class RepositoryPage extends BasePage { setStatelessHint(true); } - public void disablePageLink(String pageName) { - for (String wicketId : knownPages.keySet()) { - String key = knownPages.get(wicketId); + public String getLinkWicketId(String pageName) { + for (String wicketId : registeredPages.keySet()) { + String key = registeredPages.get(wicketId).translationKey; String linkName = getString(key); if (linkName.equals(pageName)) { - Component c = get(wicketId); - if (c != null) { - c.setEnabled(false); - } - break; + return wicketId; } } + return null; + } + + public void disableRegisteredPageLink(String pageName) { + String wicketId = getLinkWicketId(pageName); + if (!StringUtils.isEmpty(wicketId)) { + Component c = get(wicketId); + if (c != null) { + c.setEnabled(false); + } + } + } + + private void addRegisteredPageLink(String key) { + PageRegistration pageReg = registeredPages.get(key); + add(new BookmarkablePageLink(key, pageReg.pageClass, + WicketUtils.newRepositoryParameter(repositoryName))); } protected void addSyndicationDiscoveryLink() { @@ -339,6 +333,16 @@ public abstract class RepositoryPage extends BasePage { return WicketUtils.newPathParameter(repositoryName, objectId, path); } + private static class PageRegistration { + final String translationKey; + final Class pageClass; + + PageRegistration(String translationKey, Class pageClass) { + this.translationKey = translationKey; + this.pageClass = pageClass; + } + } + private static class SearchForm extends StatelessForm { private static final long serialVersionUID = 1L; diff --git a/src/com/gitblit/wicket/pages/SummaryPage.html b/src/com/gitblit/wicket/pages/SummaryPage.html index 7784a471..bbf89798 100644 --- a/src/com/gitblit/wicket/pages/SummaryPage.html +++ b/src/com/gitblit/wicket/pages/SummaryPage.html @@ -5,9 +5,7 @@ lang="en"> - - - + diff --git a/src/com/gitblit/wicket/pages/SummaryPage.java b/src/com/gitblit/wicket/pages/SummaryPage.java index 0d0db86b..e31375c0 100644 --- a/src/com/gitblit/wicket/pages/SummaryPage.java +++ b/src/com/gitblit/wicket/pages/SummaryPage.java @@ -122,7 +122,7 @@ public class SummaryPage extends RepositoryPage { } StringBuilder sb = new StringBuilder(); sb.append(WicketUtils.getHostURL(getRequestCycle().getRequest())); - sb.append(Constants.GIT_SERVLET_PATH); + sb.append(Constants.GIT_PATH); sb.append(repositoryName); repositoryUrls.add(sb.toString()); } else { diff --git a/src/com/gitblit/wicket/panels/RepositoriesPanel.html b/src/com/gitblit/wicket/panels/RepositoriesPanel.html index 1e609e10..7e090e80 100644 --- a/src/com/gitblit/wicket/panels/RepositoriesPanel.html +++ b/src/com/gitblit/wicket/panels/RepositoriesPanel.html @@ -21,9 +21,7 @@
- - - + @@ -41,9 +39,7 @@ - - - + Repository Description @@ -57,9 +53,7 @@ - - - + Repository Description @@ -83,7 +77,7 @@ - + diff --git a/src/com/gitblit/wicket/panels/SearchPanel.html b/src/com/gitblit/wicket/panels/SearchPanel.html index 7c8f96f2..bfbcb6ba 100644 --- a/src/com/gitblit/wicket/panels/SearchPanel.html +++ b/src/com/gitblit/wicket/panels/SearchPanel.html @@ -8,8 +8,10 @@ -
[search header]
+
[search header]
+ +
: [search string] ([search type])
diff --git a/src/com/gitblit/wicket/panels/SearchPanel.java b/src/com/gitblit/wicket/panels/SearchPanel.java index 5f82a428..759040e6 100644 --- a/src/com/gitblit/wicket/panels/SearchPanel.java +++ b/src/com/gitblit/wicket/panels/SearchPanel.java @@ -19,6 +19,7 @@ import java.util.Date; import java.util.List; import java.util.Map; +import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.link.BookmarkablePageLink; import org.apache.wicket.markup.repeater.Item; import org.apache.wicket.markup.repeater.data.DataView; @@ -72,9 +73,10 @@ public class SearchPanel extends BasePanel { hasMore = commits.size() >= itemsPerPage; // header - add(new LinkPanel("header", "title", commit == null ? "" : commit.getShortMessage(), - CommitPage.class, WicketUtils.newObjectParameter(repositoryName, - commit == null ? "" : commit.getName()))); + add(new CommitHeaderPanel("commitHeader", repositoryName, commit)); + + add(new Label("searchString", value)); + add(new Label("searchType", searchType.toString())); ListDataProvider dp = new ListDataProvider(commits); DataView searchView = new DataView("commit", dp) { diff --git a/src/com/gitblit/wicket/panels/UsersPanel.html b/src/com/gitblit/wicket/panels/UsersPanel.html index 39074b2f..eed2a887 100644 --- a/src/com/gitblit/wicket/panels/UsersPanel.html +++ b/src/com/gitblit/wicket/panels/UsersPanel.html @@ -12,9 +12,7 @@
@@ -30,9 +28,7 @@
- - - + diff --git a/src/com/gitblit/wicket/resources/add_16x16.png b/src/com/gitblit/wicket/resources/add_16x16.png deleted file mode 100644 index 0ea124a7..00000000 Binary files a/src/com/gitblit/wicket/resources/add_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/arrow_down.png b/src/com/gitblit/wicket/resources/arrow_down.png deleted file mode 100644 index f31cc819..00000000 Binary files a/src/com/gitblit/wicket/resources/arrow_down.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/arrow_off.png b/src/com/gitblit/wicket/resources/arrow_off.png deleted file mode 100644 index f9b1ced2..00000000 Binary files a/src/com/gitblit/wicket/resources/arrow_off.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/arrow_up.png b/src/com/gitblit/wicket/resources/arrow_up.png deleted file mode 100644 index 63031c33..00000000 Binary files a/src/com/gitblit/wicket/resources/arrow_up.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/background.png b/src/com/gitblit/wicket/resources/background.png deleted file mode 100644 index 6f75e43d..00000000 Binary files a/src/com/gitblit/wicket/resources/background.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/blank.png b/src/com/gitblit/wicket/resources/blank.png deleted file mode 100644 index 109296b9..00000000 Binary files a/src/com/gitblit/wicket/resources/blank.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/book_16x16.png b/src/com/gitblit/wicket/resources/book_16x16.png deleted file mode 100644 index e48ff95e..00000000 Binary files a/src/com/gitblit/wicket/resources/book_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/bug_16x16.png b/src/com/gitblit/wicket/resources/bug_16x16.png deleted file mode 100644 index c7299fd7..00000000 Binary files a/src/com/gitblit/wicket/resources/bug_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/bullet_error.png b/src/com/gitblit/wicket/resources/bullet_error.png deleted file mode 100644 index b2e6b752..00000000 Binary files a/src/com/gitblit/wicket/resources/bullet_error.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/cold_16x16.png b/src/com/gitblit/wicket/resources/cold_16x16.png deleted file mode 100644 index 79cb7567..00000000 Binary files a/src/com/gitblit/wicket/resources/cold_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/commit_branch_16x16.png b/src/com/gitblit/wicket/resources/commit_branch_16x16.png deleted file mode 100644 index d1fe7175..00000000 Binary files a/src/com/gitblit/wicket/resources/commit_branch_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/commit_divide_16x16.png b/src/com/gitblit/wicket/resources/commit_divide_16x16.png deleted file mode 100644 index e611bd57..00000000 Binary files a/src/com/gitblit/wicket/resources/commit_divide_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/commit_join_16x16.png b/src/com/gitblit/wicket/resources/commit_join_16x16.png deleted file mode 100644 index 51e7de97..00000000 Binary files a/src/com/gitblit/wicket/resources/commit_join_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/commit_merge_16x16.png b/src/com/gitblit/wicket/resources/commit_merge_16x16.png deleted file mode 100644 index 5a066e59..00000000 Binary files a/src/com/gitblit/wicket/resources/commit_merge_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/commit_up_16x16.png b/src/com/gitblit/wicket/resources/commit_up_16x16.png deleted file mode 100644 index 30d005f2..00000000 Binary files a/src/com/gitblit/wicket/resources/commit_up_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/feed_16x16.png b/src/com/gitblit/wicket/resources/feed_16x16.png deleted file mode 100644 index 99987a30..00000000 Binary files a/src/com/gitblit/wicket/resources/feed_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/file_16x16.png b/src/com/gitblit/wicket/resources/file_16x16.png deleted file mode 100644 index eda44886..00000000 Binary files a/src/com/gitblit/wicket/resources/file_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/file_acrobat_16x16.png b/src/com/gitblit/wicket/resources/file_acrobat_16x16.png deleted file mode 100644 index f1627837..00000000 Binary files a/src/com/gitblit/wicket/resources/file_acrobat_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/file_c_16x16.png b/src/com/gitblit/wicket/resources/file_c_16x16.png deleted file mode 100644 index 44045a9b..00000000 Binary files a/src/com/gitblit/wicket/resources/file_c_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/file_code_16x16.png b/src/com/gitblit/wicket/resources/file_code_16x16.png deleted file mode 100644 index 931b0d6a..00000000 Binary files a/src/com/gitblit/wicket/resources/file_code_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/file_cpp_16x16.png b/src/com/gitblit/wicket/resources/file_cpp_16x16.png deleted file mode 100644 index d3f55ee0..00000000 Binary files a/src/com/gitblit/wicket/resources/file_cpp_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/file_cs_16x16.png b/src/com/gitblit/wicket/resources/file_cs_16x16.png deleted file mode 100644 index 80130209..00000000 Binary files a/src/com/gitblit/wicket/resources/file_cs_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/file_doc_16x16.png b/src/com/gitblit/wicket/resources/file_doc_16x16.png deleted file mode 100644 index 225c3b09..00000000 Binary files a/src/com/gitblit/wicket/resources/file_doc_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/file_excel_16x16.png b/src/com/gitblit/wicket/resources/file_excel_16x16.png deleted file mode 100644 index 04e03327..00000000 Binary files a/src/com/gitblit/wicket/resources/file_excel_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/file_h_16x16.png b/src/com/gitblit/wicket/resources/file_h_16x16.png deleted file mode 100644 index 3f7f5394..00000000 Binary files a/src/com/gitblit/wicket/resources/file_h_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/file_java_16x16.png b/src/com/gitblit/wicket/resources/file_java_16x16.png deleted file mode 100644 index 16620e5c..00000000 Binary files a/src/com/gitblit/wicket/resources/file_java_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/file_php_16x16.png b/src/com/gitblit/wicket/resources/file_php_16x16.png deleted file mode 100644 index 4ac56183..00000000 Binary files a/src/com/gitblit/wicket/resources/file_php_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/file_ppt_16x16.png b/src/com/gitblit/wicket/resources/file_ppt_16x16.png deleted file mode 100644 index 44bbf26f..00000000 Binary files a/src/com/gitblit/wicket/resources/file_ppt_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/file_ruby_16x16.png b/src/com/gitblit/wicket/resources/file_ruby_16x16.png deleted file mode 100644 index f29349da..00000000 Binary files a/src/com/gitblit/wicket/resources/file_ruby_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/file_settings_16x16.png b/src/com/gitblit/wicket/resources/file_settings_16x16.png deleted file mode 100644 index 92953fec..00000000 Binary files a/src/com/gitblit/wicket/resources/file_settings_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/file_vs_16x16.png b/src/com/gitblit/wicket/resources/file_vs_16x16.png deleted file mode 100644 index 645fa7a0..00000000 Binary files a/src/com/gitblit/wicket/resources/file_vs_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/file_world_16x16.png b/src/com/gitblit/wicket/resources/file_world_16x16.png deleted file mode 100644 index 0a4fa8be..00000000 Binary files a/src/com/gitblit/wicket/resources/file_world_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/file_zip_16x16.png b/src/com/gitblit/wicket/resources/file_zip_16x16.png deleted file mode 100644 index 15845924..00000000 Binary files a/src/com/gitblit/wicket/resources/file_zip_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/folder_16x16.png b/src/com/gitblit/wicket/resources/folder_16x16.png deleted file mode 100644 index f1ed9abe..00000000 Binary files a/src/com/gitblit/wicket/resources/folder_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/gitblit.css b/src/com/gitblit/wicket/resources/gitblit.css deleted file mode 100644 index 498c1a77..00000000 --- a/src/com/gitblit/wicket/resources/gitblit.css +++ /dev/null @@ -1,819 +0,0 @@ -/* - Git:Blit css. -*/ -html, body, table, dl, dt, dd, ol, ul, li, form, a, span, tr, th, td, div, em { - font-family: verdana, sans-serif; - font-size: 12px; - line-height: 1.35em; - margin: 0; - padding: 0; - border: 0; - outline: 0; -} - -body { - width: 980px; - margin: 5px; - background-color: #ffffff; - color: #000000; - margin-right: auto; - margin-left: auto; - padding: 0px; - background: url(background.png) repeat-x scroll 0 0 #FFFFFF; -} - -pre, code, pre.prettyprint, pre.plainprint { - color: black; - font-family: monospace; - font-size:12px; - border:0px; -} - -pre.prettyprint ol { - padding-left:25px; -} - -/* age0: age < 60*60*2 */ -.age0 { - color: #008000; - font-style: italic; - font-weight: bold; -} - -/* age1: 60*60*2 <= age < 60*60*24*2 */ -.age1 { - color: #008000; - font-style: italic; -} - -/* age2: 60*60*24*2 <= age */ -.age2 { - font-style: italic; -} - -img.inlineIcon { - padding-left: 1px; - padding-right: 1px; -} - -a { - color: #0000cc; -} - -a:hover, a:visited, a:active { - color: #880000; -} - -img.logo { - float: right; - border-width: 0px; -} - -img.activityGraph { - float: right; - border-width: 0px; - padding: 8px; -} - -div.repositories_message { - line-height: inherit; -} - -div.header, div.commitHeader { - background-color: #D2C3AF; - padding: 3px; - border: 1px solid #808080; -} - -div.header { - border-radius: 3px 3px 0 0; -} - -div.commitHeader { - border-radius: 3px; -} - -div.header a, div.commitHeader a { - color: black; - text-decoration: none; - font-weight: bold; -} - -div.header a:hover, div.commitHeader a:hover { - text-decoration: underline; -} - -div.pager { - padding: 0px 0px 15px 5px; -} - -span.empty { - font-size: 0.9em; - font-style: italic; - padding-left:10px; - color: #008000; -} - -span.link { - color: #888; -} - -span.link, span.link a { - font-family: sans-serif; - font-size: 11px; -} - -span.link em, div.link span em { - font-style: normal; - font-family: sans-serif; - font-size: 11px; -} - -div.page_header { - height: 25px; - padding: 5px; - font-family: sans-serif; - font-weight: bold; - font-size: 150%; - color: #888; - background: transparent; -} - -div.page_header span { - font-family: inherit; - font-size: inherit; -} - -div.page_header a { - font-size: inherit; - font-family: inherit; - text-decoration: none; -} - -div.page_header a:visited { - color: #000000; -} - -div.page_header a:hover { - color: #E66C2C; - text-decoration: underline; -} - -div.page_footer { - clear: both; - height: 17px; - color: black; - background-color: #ffffff; - padding: 5px; - border-top: 1px solid #bbb; - font-style: italic; -} - -div.page_nav { - color: #ddd; - background-color: #000070; - padding: 7px; - border-radius: 3px; -} - -div.page_nav a { - color: yellow; - text-decoration: none; -} - -div.page_nav a:hover { - text-decoration: underline; -} - -div.page_nav em { - font-style: normal; -} - -div.page_nav2 { - padding: 2px 5px 7px 5px; -} - -div.admin_nav { - border: 1px solid #888; - border-bottom: 0px; - background:#dae0d2; - text-align: right; - padding: 5px 5px 5px 2px; -} - -div.admin_nav a { - text-decoration: none; -} - -div.admin_nav a:hover { - text-decoration: underline; -} - -div.search { - color:yellow; - text-align:right; - float:right; - padding:4px 4px 3px 3px; - border-left: 1px solid #8080f0; - margin: 0px; - height: 23px; -} - -div.search input { - vertical-align: top; - background: url(/com/gitblit/wicket/resources/search-icon.png) no-repeat 4px center; - color: #ddd; - background-color: #000070; - border: 1px solid transparent; - padding: 2px 2px 2px 22px; - margin: 0px; -} - -div.search input:hover, div.search input:focus { - color: white; - border-bottom: 1px solid orange; - outline: none; -} - -div.page_path { - padding: 8px; - font-weight: bold; - border: solid #bbb; - border-width: 0px 0px 1px; -} - -div.commit_message { - font-family: monospace; - padding: 8px; - border: solid #bbb; - border-width: 1px 0px 0px; -} - -div.commit_message a { - font-family: monospace; -} - -div.bug_open, span.bug_open { - padding: 2px; - background-color: #803333; - color: white; - text-align: center; -} - -div.bug_resolved, span.bug_resolved { - padding: 2px; - background-color: #408040; - color: white; - text-align: center; -} - -div.bug_invalid, span.bug_invalid { - padding: 2px; - background-color: gray; - text-align: center; -} - -div.bug_hold, span.bug_hold { - padding: 2px; - background-color: orange; - text-align: center; -} - -div.diff { - font-family: monospace; - overflow: auto; -} - -div.diff.header { - -moz-border-bottom-colors: none; - -moz-border-image: none; - -moz-border-left-colors: none; - -moz-border-right-colors: none; - -moz-border-top-colors: none; - background-color: #EDECE6; - border-color: #D9D8D1; - border-style: solid; - border-width: 1px; - font-weight: bold; - margin-top: 10px; - padding: 4px 0 2px; -} - -div.diff.extended_header { - background-color: #F6F5EE; - padding: 2px 0; - font-family: inherit; -} - -span.diff.add { - color: #008800; - font-family: inherit; -} - -span.diff.remove { - color: #FFDDDD; - font-family: inherit; -} - -span.diff.unchanged { - color: inherit; - font-family: inherit; -} - -div.diff.hunk_header { - -moz-border-bottom-colors: none; - -moz-border-image: none; - -moz-border-left-colors: none; - -moz-border-right-colors: none; - -moz-border-top-colors: none; - border-color: #FFE0FF; - border-style: dotted; - border-width: 1px 0 0; - margin-top: 2px; - font-family: inherit; -} - -span.diff.hunk_info { - background-color: #FFEEFF; - color: #990099; - font-family: inherit; -} - -span.diff.hunk_section { - color: #AA22AA; - font-family: inherit; -} - -div.diff.add2 { - background-color: #DDFFDD; - font-family: inherit; -} - -div.diff.remove2 { - background-color: #FFDDDD; - font-family: inherit; -} - -div.diff table { - border-right: 1px solid #bbb; - border-bottom: 1px solid #bbb; - width: 100%; -} - -div.diff table th, div.diff table td { - margin: 0px; - padding: 0px; - font-family: monospace; -} - -div.diff table th { - background-color: #faf8dc; - border-left: 1px solid #bbb; - text-align: center; - color: #999; - padding-left: 5px; - padding-right: 5px; - width: 30px; -} - -div.diff table th.header { - background-color: #D2C3AF; - border-right: 0px; - border-bottom: 1px solid #808080; - font-family: inherit; - font-size:0.9em; - color: black; - padding: 2px; - text-align: left; -} - -div.diff table td.hunk_header { - background-color: #dAe2e5 !important; - border-bottom: 1px solid #bac2c5; - color: #555; -} - -div.diff table td { - border-left: 1px solid #bbb; - background-color: #fbfbfb; -} - -td.changeType { - width: 15px; -} - -span.addition, span.modification, span.deletion, span.rename { - border: 1px solid #888; - float: left; - height: 0.8em; - margin: 0.2em 0.5em 0 0; - overflow: hidden; - width: 0.8em; -} - -span.addition { - background-color: #ccffcc; -} - -span.modification { - background-color: #ffdd88; -} - -span.deletion { - background-color: #f8bbbb; -} - -span.rename { - background-color: #cAc2f5; -} - -div.commitLegend { - float: right; - padding: 0.4em 0.4em 0.2em 0.4em; - vertical-align:top; - margin: 0px; -} - -div.commitLegend span { - font-size: 0.9em; - vertical-align: top; -} - -div.references { - float: right; - text-align: right; -} - -a.list { - text-decoration: none; - color: #000000; -} - -a.list.subject { - font-weight: bold; -} - -a.list.name { - font-weight: bold; -} - -a.list:hover { - text-decoration: underline; - color: #880000; -} - -table { - border-spacing: 0px; -} - -th { - padding: 2px 5px; - font-size: 100%; - text-align: left; -} - -table.screenshots td { - text-align: center; - padding-bottom: 10px; -} - -table.screenshots img { - border: 1px solid #ccc; - margin: 5px; -} - -table.plain { - padding: 8px; -} - -table.plain td { - white-space: nowrap; -} - -table.plain td.edit { - padding: 3px; -} - -table.plain td.editButton { - padding:0px; - padding-top: 10px; -} - -table.plain td.edit input { - margin: 0px; - outline: 1px solid transparent; - border: 1px solid #ccc; - padding-left:5px; -} - -table.plain td.edit input:focus, table.plain td.edit input:hover{ - border: 1px solid orange; -} - -table.pretty, table.comments { - margin-bottom:5px; - border-spacing: 0px; - border-left: 1px solid #bbb; - border-right: 1px solid #bbb; -} - -table.pretty, table.comments, table.repositories, table.gitnotes { - width:100%; -} - -table.pretty td.icon { - padding: 0px 0px 0px 2px; - width: 18px; -} - -table.pretty td.icon img { - vertical-align: top; -} - -table.pretty td { - padding: 2px 4px; -} - -table.comments td { - padding: 4px; - line-height: 17px; -} - -table.repositories { - margin-bottom:5px; - border-spacing: 0px; -} - -table.repositories th { - background-color:#D2C3AF; - padding: 4px; - border-top: 1px solid #808080; - border-bottom: 1px solid #808080; -} - -table.repositories th.left, table.repositories td.left { - border-left: 1px solid #808080; - padding-left: 5px; -} - -table.repositories td.left { - padding-left: 10px; -} - -table.repositories th.right, table.repositories td.right { - border-right: 1px solid #808080; -} - -table.repositories td { - padding: 2px; -} - -table.repositories td.rightAlign { - text-align: right; - border-right: 1px solid #808080; -} - -table.repositories td.icon img { - vertical-align: top; -} - -table.repositories th a { - color:black;/*#ddd;*/ - text-decoration: none; - font-weight: normal; -} - -table.repositories th a:hover { - text-decoration: underline; -} - -table.repositories th.wicket_orderDown a, table.repositories th.wicket_orderUp a { - color: black; - font-weight: bold; -} - -table.repositories tr.group { - background-color: #E66C2C; -} - -table.repositories tr.group td { - font-weight: bold; - border-bottom: 1px solid orange; - color: white; - background-color: #E66C2C; - border-left: 1px solid #808080; - border-right: 1px solid #808080; - padding-left: 5px; -} - -table.palette { border:0;} -table.palette td.header { - font-weight: bold; - background-color: #D2C3AF !important; - padding: 3px !important; - border: 1px solid #808080 !important; - border-bottom: 0px solid !important; - border-radius: 3px 3px 0 0; -} -table.palette td.pane { - padding: 0px; -} - -table.gitnotes { - padding-bottom: 5px; -} -table.gitnotes td { - border-top: 1px solid #ccc; - padding-top: 3px; - vertical-align:top; -} - -table.gitnotes td table td { - border: none; - padding-top: 0px; -} - -table.gitnotes td.info { -} - -table.gitnotes td.message { - width: 65%; - border-left: 1px solid #ccc; -} - -table.annotated { - width: 100%; - border: 1px solid #bbb; -} - -table.annotated tr.even { - background-color: white; -} - -table.annotated tr.odd { - background-color: #fdfbdf; -} - -tr th a { padding-right: 15px; background-position: right; background-repeat:no-repeat; } -tr th.wicket_orderDown a {background-image: url(arrow_down.png); } -tr th.wicket_orderUp a { background-image: url(arrow_up.png); } -tr th.wicket_orderNone a { background-image: url(arrow_off.png); } - -tr.light { - background-color: #ffffff; -} - -tr.light td { - border-bottom: 1px solid #bbb; -} - -tr.dark { - background-color: #faf8dc; - border-bottom: 1px solid #bbb; -} - -tr.dark td { - border-bottom: 1px solid #bbb; -} - -/* currently both use the same, but it can change */ -tr.light:hover, -tr.dark:hover { - /*background-color: #0099b7;*/ - background-color: #000070; - color: white; -} - -tr.light:hover a, -tr.dark:hover a { - color: white; -} - -td { - padding-left: 7px; - padding-right: 7px; -} - -td.author { - font-style: italic; -} - -td.date { - font-style: italic; -} - -span.sha1, span.sha1 a, span.sha1 a span { - font-family: monospace; - font-size: 13px; -} - -td.mode { - text-align: right; - font-family: monospace; - width: 8em; - padding-right:15px; -} - -td.size { - text-align: right; - width: 8em; - padding-right:15px; -} - -td.rightAlign { - text-align: right; -} - -td.treeLinks { - text-align: right; - width: 13em; -} - -span.metricsTitle { - font-size: 2em; -} - -span .tagRef, span .headRef, span .localBranch, span .remoteBranch, span .otherRef { - padding: 0px 3px; - margin-right:2px; - font-family: sans-serif; - font-size: 9px; - font-weight: normal; - border: 1px solid; - color: black; -} - -span .tagRef a span, span .headRef a span, span .localBranch a span, span .remoteBranch a span, span .otherRef a span { - font-size: 9px; -} - -span .tagRef a, span .headRef a, span .localBranch a, span .remoteBranch a, span .otherRef a { - text-decoration: none; - color: black !important; -} - -span .tagRef a:hover, span .headRef a:hover, span .localBranch a:hover, span .remoteBranch a:hover, span .otherRef a:hover { - color: black !important; - text-decoration: underline; -} - -span .otherRef { - background-color: #b0e0f0; - border-color: #80aaaa; -} - -span .remoteBranch { - background-color: #cAc2f5; - border-color: #6c6cbf; -} - -span .tagRef { - background-color: #ffffaa; - border-color: #ffcc00; -} - -span .headRef { - background-color: #ffaaff; - border-color: #ff00ee; -} - -span .localBranch { - background-color: #ccffcc; - border-color: #00cc33; -} - -.feedbackPanelERROR { - color: red; - list-style-image: url(bullet_error.png); - font-weight: bold; - vertical-align: top; - padding:0; - margin:0; -} - -.feedbackPanelINFO { - color: green; - list-style: none; - font-weight: bold; - padding:0; - margin:0; -} - -/* google-code-prettify line numbers */ -li.L0, -li.L1, -li.L2, -li.L3, -li.L4, -li.L5, -li.L6, -li.L7, -li.L8, -li.L9 { color: #888; border-left: 1px solid #ccc; padding-left:5px; list-style-type: decimal !important; } - -/* Alternate shading for lines */ -li.L1, -li.L3, -li.L5, -li.L7, -li.L9 { background: #fafafa !important; } \ No newline at end of file diff --git a/src/com/gitblit/wicket/resources/gitblt-favicon.png b/src/com/gitblit/wicket/resources/gitblt-favicon.png deleted file mode 100644 index f6ac1540..00000000 Binary files a/src/com/gitblit/wicket/resources/gitblt-favicon.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/gitblt-logo.png b/src/com/gitblit/wicket/resources/gitblt-logo.png deleted file mode 100644 index 7ec945b5..00000000 Binary files a/src/com/gitblit/wicket/resources/gitblt-logo.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/gitblt2.png b/src/com/gitblit/wicket/resources/gitblt2.png deleted file mode 100644 index c1642941..00000000 Binary files a/src/com/gitblit/wicket/resources/gitblt2.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/gitblt_25.png b/src/com/gitblit/wicket/resources/gitblt_25.png deleted file mode 100644 index ad580fad..00000000 Binary files a/src/com/gitblit/wicket/resources/gitblt_25.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/gitweb-favicon.png b/src/com/gitblit/wicket/resources/gitweb-favicon.png deleted file mode 100644 index de637c06..00000000 Binary files a/src/com/gitblit/wicket/resources/gitweb-favicon.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/lock_16x16.png b/src/com/gitblit/wicket/resources/lock_16x16.png deleted file mode 100644 index ddf83d95..00000000 Binary files a/src/com/gitblit/wicket/resources/lock_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/lock_go_16x16.png b/src/com/gitblit/wicket/resources/lock_go_16x16.png deleted file mode 100644 index 63d42859..00000000 Binary files a/src/com/gitblit/wicket/resources/lock_go_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/lock_pull_16x16.png b/src/com/gitblit/wicket/resources/lock_pull_16x16.png deleted file mode 100644 index 85c5c53e..00000000 Binary files a/src/com/gitblit/wicket/resources/lock_pull_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/markdown.css b/src/com/gitblit/wicket/resources/markdown.css deleted file mode 100644 index 41bc4392..00000000 --- a/src/com/gitblit/wicket/resources/markdown.css +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Git:Blit Markdown CSS definition. - */ - -div.markdown { - line-height: 1.4em; -} - -div.markdown h1, -div.markdown h2, -div.markdown h3, -div.markdown h4, -div.markdown h5, -div.markdown h6 { - border: 0 none !important; -} - -div.markdown h1 { - margin-top: 1em; - margin-bottom: 0.5em; - padding-bottom: 0.5em; - border-bottom: 2px solid #000080 !important; -} - -div.markdown h2 { - margin-top: 1em; - margin-bottom: 0.5em; - padding-bottom: 0.5em; - border-bottom: 2px solid #000080 !important; -} - -div.markdown pre { - background-color: #f8f8f8; - border: 1px solid #2f6fab; - border-radius: 3px; - overflow: auto; - padding: 5px; -} - -div.markdown pre code { - background-color: inherit; - border: none; - padding: 0; -} - -div.markdown code { - background-color: #ffffe0; - border: 1px solid orange; - border-radius: 3px; - padding: 0 0.2em; -} - -div.markdown a { - text-decoration: underline; -} - -div.markdown ul, div.markdown ol { - padding-left: 30px; -} - -div.markdown li { - margin: 0.2em 0 0 0em; padding: 0px; -} - -div.markdown em { - color: #b05000; -} \ No newline at end of file diff --git a/src/com/gitblit/wicket/resources/pixel.png b/src/com/gitblit/wicket/resources/pixel.png deleted file mode 100644 index 4d5f6df1..00000000 Binary files a/src/com/gitblit/wicket/resources/pixel.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/search-icon.png b/src/com/gitblit/wicket/resources/search-icon.png deleted file mode 100644 index 90e8d2c6..00000000 Binary files a/src/com/gitblit/wicket/resources/search-icon.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/shield_16x16.png b/src/com/gitblit/wicket/resources/shield_16x16.png deleted file mode 100644 index 4eb8031c..00000000 Binary files a/src/com/gitblit/wicket/resources/shield_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/tag_16x16.png b/src/com/gitblit/wicket/resources/tag_16x16.png deleted file mode 100644 index 7e75cba0..00000000 Binary files a/src/com/gitblit/wicket/resources/tag_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/user_16x16.png b/src/com/gitblit/wicket/resources/user_16x16.png deleted file mode 100644 index d5edd4d4..00000000 Binary files a/src/com/gitblit/wicket/resources/user_16x16.png and /dev/null differ diff --git a/src/com/gitblit/wicket/resources/welcome.mkd b/src/com/gitblit/wicket/resources/welcome.mkd deleted file mode 100644 index 130cd8ac..00000000 --- a/src/com/gitblit/wicket/resources/welcome.mkd +++ /dev/null @@ -1,3 +0,0 @@ -## Welcome to Gitblit - -A quick and easy way to host or view your own [Git](http://www.git-scm.com) repositories. diff --git a/src/log4j.properties b/src/log4j.properties index 16f12363..dc6dd2b5 100644 --- a/src/log4j.properties +++ b/src/log4j.properties @@ -1,12 +1,66 @@ -log4j.debug=false +#------------------------------------------------------------------------------ +# +# The following properties set the logging levels and log appender. The +# log4j.rootCategory variable defines the default log level and one or more +# appenders. For the console, use 'S'. For the daily rolling file, use 'R'. +# For an HTML formatted log, use 'H'. +# +# To override the default (rootCategory) log level, define a property of the +# form (see below for available values): +# +# log4j.logger. = +# +# Available logger names: +# TODO +# +# Possible Log Levels: +# FATAL, ERROR, WARN, INFO, DEBUG +# +#------------------------------------------------------------------------------ +log4j.rootCategory=INFO, S -log4j.rootLogger=INFO -log4j.logger.org=INFO -log4j.logger.com=INFO -log4j.logger.net=INFO +#log4j.rootLogger=INFO +#log4j.logger.org=INFO +#log4j.logger.com=INFO +#log4j.logger.net=INFO -log4j.logger.com.gitblit=DEBUG +#log4j.logger.com.gitblit=DEBUG log4j.logger.org.apache.wicket=INFO log4j.logger.org.apache.wicket.RequestListenerInterface=WARN log4j.logger.org.apache.wicket.protocol.http.HttpSessionStore=WARN + +#------------------------------------------------------------------------------ +# +# The following properties configure the console (stdout) appender. +# See http://logging.apache.org/log4j/docs/api/index.html for details. +# +#------------------------------------------------------------------------------ +log4j.appender.S = org.apache.log4j.ConsoleAppender +log4j.appender.S.layout = org.apache.log4j.PatternLayout +log4j.appender.S.layout.ConversionPattern = %-5p %m%n + +#------------------------------------------------------------------------------ +# +# The following properties configure the Daily Rolling File appender. +# See http://logging.apache.org/log4j/docs/api/index.html for details. +# +#------------------------------------------------------------------------------ +log4j.appender.R = org.apache.log4j.DailyRollingFileAppender +log4j.appender.R.File = logs/gitblit.log +log4j.appender.R.Append = true +log4j.appender.R.DatePattern = '.'yyy-MM-dd +log4j.appender.R.layout = org.apache.log4j.PatternLayout +log4j.appender.R.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n + +#------------------------------------------------------------------------------ +# +# The following properties configure the Rolling File appender in HTML. +# See http://logging.apache.org/log4j/docs/api/index.html for details. +# +#------------------------------------------------------------------------------ +log4j.appender.H = org.apache.log4j.RollingFileAppender +log4j.appender.H.File = logs/gitblit.html +log4j.appender.H.MaxFileSize = 100KB +log4j.appender.H.Append = false +log4j.appender.H.layout = org.apache.log4j.HTMLLayout
- - - + [username]