]> source.dussan.org Git - gitblit.git/commitdiff
Documentation
authorJames Moger <james.moger@gitblit.com>
Tue, 27 Nov 2012 22:18:38 +0000 (17:18 -0500)
committerJames Moger <james.moger@gitblit.com>
Tue, 27 Nov 2012 22:18:38 +0000 (17:18 -0500)
docs/01_setup.mkd

index c19f7fb1971bf4d825a44a7e8fa7d249ef89e25c..5c8c00663cd9daef8ed09c3dd21c9f1e92c858ec 100644 (file)
@@ -27,23 +27,28 @@ Open `gitblit.properties` in your favorite text editor and make sure to review a
     - *git.repositoryFolder* (path may be relative or absolute)\r
     - *groovy.scriptsFolder* (path may be relative or absolute)\r
     - *groovy.grapeFolder* (path may be relative or absolute)\r
+    - *web.siteName* (used in certificate generation, etc)\r
     - *server.tempFolder* (path may be relative or absolute)\r
     - *server.httpPort* and *server.httpsPort*\r
     - *server.httpBindInterface* and *server.httpsBindInterface*  \r
+       - *server.storePassword*\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 `gitblit.cmd` or `java -jar gitblit.jar` from a command-line\r
-4. Wait a minute or two while all dependencies are downloaded and your self-signed *localhost* certificate is generated.  \r
-    Please see the section titled **Creating your own Self-Signed Certificate** to generate a certificate for *your hostname*.\r
+3. Execute `authority.cmd` or `java -jar authority.jar` from a command-line\r
+    a. enter default values for your generated certificates in the *new certificate defaults* dialog\r
+       b. enter the store password used in *server.storePassword* when prompted *(this generates an SSL certificate for **localhost**)*\r
+       c. you will also want to generate SSL certificates for the hostnames or ip addresses you serve from\r
+       d. exit the authority app\r
+4. Execute `gitblit.cmd` or `java -jar gitblit.jar` from a command-line\r
 5. Open your browser to <http://localhost:8080> or <https://localhost:8443> depending on your chosen configuration.\r
 6. Enter the default administrator credentials: **admin / admin** and click the *Login* button    \r
     **NOTE:** Make sure to change the administrator username and/or password!! \r
 \r
-### Creating your own Self-Signed Certificate\r
-Gitblit GO automatically generates an ssl certificate for you that is bound to *localhost*.\r
+### Creating your own Self-Signed SSL Certificate\r
+Gitblit GO (and Gitblit Certificate Authority) automatically generates a Certificate Authority (CA) certificate and an ssl certificate signed by this CA certificate that is bound to *localhost*.\r
 \r
-Remote Eclipse/EGit/JGit clients (<= 1.1.0) will fail to communicate using this certificate because JGit always verifies the hostname of the certificate, regardless of the *http.sslVerify=false* client-side setting.\r
+Remote Eclipse/EGit/JGit clients (<= 2.1.0) will fail to communicate using this certificate because JGit always verifies the hostname of the certificate, regardless of the *http.sslVerify=false* client-side setting.\r
 \r
 The EGit failure message is something like:\r
 \r
@@ -52,14 +57,45 @@ The EGit failure message is something like:
 \r
 If you want to serve your repositories to another machine over https then you will want to generate your own certificate.\r
 \r
-1. Review the contents of `makekeystore.cmd` or `makekeystore_jdk.cmd`\r
-2. Set *your hostname* into the *HOSTNAME* variable.\r
-3. Execute the script.<br/>This will generate a new certificate and keystore for *your hostname* protected by *server.storePassword*.\r
+1. `authority.cmd` or `java -jar authority.jar`\r
+2. Click the *new ssl certificate* button (red rosette in the toolbar in upper left of window)\r
+3. Enter the hostname or ip address\r
+4. Enter the *server.storePassword* password\r
  \r
-**NOTE:**  \r
-If you use `makekeystore_jdk.cmd`, the certificate password AND the keystore password must match and must be set as *server.storePassword* or specified with the *storePassword* command-line parameter!\r
+Additionally, if you want to change the value of *server.storePassword* (recommended) you will have to delete the following files and then start the Gitblit Certificate Authority app:\r
+1. serverKeyStore.jks\r
+2. serverTrustStore.jks\r
+3. certs/caKeyStore.jks\r
+4. certs/ca.crt\r
+\r
+### Client SSL Certificates\r
+SINCE 1.2.0\r
+\r
+Gitblit supports X509 certificate authentication.  This authentication method relies on your servlet container to validate/verify/trust your client certificate and can be used by your browser and your git client.\r
+\r
+All X509 certificates have a *distinguished name (DN)* which is a signature of several fields like:\r
+\r
+    C=US,O=Gitblit,OU=Gitblit,CN=james\r
+       \r
+Gitblit must be able to map the DN of the certificate to an *existing* account username.  The default mapping is to extract the *common name (CN)* value from the DN and use that as the account name.  If the CN is a valid account, then the user is authenticated.  The servlet container which runs Gitblit validates, verifies, and trusts the certificate passed to Gitblit.  If you need to specify an alternative DN mapping you may do so with the *git.certificateUsernameOIDs* setting, but this mapping must be matched to the user account name.\r
+\r
+How do you make your servlet container trust a client certificate?\r
 \r
-Additionally, if you want to change the value of *server.storePassword* (recommended) you will have to generate a new certificate afterwards.\r
+In the WAR variant, you will have to manually setup your servlet container to:\r
+1. want/need client certificates\r
+2. trust a CA certificate used to sign your client certificates\r
+3. generate client certificates signed by your CA certificate\r
+\r
+Alternatively, Gitblit GO is designed to facilitate use of client certificate authentication.  Gitblit GO ships with a tool that simplifies creation and management of client certificates, Gitblit Certificate Authority.\r
+\r
+#### Creating SSL Certificates with Gitblit Certificate Authority\r
+\r
+When you generate a new client certificate, a zip file bundle is created which includes a P12 keystore for browsers and a PEM keystore for Git.  Both of these are password-protected.  Additionally, a personalized README file is generated with setup instructions for popular browsers and Git.  The README is generated from `certs\instructions.tmpl` and can be modified to suit your needs.\r
+\r
+1. `authority.cmd` or `java -jar authority.jar`\r
+2. Select the user for which to generate the certificate\r
+3. Click the *new certificate* button and enter the expiration date of the certificate.  You must also enter a password for the generated keystore.  This password is not the same as the user's login password.  This password is used to protect the privatekey and public certificate you will generate for the selected user.  You must also enter a password hint for the user.\r
+4. If your mail server settings are properly configured you will have a *send email* checkbox which you can use to immediately send the generated certificate bundle to the user.\r
 \r
 ### Running as a Windows Service\r
 Gitblit uses [Apache Commons Daemon](http://commons.apache.org/daemon) to install and configure its Windows service.\r
@@ -659,7 +695,7 @@ You must tell Git/JGit not to verify the self-signed certificate in order to per
 **NOTE:**  \r
 The default self-signed certificate generated by Gitlbit GO is bound to *localhost*.  \r
 If you are using Eclipse/EGit/JGit clients, you will have to generate your own certificate that specifies the exact hostname used in your clone/push url.  \r
-You must do this because Eclipse/EGit/JGit (<= 1.1.0) always verifies certificate hostnames, regardless of the *http.sslVerify=false* client-side setting. \r
+You must do this because Eclipse/EGit/JGit (<= 2.1.0) always verifies certificate hostnames, regardless of the *http.sslVerify=false* client-side setting. \r
  \r
 - **Eclipse/EGit/JGit**\r
     1. Window->Preferences->Team->Git->Configuration\r
@@ -669,6 +705,12 @@ Value = <em>false</em></pre>
 - **Command-line Git** ([Git-Config Manual Page](http://www.kernel.org/pub/software/scm/git/docs/git-config.html))  \r
 <pre>git config --global --bool --add http.sslVerify false</pre>\r
 \r
+### Http Post Buffer Size\r
+You may find the default post buffer of your git client is too small to push large deltas to Gitblit.  Sometimes this can be observed on your client as *hanging* during a push.  Other times it can be observed by git erroring out with a message like: error: RPC failed; result=52, HTTP code = 0.\r
+\r
+This can be adjusted on your client by changing the default post buffer size:\r
+<pre>git config --global http.postBuffer 524288000</pre>\r
+\r
 ### Cloning an Access Restricted Repository \r
 - **Eclipse/EGit/JGit**  \r
 Nothing special to configure, EGit figures out everything.\r