| | |
| | |
|
| | | *SINCE 0.6.0*
|
| | |
|
| | | A Gitblit federation is a mechanism to clone repositories and keep them in sync from one Gitblit instance to another. Federation can be used for automated backup of your repositories or may be used to initially clone groups of repositories to developer workstations. If you are/were a Subversion user you might think of this as [svn-sync](http://svnbook.red-bean.com/en/1.5/svn.ref.svnsync.html), but better.
|
| | | A Gitblit federation is a mechanism to clone repositories and keep them in sync from one Gitblit instance to another. Federation can be used to maintain a mirror of your Gitblit instance, to aggregate repositories from developer workstations, or to initially clone groups of repositories to developer workstations. If you are/were a Subversion user you might think of this as [svn-sync](http://svnbook.red-bean.com/en/1.5/svn.ref.svnsync.html), but better.
|
| | |
|
| | | If your Gitblit instance allows federation and it is properly registered with another Gitblit instance, each of the *non-excluded* repositories of your Gitblit instance can be mirrored, in their entirety, to the pulling Gitblit instance. You may optionally allow pulling of user accounts and backup of server settings.
|
| | |
|
| | | The federation feature should be considered a security backdoor and enabled or disabled as appropriate for your installation.<br/>
|
| | | Please review all the documentation to understand how it works and its limitations.
|
| | |
|
| | | 
|
| | |
|
| | | ### Origin Gitblit Instance Requirements
|
| | |
|
| | |
| | |
|
| | | The federation feature is completely disabled if your passphrase value is empty.
|
| | |
|
| | | **NOTE**:<br/>
|
| | | **NOTE**: |
| | | Changing your *federation.passphrase* will break any registrations you have established with other Gitblit instances.
|
| | |
|
| | | ### Pulling Gitblit Instance Requirements
|
| | |
| | | String repositoriesToken = SHA1(passphrase + "-REPOSITORIES");
|
| | | %ENDCODE%
|
| | |
|
| | | The *ALL* token allows another Gitblit instance to pull all your repositories, user accounts, and server settings.<br/>
|
| | | The *USERS_AND_REPOSITORIES* token allows another Gitblit instance to pull all your repositories and user accounts.<br/>
|
| | | The *ALL* token allows another Gitblit instance to pull all your repositories, user accounts, and server settings. |
| | | The *USERS_AND_REPOSITORIES* token allows another Gitblit instance to pull all your repositories and user accounts. |
| | | The *REPOSITORIES* token only allows pulling of the repositories.
|
| | |
|
| | | Individual Gitblit repository configurations such as *description* and *accessRestriction* are always mirrored.
|
| | |
| | |
|
| | | Once you have properly setup your passphrase and can see your federation tokens, you are ready to share them with a pulling Gitblit instance.
|
| | |
|
| | | The registration process can be partially automated by sending a *federation proposal* to the pulling Gitblit instance.<br/>
|
| | | The registration process can be partially automated by sending a *federation proposal* to the pulling Gitblit instance. |
| | | To send a proposal:
|
| | |
|
| | | 1. Login to your Gitblit instance as an administrator
|
| | | 2. Select and click the *propose* link for the appropriate token at the bottom of the repositories page
|
| | | 2. Select and click the *propose* link for the appropriate token on the *federation* page
|
| | | 3. Confirm the publicly accessible url of your (origin) Gitblit instance
|
| | | 4. Enter the url of the pulling Gitblit instance you want to federate with
|
| | | 5. Optionally enter a message for the administrators
|
| | |
| | | 2. the federation token you selected and its type
|
| | | 3. the list of your *non-excluded* repositories, and their configuration details, that you propose to share
|
| | |
|
| | | Submitting a proposal does not automatically register your server with the pulling Gitblit instance.<br/>
|
| | | Submitting a proposal does not automatically register your server with the pulling Gitblit instance. |
| | | Registration is a manual process for an administrator.
|
| | |
|
| | | ### Federation Proposals (Pulling Gitblit Instance)
|
| | |
| | |
|
| | | #### Origin Verification
|
| | |
|
| | | During a federated pull operation, Gitblit does check that the *origin* of the local repository starts with the url of the federation registration.<br/>
|
| | | During a federated pull operation, Gitblit does check that the *origin* of the local repository starts with the url of the federation registration. |
| | | If they do not match, the repository is skipped and this is indicated in the log.
|
| | |
|
| | | #### User Accounts
|
| | |
| | |
|
| | | If you specify *federation.N.mergeAccounts=true*, then the user accounts from the origin Gitblit instance will be integrated into the `users.properties` file of your Gitblit instance and allow sign-on of those users.
|
| | |
|
| | | **NOTE:**<br/>
|
| | | Upgrades from older Gitblit versions will not have the *#notfederated* role assigned to the *admin* account. Without that role, your admin account WILL be transferred with an *ALL* or *USERS_AND_REPOSITORIES* token.<br/>
|
| | | **NOTE:** |
| | | Upgrades from older Gitblit versions will not have the *#notfederated* role assigned to the *admin* account. Without that role, your admin account WILL be transferred with an *ALL* or *USERS_AND_REPOSITORIES* token. |
| | | Please consider adding the *#notfederated* role to your admin account!
|
| | |
|
| | | #### Server Settings
|
| | |
| | |
|
| | | ## Federation Pull Registration Keys
|
| | |
|
| | | <table class="text">
|
| | | <table>
|
| | | <tr><th>federation.N.url</th>
|
| | | <td>string</td>
|
| | | <td>the url of the origin Gitblit instance *(required)*</td>
|
| | | <td>the url of the origin Gitblit instance <em>(required)</em></td>
|
| | | </tr>
|
| | |
|
| | | <tr><th>federation.N.token</th>
|
| | | <td>string</td>
|
| | | <td>the token provided by the origin Gitblit instance *(required)*</td>
|
| | | <td>the token provided by the origin Gitblit instance <em>(required)</em></td>
|
| | | </tr>
|
| | |
|
| | | <tr><th>federation.N.frequency</th>
|
| | |
| | |
|
| | | <tr><th>federation.N.folder</th>
|
| | | <td>string</td>
|
| | | <td>the destination folder, relative to *git.repositoriesFolder*, for these repositories.<br/>default is *git.repositoriesFolder*</td>
|
| | | <td>the destination folder, relative to <em>git.repositoriesFolder</em>, for these repositories.<br/>default is <em>git.repositoriesFolder</em></td>
|
| | | </tr>
|
| | |
|
| | | <tr><th>federation.N.bare</th>
|
| | | <td>boolean</td>
|
| | | <td>if **true** *(default)*, each repository is cloned as a bare repository (i.e. no working folder).</td>
|
| | | <td>if <b>true</b> <em>(default)</em>, each repository is cloned as a bare repository (i.e. no working folder).</td>
|
| | | </tr>
|
| | |
|
| | | <tr><th>federation.N.mirror</th>
|
| | | <td>boolean</td>
|
| | | <td>if **true** *(default)*, each repository HEAD is reset to *origin/master* after each pull. The repository is flagged *isFrozen* after the initial clone.<p>If **false**, each repository HEAD will point to the FETCH_HEAD of the initial clone from the origin until pushed to or otherwise manipulated.</td>
|
| | | <td>if <b>true</b> <em>(default)</em>, each repository HEAD is reset to <em>origin/master</em> after each pull. The repository is flagged <em>isFrozen</em> after the initial clone.<br/><br/>If <b>false</b>, each repository HEAD will point to the FETCH_HEAD of the initial clone from the origin until pushed to or otherwise manipulated.</td>
|
| | | </tr>
|
| | |
|
| | | <tr><th>federation.N.mergeAccounts</th>
|
| | | <td>boolean</td>
|
| | | <td>if **true**, merge the retrieved accounts into the `users.properties` of **this** Gitblit instance.<br/>*default is false*</td>
|
| | | <td>if <b>true</b>, merge the retrieved accounts into the <code>users.properties</code> of <b>this</b> Gitblit instance.<br/><em>default is false</em></td>
|
| | | </tr>
|
| | |
|
| | | <tr><th>federation.N.sendStatus</th>
|
| | | <td>boolean</td>
|
| | | <td>if **true**, send the status of the federated pull to the origin Gitblit instance.<br/>*default is false*</td>
|
| | | <td>if <b>true</b>, send the status of the federated pull to the origin Gitblit instance.<br/><em>default is false</em></td>
|
| | | </tr>
|
| | |
|
| | | <tr><th>federation.N.include</th>
|
| | | <td>string array<br/>(space-delimited)</td>
|
| | | <td>list of included repositories *(wildcard and fuzzy matching supported)*</td>
|
| | | <td>list of included repositories <em>(wildcard and fuzzy matching supported)</em></td>
|
| | | </tr>
|
| | |
|
| | | <tr><th>federation.N.exclude</th>
|
| | | <td>string array<br/>(space-delimited)</td>
|
| | | <td>list of excluded repositories *(wildcard and fuzzy matching supported)*</td>
|
| | | <td>list of excluded repositories <em>(wildcard and fuzzy matching supported)</em></td>
|
| | | </tr>
|
| | |
|
| | | <tr><th>federation.N.notifyOnError</th>
|
| | | <td>boolean</td>
|
| | | <td>if **true**, send an email to the administrators on an error.<br/>*default is false*</td>
|
| | | <td>if <b>true</b>, send an email to the administrators on an error.<br/><em>default is false</em></td>
|
| | | </tr>
|
| | | </table>
|
| | |
|
| | |
| | | These examples would be entered into the `gitblit.properties` file of the pulling gitblit instance.
|
| | |
|
| | | #### (Nearly) Perfect Mirror Example
|
| | |
|
| | | 
|
| | |
|
| | | This assumes that the *token* is the *ALL* token from the origin gitblit instance.
|
| | |
|
| | |
| | |
|
| | | #### Just Repositories Example
|
| | |
|
| | | This assumes that the *token* is the *REPOSITORIES* token from the origin gitblit instance.<br/>
|
| | | This assumes that the *token* is the *REPOSITORIES* token from the origin gitblit instance. |
| | | The repositories will be put in *git.repositoriesFolder*/example2.
|
| | |
|
| | | federation.example2.url = https://tomcat.gitblit.com/gitblit
|
| | |
| | |
|
| | | #### All-but-One Repository Example
|
| | |
|
| | | This assumes that the *token* is the *REPOSITORIES* token from the origin gitblit instance.<br/>
|
| | | This assumes that the *token* is the *REPOSITORIES* token from the origin gitblit instance. |
| | | The repositories will be put in *git.repositoriesFolder*/example3.
|
| | |
|
| | | federation.example3.url = https://tomcat.gitblit.com/gitblit
|
| | |
| | |
|
| | | #### Just One Repository Example
|
| | |
|
| | | This assumes that the *token* is the *REPOSITORIES* token from the origin gitblit instance.<br/>
|
| | | This assumes that the *token* is the *REPOSITORIES* token from the origin gitblit instance. |
| | | The repositories will be put in *git.repositoriesFolder*/example4.
|
| | |
|
| | | federation.example4.url = https://tomcat.gitblit.com/gitblit
|