James Moger
2014-04-11 df3594165089d28409cdd57bbe5f3fde304557f1
Improve plugin documentation
4 files modified
87 ■■■■■ changed files
build.xml 16 ●●●● patch | view | raw | blame | history
src/main/distrib/data/gitblit.properties 25 ●●●●● patch | view | raw | blame | history
src/site/features.mkd 5 ●●●●● patch | view | raw | blame | history
src/site/setup_plugins.mkd 41 ●●●● patch | view | raw | blame | history
build.xml
@@ -558,8 +558,6 @@
                        <page name="mirrors" src="setup_mirrors.mkd" />
                        <page name="scaling" src="setup_scaling.mkd" />
                        <divider />
                        <page name="plugins" src="setup_plugins.mkd" />
                        <divider />
                        <page name="Gitblit as a viewer" src="setup_viewer.mkd" />
                    </menu>
                    <divider />
@@ -575,6 +573,10 @@
                      <page name="barnum" src="tickets_barnum.mkd" />
                      <page name="setup" src="tickets_setup.mkd" />
                      <page name="replication &amp; advanced administration" src="tickets_replication.mkd" />
                    </menu>
                    <divider />
                    <menu name="Plugins" pager="true" pagerPlacement="bottom" pagerLayout="justified">
                      <page name="plugins" src="setup_plugins.mkd" />
                    </menu>
                    <divider />
                    <page name="federation" src="federation.mkd" />
@@ -619,6 +621,8 @@
                    <link name="Gitblit Next (SNAPSHOT)" src="https://next-gitblit.rhcloud.com" />
                    <divider />
                    <link name="Gitblit (Self-Hosted)" src="https://dev.gitblit.com" />
                    <divider />
                    <link name="Plugin Registry" src="http://plugins.gitblit.com" />
                    <divider />
                    <link name="Github" src="${project.scmUrl}" />
                    <link name="Issues" src="${project.issuesUrl}" />
@@ -877,8 +881,6 @@
                            <page name="mirrors" src="setup_mirrors.mkd" />
                            <page name="scaling" src="setup_scaling.mkd" />
                            <divider />
                            <page name="plugins" src="setup_plugins.mkd" />
                            <divider />
                            <page name="Gitblit as a viewer" src="setup_viewer.mkd" />
                        </menu>
                        <divider />
@@ -896,6 +898,10 @@
                            <page name="replication &amp; advanced administration" src="tickets_replication.mkd" />
                        </menu>
                        <divider />
                        <menu name="Plugins" pager="true" pagerPlacement="bottom" pagerLayout="justified">
                          <page name="plugins" src="setup_plugins.mkd" />
                        </menu>
                        <divider />
                        <page name="federation" src="federation.mkd" />
                        <divider />
                        <page name="settings" src="properties.mkd" />
@@ -912,6 +918,8 @@
                        <link name="Gitblit Demo (RELEASE)" src="https://demo-gitblit.rhcloud.com" />
                        <link name="Gitbilt Next (SNAPSHOT)" src="https://next-gitblit.rhcloud.com" />
                        <divider />
                        <link name="Plugin Registry" src="http://plugins.gitblit.com" />
                        <divider />
                        <link name="Github" src="${project.scmUrl}" />
                        <link name="Issues" src="${project.issuesUrl}" />
                        <link name="Discussion" src="${project.forumUrl}" />
src/main/distrib/data/gitblit.properties
@@ -570,7 +570,7 @@
# The registry of available plugins.
#
# SINCE 1.5.0
plugins.registry = http://gitblit.github.io/gitblit-registry/plugins.json
plugins.registry = http://plugins.gitblit.com/plugins.json
#
# Groovy Integration
@@ -1748,12 +1748,6 @@
# BASEFOLDER
server.tempFolder = ${baseFolder}/temp
# Use Jetty NIO connectors.  If false, Jetty Socket connectors will be used.
#
# SINCE 0.5.0
# RESTART REQUIRED
server.useNio = true
# Specify the maximum number of concurrent http/https worker threads to allow. 
#
# SINCE 1.3.0
@@ -1783,14 +1777,6 @@
# RESTART REQUIRED
server.httpsPort = 8443
# Port for serving an Apache JServ Protocol (AJP) 1.3 connector for integrating
# Gitblit GO into an Apache HTTP server setup.  <= 0 disables this connector.
# Recommended value: 8009
#
# SINCE 0.9.0
# RESTART REQUIRED
server.ajpPort = 0
# Automatically redirect http requests to the secure https connector.
#
# This setting requires that you have configured server.httpPort and server.httpsPort.
@@ -1818,15 +1804,6 @@
# SINCE 0.5.0
# RESTART REQUIRED
server.httpsBindInterface =
# Specify the interface for Jetty to bind the AJP connector.
# You may specify an ip or an empty value to bind to all interfaces.
# Specifying localhost will result in Gitblit ONLY listening to requests to
# localhost.
#
# SINCE 0.9.0
# RESTART REQUIRED
server.ajpBindInterface = localhost
# Alias of certificate to use for https/SSL serving.  If blank the first
# certificate found in the keystore will be used. 
src/site/features.mkd
@@ -21,9 +21,10 @@
    - **RWD** (clone and push with ref creation, deletion)
    - **RW+** (clone and push with ref creation, deletion, rewind)
- Menu driven native platform clone links for all popular Git clients
- *Experimental* built-in Garbage Collection
- Garbage Collection service
- Ability to federate with one or more other Gitblit instances
- RSS/JSON RPC interface
- An evolving plugin infrastructure
- Java/Swing Gitblit Manager tool
- Responsive web UI that subtracts elements to be usable on phones, tablets, and desktop browsers
- Groovy pre- and post- push hook scripts, per-repository or globally for all repositories
@@ -46,7 +47,7 @@
- User-tracked reflog for pushes, tags, etc.
- Fanout PubSub notifications service for self-hosted [Sparkleshare](http://sparkleshare.org) use
- gh-pages display support (Jekyll is not supported)
- Branch metrics (uses Google Charts)
- Branch metrics
- HEAD and Branch RSS feeds
- Blame annotations view
- Dates can optionally be displayed using the browser's reported timezone
src/site/setup_plugins.mkd
@@ -3,7 +3,7 @@
*SINCE 1.5.0*
Gitblit supports extending and enhacing the core functionality through plugins.  This mechanism is very young and incomplete with few extension points, but you can expect it to evolve rapidly in upcoming releases.
Gitblit supports extending and enhancing the core functionality through plugins.  This mechanism is very young and incomplete with few extension points, but you can expect it to evolve rapidly in upcoming releases.
### Architecture
@@ -13,20 +13,45 @@
A plugin defines it's metadata in the META-INF/MANIFEST.MF file:
    Plugin-Class: com.gitblit.plugins.cookbook.CookbookPlugin
    Plugin-Dependencies: foo, bar
    Plugin-Id: gitblit-plugin
    Plugin-Provider: John Doe
    Plugin-Version: 1.0
    Plugin-Class: com.gitblit.plugin.powertools.Powertools
    Plugin-Dependencies:
    Plugin-Id: com.gitblit.plugin:powertools
    Plugin-Provider: James Moger
    Plugin-Version: 1.1.0
In addition to extending Gitblit core, plugins can also define extension points that may be implemented by other plugins.  Therefore a plugin may depend on other plugins.
    Plugin-Dependencies: foo, bar
Plugins are controlled by the `plugin` SSH dispatch command.  Only *administrators* have permission to use this dispatch command.
**NOTE:**
The pf4j plugin framework relies on a javac apt processor to generate compile-time extension information, so be sure to enable apt processing in your build process.
### Managing Plugins
Administrators may manage plugins through the `plugin` SSH dispatch command:
    ssh host plugin
Through this command interface plugins can be started, stopped, disabled, enabled, installed, uninstalled, listed, etc.
### Default Plugin Registry
Gitblit provides a simple default registry of plugins. The registry is a JSON file and it lists plugin metadata and download locations.
    plugins.registry = http://plugins.gitblit.com/plugins.json
The [registry](http://plugins.gitblit.com/plugins.json) is currently hosted in a [Git repository on Github](https://github.com/gitblit/gitblit-registry).  This git repository is also a [Maven-compatible repository](http://plugins.gitblit.com), which hosts some plugin binaries.
### Contributing Plugins to the Default Registry
If you develop your own plugins that you want hosted by or linked in the default registry, open pull request for the registry repository.  Any contributed binaries hosted in this repository must have Maven metadata and the SHA-1 & MD5 checksums.  By default, Gitblit enforces checksum validation on all downloads.
### Hosting your Own Registry / Allowing Multiple Registries
The `plugins.json` file is parameterized with the `${self}` placeholder.  This parameter is substituted on download with with the source URL of the registry file.  This allows you to clone and serve your own copy of this git repository or just server your own `plugins.json` on your own network.
Gitblit also supports loading multiple plugin registries.  Just place another **properly formatted** `.json` file in `${baseFolder}/plugins` and Gitblit will load that as an additional registry.
### Extension Point: SSH DispatchCommand
You can provide your own custom SSH commands by extending the DispatchCommand.