| | |
| | | --useNio Use NIO Connector else use Socket Connector.
|
| | | --httpPort HTTP port for to serve. (port <= 0 will disable this connector)
|
| | | --httpsPort HTTPS port to serve. (port <= 0 will disable this connector)
|
| | | --ajpPort AJP port to serve. (port <= 0 will disable this connector)
|
| | | --storePassword Password for SSL (https) keystore.
|
| | | --shutdownPort Port for Shutdown Monitor to listen on. (port <= 0 will disable this monitor)
|
| | | --tempFolder Folder for server to extract built-in webapp
|
| | |
| | | **Example**
|
| | |
|
| | | java -jar gitblit.jar --userService c:\myrealm.config --storePassword something
|
| | |
|
| | | #### Overriding Gitblit GO's Log4j Configuration
|
| | |
|
| | | You can override Gitblit GO's default Log4j configuration with a command-line parameter to the JVM.
|
| | |
|
| | | java -Dlog4j.configuration=file:///home/james/log4j.properties -jar gitblit.jar <optional_gitblit_args>
|
| | | |
| | | For reference, here is [Gitblit's default Log4j configuration](https://github.com/gitblit/gitblit/blob/master/src/log4j.properties). It includes some file appenders that are disabled by default. |
| | | |
| | | ## Running Gitblit behind Apache
|
| | |
|
| | | Gitblit runs fine behind Apache. You may use either *mod_proxy* (GO or WAR) or *mod_proxy_ajp* (GO).
|
| | |
|
| | | Each Linux distribution may vary on the exact configuration of Apache 2.2. |
| | | Here is a sample configuration that works on Debian 7.0 (Wheezy), your distribution may be different.
|
| | |
|
| | | 1. First we need to make sure we have Apache's proxy modules available. |
| | | <pre>
|
| | | sudo su
|
| | | cd /etc/apache2/mods-enabled
|
| | | ln -s ../mods-available/proxy.load proxy.load
|
| | | ln -s ../mods-available/proxy_balancer.load proxy_balancer.load
|
| | | ln -s ../mods-available/proxy_http.load proxy_http.load
|
| | | ln -s ../mods-available/proxy_ajp.load proxy_ajp.load
|
| | | </pre>
|
| | | 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`. |
| | | %BEGINCODE%
|
| | | # Turn off support for true Proxy behaviour as we are acting as |
| | | # a transparent proxy
|
| | | ProxyRequests Off
|
| | |
|
| | | # Turn off VIA header as we know where the requests are proxied
|
| | | ProxyVia Off
|
| | | |
| | | # Turn on Host header preservation so that the servlet container
|
| | | # can write links with the correct host and rewriting can be avoided.
|
| | | #
|
| | | # This is important for all git push/pull/clone operations.
|
| | | ProxyPreserveHost On
|
| | | |
| | | # Set the permissions for the proxy
|
| | | <Proxy *>
|
| | | AddDefaultCharset off
|
| | | Order deny,allow
|
| | | Allow from all
|
| | | </Proxy>
|
| | | |
| | | # The proxy context path must match the Gitblit context path.
|
| | | # For Gitblit GO, see server.contextPath in gitblit.properties.
|
| | |
|
| | | #ProxyPass /gitblit http://localhost:8080/gitblit
|
| | | #ProxyPassreverse /gitblit http://localhost:8080/gitblit
|
| | |
|
| | | # If your httpd frontend is https but you are proxying http Gitblit WAR or GO
|
| | | #Header edit Location ^http://([^⁄]+)/gitblit/ https://$1/gitblit/
|
| | |
|
| | | #ProxyPass /gitblit ajp://localhost:8009/gitblit
|
| | | %ENDCODE% |
| | | **Please** make sure to: |
| | | 1. Review the security of these settings as appropriate for your deployment
|
| | | 2. Uncomment the *ProxyPass* setting for whichever connection you prefer (http/ajp)
|
| | | 3. Correctly set the ports and context paths both in the *ProxyPass* definition and your Gitblit installation |
| | | If you are using Gitblit GO you can easily configure the AJP connector by specifying a non-zero AJP port. |
| | | Please remember that on Linux/UNIX, ports < 1024 require root permissions to open.
|
| | | 4. Set *web.mountParameters=false* in `gitblit.properties` or `web.xml` this will use parameterized URLs. |
| | | Alternatively, you can respecify *web.forwardSlashCharacter*.
|
| | |
|
| | | ## Upgrading Gitblit
|
| | | Generally, upgrading is easy.
|
| | |
| | |
|
| | | *SINCE 0.8.0*
|
| | |
|
| | | The preferred hook mechanism is Groovy. This mechanism only executes when pushing to Gitblit, not when pushing to some other Git tooling in your stack.
|
| | | Gitblit uses Groovy for its push hook mechanism. This mechanism only executes when pushing to Gitblit, not when pushing to some other Git tooling in your stack.
|
| | |
|
| | | The Groovy hook mechanism allows for dynamic extension of Gitblit to execute custom tasks on receiving and processing push events. The scripts run within the context of your Gitblit instance and therefore have access to Gitblit's internals at runtime.
|
| | |
|
| | |
| | | ### Enabling Push Notifications
|
| | |
|
| | | In order to send email notifications on a push to Gitblit, this script must be specified somewhere in the *post-receive* script chain.
|
| | | You may specify *sendmail* in one of two places:
|
| | | You may specify *sendmail* in one of three places:
|
| | |
|
| | | 1. *groovy.postReceiveScripts* in `gitblit.properties` or `web.xml`, globally applied to all repositories
|
| | | 2. post-receive scripts of a Repository definition
|
| | | 2. post-receive scripts of a Team definition
|
| | | 3. post-receive scripts of a Repository definition
|
| | |
|
| | | ### Destination Addresses
|
| | |
|
| | |
| | | **NOTE:**
|
| | | Care should be taken when devising your notification scheme as it relates to any VIEW restricted repositories you might have. Setting a global mailing list and activating push notifications for a VIEW restricted repository may send unwanted emails.
|
| | |
|
| | | ## Lucene Search Integration
|
| | |
|
| | | *SINCE 0.9.0*
|
| | |
|
| | | Repositories may optionally be indexed using the Lucene search engine. The Lucene search offers several advantages over commit-traversal search:
|
| | |
|
| | | 1. very fast commit and blob searches
|
| | | 2. multi-term searches
|
| | | 3. term-highlighted and syntax-highlighted fragment matches
|
| | | 4. multi-repository searches
|
| | |
|
| | | ### How do I use it?
|
| | |
|
| | | First you must ensure that *web.allowLuceneIndexing* is set *true* in `gitblit.properties` or `web.xml`. Then you must understand that Lucene indexing is an opt-in feature which means that no repositories are automatically indexed. |
| | | Like anything else, this design has pros and cons.
|
| | |
|
| | | #### Pros
|
| | | 1. no wasted cycles indexing repositories you will never search
|
| | | 2. you specify exactly what branches are indexed; experimental/dead/personal branches can be ignored
|
| | |
|
| | | #### Cons
|
| | | 1. you have to opt-in a repository _after_ it is created and has some commits
|
| | | 2. you specify exactly what branches are indexed
|
| | |
|
| | | #### Why does Gitblit check every 2 mins for repository/branch changes?
|
| | |
|
| | | Gitblit has to balance its design as a complete, integrated Git server and its utility as a repository viewer in an existing Git setup.
|
| | |
|
| | | Gitblit could build indexes immediately on *edit repository* or on *receiving pushes*, but that design would not work if someone is pushing via ssh://, git://, or file:// (i.e. not pushing to Gitblit http(s)://). For this reason Gitblit has a polling mechanism to check for ref changes every 2 mins. This design works well for all use cases, aside from adding a little lag in updating the index.
|
| | |
|
| | | #### Indexing Branches
|
| | | You may specify which branches should be indexed per-repository in the *Edit Repository* page. New/empty repositories can not pre-specify indexed branches; you can only specify indexed branches for a repository with commits. Indexes are built and incrementally updated on a 2 minute cycle so you may have to wait a few minutes before your index is built or before your latest pushes get indexed.
|
| | |
|
| | | **NOTE:** |
| | | After specifying branches, only the content from those branches can be searched via Gitblit. Gitblit will automatically redirect any queries entered on a repository's search box to the Lucene search page. Repositories that do not specify any indexed branches will use the traditional commit-traversal search.
|
| | |
|
| | | #### Adequate Heap
|
| | |
|
| | | The initial indexing of an existing repository can potentially exhaust the memory allocated to your Java instance and may throw OutOfMemory exceptions. Be sure to provide your Gitblit server adequate heap space to index your repositories. The heap is set using the *-Xmx* JVM parameter in your Gitblit launch command (e.g. -Xmx1024M).
|
| | |
|
| | | ## Client Setup and Configuration
|
| | | ### Https with Self-Signed Certificates
|
| | | You must tell Git/JGit not to verify the self-signed certificate in order to perform any remote Git operations.
|