--- /dev/null
+## Documentation\r
+\r
+This documentation is the source content from which the [Gitblit website](http://gitblit.com) is generated.\r
+\r
+### About Gitblit\r
+\r
+[[src/site/features.mkd]]\r
+[[src/site/design.mkd]]\r
+[[src/site/faq.mkd]]\r
+\r
+### Gitblit GO\r
+\r
+[[src/site/setup_go.mkd]]\r
+[[src/site/upgrade_go.mkd]]\r
+\r
+### Gitblit WAR\r
+\r
+[[src/site/setup_war.mkd]]\r
+[[src/site/upgrade_war.mkd]]\r
+\r
+### Gitblit Express for OpenShift\r
+\r
+[[src/site/setup_express.mkd]]\r
+[[src/site/upgrade_express.mkd]]\r
+\r
+### General Configuration & Administration\r
+\r
+[[src/site/setup_authentication.mkd]]\r
+[[src/site/setup_client.mkd]]\r
+[[src/site/setup_clientmenus.mkd]]\r
+[[src/site/setup_hooks.mkd]]\r
+[[src/site/setup_lucene.mkd]]\r
+[[src/site/setup_proxy.mkd]]\r
+[[src/site/setup_viewer.mkd]]\r
+[[src/site/administration.mkd]]\r
+\r
+### Other Pages\r
+\r
+[[src/site/federation.mkd]]\r
+[[src/site/rpc.mkd]]\r
Gitblit\r
=================\r
\r
-Gitblit is an open source, pure Java Git solution for managing, viewing, and serving [Git](http://git-scm.com) repositories.<br/>\r
+Gitblit is an open source, pure Java Git solution for managing, viewing, and serving [Git](http://git-scm.com) repositories.\r
More information about Gitblit can be found [here](http://gitblit.com).\r
\r
License\r
-------\r
\r
-Gitblit is distributed under the terms of the [Apache Software Foundation license, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).<br/>\r
+Gitblit is distributed under the terms of the [Apache Software Foundation license, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).\r
The text of the license is included in the file LICENSE in the root of the project.\r
\r
Java Runtime Requirement\r
Getting help\r
------------\r
\r
-Read the online documentation available at the [Gitblit website](http://gitblit.com)<br/>\r
+Read the online documentation available at the [Gitblit website](http://gitblit.com)\r
Issues, binaries, & sources @ [Google Code](http://code.google.com/p/gitblit)\r
\r
Building Gitblit\r
----------------\r
[Eclipse](http://eclipse.org) is recommended for development as the project settings are preconfigured.\r
\r
-1. Import the gitblit project into your Eclipse workspace.<br/>\r
+1. Import the gitblit project into your Eclipse workspace.\r
*There will be lots of build errors.*\r
-2. Using Ant, execute the `build.xml` script in the project root.<br/>\r
+2. Using Ant, execute the `build.xml` script in the project root.\r
*This will download all necessary build dependencies and will also generate the Keys class for accessing settings.*\r
3. Select your gitblit project root and **Refresh** the project, this should correct all build problems.\r
-4. Using JUnit, execute the `com.gitblit.tests.GitBlitSuite` test suite.<br/>\r
+4. Using JUnit, execute the `com.gitblit.tests.GitBlitSuite` test suite.\r
*This will clone some repositories from the web and run through the unit tests.*\r
5. Execute the *com.gitblit.GitBlitServer* class to start Gitblit GO.\r
\r
Building Tips & Tricks\r
----------------------\r
-1. If you are running Ant from an ANSI-capable console, consider setting the `MX_COLOR` ennvironment variable before executing Ant.<pre>set MX_COLOR=true</pre>\r
+1. If you are running Ant from an ANSI-capable console, consider setting the `MX_COLOR` environment variable before executing Ant.<pre>set MX_COLOR=true</pre>\r
2. The build script will honor your Maven proxy settings. If you need to fine-tune this, please review the [settings.moxie](http://gitblit.github.io/moxie/settings.html) documentation.
\ No newline at end of file
}\r
\r
div.markdown pre {\r
- background-color: rgb(251, 251, 251);\r
+ background-color: rgb(250, 250, 250);\r
border: 1px solid rgb(221, 221, 221);\r
border-radius: 4px 4px 4px 4px;\r
display: block;\r
font-size: 12px;\r
line-height: 18px;\r
- margin: 0 0 9px;\r
+ margin: 9px 0;\r
padding: 8.5px;\r
white-space: pre-wrap;\r
}\r
}\r
\r
div.markdown code {\r
- background-color: rgb(251, 251, 251);\r
+ background-color: rgb(250, 250, 250);\r
border: 1px solid rgb(221, 221, 221);\r
border-radius: 3px;\r
padding: 0 0.2em;\r
**How is this enforced?**\r
\r
Bob must set his *user.name* and *user.email* values for the repository to match his Gitblit user account **BEFORE** committing to his repository.\r
-<pre>\r
+\r
+```\r
[user "bob"]\r
displayName = Bob Jones\r
emailAddress = bob@somewhere.com\r
-</pre>\r
-<pre>\r
+```\r
+\r
git config user.name "Bob Jones"\r
git config user.email bob@somewhere.com \r
-</pre>\r
or\r
\r
git config user.name bob\r
Gitblit is not meant to be a social coding resource like [Github](http://github.com) or [Bitbucket](http://bitbucket.com) with 100s or 1000s of users. Gitblit is designed to fulfill the same function as your centralized Subversion or CVS server.\r
\r
### Why does Gitblit exist when there is Git and Gitweb?\r
-As a Java developer I prefer that as much of my tooling as possible is Java.<br/>\r
+As a Java developer I prefer that as much of my tooling as possible is Java.\r
Originally, I was going to use [Mercurial](http://mercurial.selenic.com) but...\r
\r
-- MercurialEclipse [shells to Python, writes to System.out, and captures System.in](http://mercurial.808500.n3.nabble.com/Hg4J-Mercurial-pure-Java-library-tp2693090p2694555.html)<br/>\r
+- MercurialEclipse [shells to Python, writes to System.out, and captures System.in](http://mercurial.808500.n3.nabble.com/Hg4J-Mercurial-pure-Java-library-tp2693090p2694555.html)\r
Parsing command-line output is fragile and suboptimal.<br/>Unfortunately this is necessary because Mercurial is an application, not a library.\r
-- Mercurial HTTP/HTTPS needs to run as CGI through Apache/IIS/etc, as mod_python through Apache, or served with a built-in http server.<br/>\r
+- Mercurial HTTP/HTTPS needs to run as CGI through Apache/IIS/etc, as mod_python through Apache, or served with a built-in http server.\r
This requires setup and maintenance of multiple, mixed 3rd party components.\r
\r
Gitblit eliminates all that complication with its 100% Java stack and simple single configuration file.\r
Additionally, Git and Gitweb do not offer repository creation or user management.\r
\r
### Do I need real Git?\r
-No (mostly). Gitblit is based on [JGit][jgit] which is a pure Java implementation of the [Git version control system][git].<br/>\r
+No (mostly). Gitblit is based on [JGit][jgit] which is a pure Java implementation of the [Git version control system][git].\r
Everything you need for Gitblit (except Java) is either bundled in the distribution file or automatically downloaded on execution.\r
\r
#### mostly\r
\r
As of 0.9.0, Gitblit supports Lucene-based searching.\r
\r
-If Lucene indexing is disabled, Gitblit falls back to brute-force commit-traversal search. Commit-traversal search supports case-insensitive searching of *commit message* (default), *author*, and *committer*.<br/>\r
+If Lucene indexing is disabled, Gitblit falls back to brute-force commit-traversal search. Commit-traversal search supports case-insensitive searching of *commit message* (default), *author*, and *committer*.\r
\r
To search by *author* or *committer* use the following syntax in the search box:\r
\r
If you want your repositories (and optionally users accounts and settings) to be pulled by another Gitblit instance, you need to register your origin Gitblit instance with a pulling Gitblit instance by providing the url of your Gitblit instance and a federation token.\r
\r
Gitblit generates the following standard federation tokens:\r
----JAVA---\r
+\r
+```java\r
String allToken = SHA1(passphrase + "-ALL");\r
String usersAndRepositoriesToken = SHA1(passphrase + "-USERS_AND_REPOSITORIES");\r
String repositoriesToken = SHA1(passphrase + "-REPOSITORIES");\r
----JAVA---\r
- \r
+```\r
+\r
The *ALL* token allows another Gitblit instance to pull all your repositories, user accounts, server settings, and referenced push scripts. \r
The *USERS_AND_REPOSITORIES* token allows another Gitblit instance to pull all your repositories and user accounts. \r
The *REPOSITORIES* token only allows pulling of the repositories.\r
## JSON Remote Procedure Call (RPC) Interface\r
\r
### RPC Protocol Versions\r
+\r
<table class="table">\r
<tbody>\r
<tr><th>Release</th><th>Protocol Version</th></tr>\r
Use *SET_REPOSITORY_TEAM_PERMISSIONS* instead.\r
\r
### RPC Request and Response Types\r
+\r
<table class="table">\r
<tr><th colspan='2'>url parameters</th><th rowspan='2'>required<br/>user<br/>permission</th><th rowspan='2'>protocol<br/>version</th><th colspan='2'>json</th></tr>\r
<tr><th>req=</th><th>name=</th><th>post body</th><th>response body</th></tr>\r
</table>\r
\r
### RPC/HTTP Response Codes\r
+\r
<table class="table">\r
<tr><th>code</th><th>name</th><th>description</th></tr>\r
<tr><td>200</td><td>success</td><td>Gitblit processed the request successfully</td></tr>\r
\r
**url**: https://localhost/rpc?req=LIST_REPOSITORIES \r
**response body**: Map<String, RepositoryModel> where the map key is the clone url of the repository\r
-<pre>\r
+\r
+```json\r
{\r
"https://localhost/git/libraries/xmlapache.git": {\r
"name": "libraries/xmlapache.git",\r
"size": "4.8 MB"\r
}\r
}\r
-</pre>\r
+```\r
\r
### Example: EDIT_REPOSITORY (rename)\r
\r
\r
**url**: https://localhost/rpc?req=EDIT_REPOSITORY&name=libraries/xmlapache.git \r
**post body**: RepositoryModel\r
-<pre>\r
+\r
+```json\r
{\r
"name": "libraries/xmlapache-renamed.git",\r
"description": "apache xmlrpc client and server",\r
"skipSummaryMetrics": false,\r
"size": "102 KB"\r
}\r
-</pre>\r
+```\r
\r
### Example: LIST_USERS\r
**url**: https://localhost/rpc?req=LIST_USERS \r
**response body**: List<UserModel>\r
-<pre>\r
+\r
+```json\r
[\r
{\r
"username": "admin",\r
]\r
}\r
]\r
-</pre>\r
+```\r
\r
### Example: LIST_SETTINGS\r
**url**: https://localhost/rpc?req=LIST_SETTINGS \r
**response body**: ServerSettings\r
-<pre>\r
+\r
+```json\r
{\r
"settings": {\r
"web.siteName": {\r
}\r
}\r
}\r
-</pre>\r
+```\r
\r
### Example: LIST_STATUS\r
**url**: https://localhost/rpc?req=LIST_STATUS \r
**response body**: ServerStatus\r
-<pre>\r
+\r
+```json\r
{\r
"bootDate": "2011-10-22T12:13:00Z",\r
"version": "0.7.0-SNAPSHOT",\r
"heapSize": 1899560960,\r
"servletContainer": "jetty/7.4.3.v20110701"\r
}\r
-</pre>
\ No newline at end of file
+```
\ No newline at end of file
#### Native Clients\r
\r
Native clients may display an error when attempting to clone or push that looks like this:\r
----FIXED---\r
+\r
+```\r
C:\projects\git\gitblit>git push rhcloud master\r
error: error:14077458:SSL routines:SSL23_GET_SERVER_HELLO:reason(1112) while accessing https://demo-gitblit.rhcloud.com/git/gitblit.git/info/refs?service=git-receive-pack\r
fatal: HTTP request failed\r
----FIXED---\r
+```\r
\r
### Cloning a Repository \r
\r
You can define new client integrations and deactivate/remove the default integrations by creating a file *$(baseFolder}/clientapps.json*.\r
\r
### Example definitions\r
----JSON---\r
+\r
+```json\r
[\r
{\r
"name": "SmartGit/Hg",\r
"isActive": false\r
}\r
]\r
----JSON---
\ No newline at end of file
+```\r
\r
1. Download and unzip Gitblit GO [${project.releaseVersion} (Windows)](%GCURL%gitblit-${project.releaseVersion}.zip) or [${project.releaseVersion} (Linux/OSX)](%GCURL%gitblit-${project.releaseVersion}.tar.gz). \r
*Its best to eliminate spaces in the path name.* \r
-2. The server itself is configured through a simple text file.<br/>\r
+2. The server itself is configured through a simple text file.\r
Open `data/gitblit.properties` in your favorite text editor and make sure to review and set:\r
- *server.httpPort* and *server.httpsPort*\r
- *server.httpBindInterface* and *server.httpsBindInterface* \r
**https** is strongly recommended because passwords are insecurely transmitted form your browser/git client using Basic authentication!\r
- *git.packedGitLimit* (set larger than the size of your largest repository)\r
- *git.streamFileThreshold* (set larger than the size of your largest committed file)\r
-3. Execute `authority.cmd` or `java -cp gitblit.jar com.gitblit.authority.Launcher --baseFolder data` from a command-line<br/>**NOTE:** The Authority is a Swing GUI application. Use of this tool is not required as Gitblit GO will startup and create SSL certificates itself, BUT use of this tool allows you to control the identification metadata used in the generated certificates. Skipping this step will result in certificates with default metadata.\r
+3. Execute `authority.cmd` or `java -cp gitblit.jar com.gitblit.authority.Launcher --baseFolder data` from a command-line\r
+**NOTE:** The Authority is a Swing GUI application. Use of this tool is not required as Gitblit GO will startup and create SSL certificates itself, BUT use of this tool allows you to control the identification metadata used in the generated certificates. Skipping this step will result in certificates with default metadata.\r
1. fill out the fields in the *new certificate defaults* dialog\r
2. enter the store password used in *server.storePassword* when prompted. This generates an SSL certificate for **localhost**.\r
- 3. you may want to generate an SSL certificate for the hostname or ip address hostnames you are serving from<br/>**NOTE:** You can only have **one** SSL certificate specified for a port.\r
+ 3. you may want to generate an SSL certificate for the hostname or ip address hostnames you are serving from\r
+ **NOTE:** You can only have **one** SSL certificate specified for a port.\r
5. exit the authority app\r
4. Execute `gitblit.cmd` or `java -jar gitblit.jar --baseFolder data` from a command-line\r
5. Open your browser to <http://localhost:8080> or <https://localhost:8443> depending on your chosen configuration.\r
3. Add any necessary *--StartParams* as enumerated below in **Command-Line Parameters**.\r
4. Execute the script.\r
\r
-After service installation you can use the `gitblitw.exe` utility to control and modify the runtime settings of the service.<br/>\r
+After service installation you can use the `gitblitw.exe` utility to control and modify the runtime settings of the service.\r
Additional service definition options and runtime capabilities of `gitblitw.exe` (prunmgr.exe) are documented [here](http://commons.apache.org/daemon/procrun.html).\r
\r
-**NOTE:**<br/>\r
+**NOTE:**\r
If you change the name of the service from *gitblit* you must also change the name of `gitblitw.exe` to match the new service name otherwise the connection between the service and the utility is lost, at least to double-click execution. \r
\r
#### VM Considerations\r
-By default, the service installation script configures your Windows service to use your default JVM. This setup usually defaults to a client VM.<br/>\r
+By default, the service installation script configures your Windows service to use your default JVM. This setup usually defaults to a client VM.\r
If you have installed a JDK, you might consider using the `gitblitw.exe` utility to manually specify the *server* VM.\r
\r
1. Execute `gitblitw.exe`\r
2. On the *Java* tab uncheck *Use default*.\r
-3. Manually navigate your filesystem and specify the server VM with the `...` button<br/><pre>\r
-Java Virtual Machine:\r
+3. Manually navigate your filesystem and specify the server VM with the `...` button\r
+<pre>Java Virtual Machine:\r
C:\Program Files\Java\jre6\bin\server\jvm.dll</pre>\r
\r
#### Command-Line Parameters\r
<blockquote>Grape (The Groovy Adaptable Packaging Engine or Groovy Advanced Packaging Engine) is the infrastructure enabling the grab() calls in Groovy, a set of classes leveraging <a href="http://ant.apache.org/ivy">Ivy</a> to allow for a repository driven module system for Groovy. This allows a developer to write a script with an essentially arbitrary library requirement, and ship just the script. Grape will, at runtime, download as needed and link the named libraries and all dependencies forming a transitive closure when the script is run from existing repositories such as Ibiblio, Codehaus, and java.net.</blockquote>
----JAVA---
+```java
// create and use a primitive array
import org.apache.commons.collections.primitives.ArrayIntList
ints.add(0, 42)
assert ints.size() == 1
assert ints.get(0) == 42
----JAVA---
+```
### Custom Fields
Each Linux distribution may vary on the exact configuration of Apache 2.2. \r
Here is a sample configuration that works on Debian 7.0 (Wheezy), your distribution may be different.\r
\r
-1. First we need to make sure we have Apache's proxy modules available. \r
----FIXED---\r
+### Make sure we have Apache's proxy modules\r
+\r
+```\r
sudo su\r
cd /etc/apache2/mods-enabled\r
ln -s ../mods-available/proxy.load proxy.load\r
ln -s ../mods-available/proxy_balancer.load proxy_balancer.load\r
ln -s ../mods-available/proxy_http.load proxy_http.load\r
ln -s ../mods-available/proxy_ajp.load proxy_ajp.load\r
----FIXED---\r
-2. Then we need to make sure we are configuring Apache to use the proxy modules and to setup the proxied connection from Apache to Gitblit GO or from Apache to your chosen servlet container. The following snippet is stored as `/etc/apache2/conf.d/gitblit`. \r
----FIXED---\r
+```\r
+### Configuring Apache to use the proxy modules\r
+\r
+Now we must configure Apache to use the proxy modules and the proxied connection from Apache to Gitblit GO or from Apache to your chosen servlet container. The following snippet is stored as `/etc/apache2/conf.d/gitblit`. \r
+\r
+```\r
# Turn off support for true Proxy behaviour as we are acting as \r
# a transparent proxy\r
ProxyRequests Off\r
#RequestHeader set X-Forwarded-Context /\r
\r
#ProxyPass /gitblit ajp://localhost:8009/gitblit\r
----FIXED--- \r
+```\r
+\r
**Please** make sure to: \r
1. Review the security of these settings as appropriate for your deployment\r
2. Uncomment the *ProxyPass* setting for whichever connection you prefer (http/ajp)\r
\r
1. Download Gitblit WAR [${project.releaseVersion}](%GCURL%gitblit-${project.releaseVersion}.war) to the webapps folder of your servlet container. \r
2. You may have to manually extract the WAR (zip file) to a folder within your webapps folder.\r
-3. By default, the Gitblit webapp is configured through `WEB-INF/data/gitblit.properties`.<br/>\r
+3. By default, the Gitblit webapp is configured through `WEB-INF/data/gitblit.properties`.\r
Open `WEB-INF/data/gitblit.properties` in your favorite text editor and make sure to review and set:\r
- <context-parameter> *git.packedGitLimit* (set larger than the size of your largest repository)\r
- <context-parameter> *git.streamFileThreshold* (set larger than the size of your largest committed file)\r
\r
## Upgrading Gitblit GO (pre-1.2.1)\r
1. Create a `data` folder and copy the following files and folders to it:\r
- - **users.conf*\r
+ - **users.conf**\r
- **projects.conf** *(if you have one)*\r
- **gitblit.properties**\r
- **serverKeystore.jks**\r
- **serverTrustStore.jks**\r
- - *certs** folder\r
+ - **certs** folder\r
- **git** folder\r
- **groovy** folder\r
- **proposals** folder\r
## Upgrading Gitblit WAR (1.2.1+)\r
-1. Make sure your `WEB-INF/web.xml` *baseFolder* context parameter is not `${contextFolder}/WEB-INF/data`!<br/>\r
+1. Make sure your `WEB-INF/web.xml` *baseFolder* context parameter is not `${contextFolder}/WEB-INF/data`!\r
If it is, move your `WEB-INF/data` folder to a location writeable by your servlet container.\r
2. Deploy new WAR\r
3. Edit the new WAR's `WEB-INF/web.xml` file and set the *baseFolder* context parameter to your external baseFolder.\r