summaryrefslogtreecommitdiffstats
path: root/docs/01_setup.mkd
diff options
context:
space:
mode:
Diffstat (limited to 'docs/01_setup.mkd')
-rw-r--r--docs/01_setup.mkd28
1 files changed, 21 insertions, 7 deletions
diff --git a/docs/01_setup.mkd b/docs/01_setup.mkd
index 1cc89bf2..7ea57565 100644
--- a/docs/01_setup.mkd
+++ b/docs/01_setup.mkd
@@ -217,6 +217,18 @@ User passwords are CASE-SENSITIVE and may be *plain*, *md5*, or *combined-md5* f
There are two actual *roles* in Gitblit: *#admin*, which grants administrative powers to that user, and *#notfederated*, which prevents an account from being pulled by another Gitblit instance. Administrators automatically have access to all repositories. All other *roles* are repository names. If a repository is access-restricted, the user must have the repository's name within his/her roles to bypass the access restriction. This is how users are granted access to a restricted repository.
## Authentication and Authorization Customization
+
+### Choice 1: Customize Authentication Only
+This is the simplest choice where you implement custom authentication and delegate all other standard user and team operations to one of Gitblit's user service implementations. This choice insulates your customization from changes in User and Team model classes and additional API that may be added to IUserService.
+
+Please subclass [com.gitblit.GitblitUserService](https://github.com/gitblit/gitblit/blob/master/src/com/gitblit/GitblitUserService.java) and override the *setup()* and *authenticate()* methods.
+Make sure to set the *serviceImpl* field in your *setup()* method.
+
+You may use your subclass by specifying its fully qualified classname in the *realm.userService* setting.
+
+Your subclass must be on Gitblit's classpath and must have a public default constructor.
+
+### Choice 2: Customize Everything
Instead of maintaining a `users.conf` or `users.properties` file, you may want to integrate Gitblit into an existing environment.
You may use your own custom *com.gitblit.IUserService* implementation by specifying its fully qualified classname in the *realm.userService* setting.
@@ -232,19 +244,21 @@ The preferred hook mechanism is Groovy. This mechanism only executes when pushi
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.
-### Rules & Requirements
+### Rules, Requirements, & Behaviors
1. Your Groovy scripts must be stored in the *groovy.scriptsFolder* as specified in `gitblit.properties` or `web.xml`.
2. All script files must have the *.groovy* extension. Because of this you may omit the extension when specifying the script.
3. Scripts must be explicitly specified to be executed, no scripts are *automatically* executed by name or extension.
-4. A script can be specified to run on *all repositories* by adding the script file name to *groovy.preReceiveScripts* or *groovy.postReceiveScripts* in `gitblit.properties` or `web.xml`.
+4. A script can be specified to run on *all repositories* by adding the script file name to *groovy.preReceiveScripts* or *groovy.postReceiveScripts* in `gitblit.properties` or `web.xml`. Be mindful of access retrictions and global properties like *mail.mailingLists* if specifying *sendmail* to run on all repositories.
5. Scripts may also be specified per-repository in the repository's settings.
-6. Global/shared scripts are executed first in their listed order, followed by per-repository scripts in their listed order.
-7. A script may only be defined once in a pre-receive list and once in a post-receive list.
+6. Globally specified scripts are excluded from the list of available scripts in a repository's settings
+7. Globally specified scripts are executed first, in their listed order, followed by per-repository scripts, in their listed order.
+8. A script may only be defined once in a pre-receive list and once in a post-receive list.
You may execute the same script on pre-receive and post-receive, just not multiple times within a pre-receive or post-receive event.
-8. Gitblit does not differentiate between what can be a pre-receive script and what can be a post-receive script.
-9. If a script *returns false* then the hook chain is aborted and none of the subsequent scripts will execute.
+9. Gitblit does not differentiate between what can be a pre-receive script and what can be a post-receive script.
+10. If a script *returns false* then the pre-receive or post-receive hook chain is aborted and none of the subsequent scripts will execute.
+
+Some sample scripts are included in the GO and WAR distributions to show you how you can tap into Gitblit with the provided bound variables. Additional implementation details may be specified in the header comment of these examples.
-Some sample scripts are included in the GO and WAR distributions to show you how you can tap into Gitblit with the provided bound variables. Additional implementation details may be specified in the header comment of these examples.
Hook contributions and improvements are welcome.
### Pre-Receive