Skip to content

Commit

Permalink
Largely completed, uber-cool federation feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
gitblit committed Sep 12, 2011
1 parent cbf5950 commit 831469b
Show file tree
Hide file tree
Showing 75 changed files with 3,758 additions and 125 deletions.
8 changes: 7 additions & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/jdom-1.1-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ext/junit-4.8.2.jar"/>
<classpathentry kind="lib" path="ext/junit-4.8.2.jar" sourcepath="C:/Users/James Moger/.m2/repository/junit/junit/4.8.2/junit-4.8.2-sources.jar"/>
<classpathentry kind="lib" path="ext/org.eclipse.jgit-1.0.0.201106090707-r.jar" sourcepath="ext/org.eclipse.jgit-1.0.0.201106090707-r-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/org.eclipse.jgit-1.0.0.201106090707-r-javadoc.jar!/"/>
Expand All @@ -91,5 +91,11 @@
<attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/markdownpapers-core-1.1.1-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ext/gson-1.7.1.jar" sourcepath="ext/gson-1.7.1-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/gson-1.7.1-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ext/mail-1.4.3.jar" sourcepath="ext/mail-1.4.3-sources.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
/build.properties
/war
/*.war
/proposals
16 changes: 16 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,22 @@ jdom

http://www.jdom.org

---------------------------------------------------------------------------
google-gson
---------------------------------------------------------------------------
google-gson, released under the
Apache-style Software License.

http://code.google.com/p/google-gson

---------------------------------------------------------------------------
javamail
---------------------------------------------------------------------------
javamail, released under multiple licenses
CDDL-1.0, BSD, GPL-2.0, GNU-Classpath.

http://kenai.com/projects/javamail

---------------------------------------------------------------------------
JUnit
---------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
<include name="bug_16x16.png" />
<include name="book_16x16.png" />
<include name="blank.png" />
<include name="federated_16x16.png" />
</fileset>

<!-- Copy Doc images -->
Expand Down Expand Up @@ -378,6 +379,7 @@
<include name="bug_16x16.png" />
<include name="book_16x16.png" />
<include name="blank.png" />
<include name="federated_16x16.png" />
</fileset>

<!-- Copy Doc images -->
Expand Down
134 changes: 134 additions & 0 deletions distrib/gitblit.properties
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ web.syndicationEntries = 25
# SINCE 0.5.2
web.showRepositorySizes = true

# Show federation registrations (without token) and the current pull status
# to non-administrator users.
#
# SINCE 0.6.0
web.showFederationRegistrations = false

# This is the message display above the repositories table.
# This can point to a file with Markdown content.
# Specifying "gitblit" uses the internal welcome message.
Expand Down Expand Up @@ -265,6 +271,134 @@ regex.global.changeid = \\b(Change-Id:\\s*)([A-Za-z0-9]*)\\b!!!<a href="http://s
# Example per-repository regex substitutions overrides global
regex.myrepository.bug = \\b(Bug:)(\\s*[#]?|-){0,1}(\\d+)\\b!!!<a href="http://elsewhere/bug/$3">Bug-Id: $3</a>

#
# Mail Settings
# SINCE 0.6.0
#
# Mail settings are used to notify administrators of received federation proposals
#

# ip or hostname of smtp server
#
# SINCE 0.6.0
mail.server =

# port to use for smtp requests
#
# SINCE 0.6.0
mail.port = 25

# debug the mail executor
#
# SINCE 0.6.0
mail.debug = false

# if your smtp server requires authentication, supply the credentials here
#
# SINCE 0.6.0
mail.username =
mail.password =

# from address for generated emails
#
# SINCE 0.6.0
mail.fromAddress =

# Space-separated list of email addresses for the Gitblit administrators
#
# SINCE 0.6.0
mail.adminAddresses =

#
# Federation Settings
# SINCE 0.6.0
#
# A Gitblit federation is a way to backup one Gitblit instance to another.
#
# *git.enableGitServlet* must be true to use this feature.

#
# Control whether or not this Gitblit instance can receive federation proposals
# from another Gitblit instance. Registering a federated Gitblit is a manual
# process. Proposals help to simplify that process by allowing a remote Gitblit
# instance to send your Gitblit instance the federation pull data.
#
# SINCE 0.6.0
federation.allowProposals = false

# The destination folder for cached federation proposals.
# Use forward slashes even on Windows!!
#
# SINCE 0.6.0
federation.proposalsFolder = proposals

# The default pull frequency if frequency is unspecified on a registration
#
# SINCE 0.6.0
federation.defaultFrequency = 60 mins

# Specify the unique id of this Gitblit instance.
#
# An unspecified (empty) uuid disables procesing federation requests.
#
# This value can be anything you want: an integer, a sentence, an haiku, etc.
# Keep the value simple, though, to avoid Java properties file encoding issues.
#
# Changing your uuid will break any registrations you have established with other
# Gitblit instances.
#
# CASE-SENSITIVE
# SINCE 0.6.0
# RESTART REQUIRED
federation.uuid =

# Your federation name is used for federation status acknowledgments. If it is
# unset, and you elect to send a status acknowledgment, your Gitblit instance
# will be identified by its hostname, if available, else your internal ip address.
# The source Gitblit instance will also append your external IP address to your
# identification to differentiate multiple pulling systems behind a single proxy.
#
# SINCE 0.6.0
federation.name =

# Federation pull registrations
# Registrations are read once, at startup.
#
# RESTART REQUIRED
#
# frequency:
# The shortest frequency allowed is every 5 minutes
# Decimal frequency values are cast to integers
# Frequency values may be specified in mins, hours, or days
# Values that can not be parsed default to *federation.defaultFrequency*
#
# folder:
# if blank, the folder is *git.repositoriesFolder*
# if specified, the folder is relative to *git.repositoriesFolder*
#
# mergeAccounts:
# if true, remote accounts and their permissions are merged into your
# users.properties file
#
# notifyOnError:
# if true and the mail configuration is properly set, administrators will be
# notified by email of pull failures
#
# include and exclude:
# space-separated list of repositories to include or exclude from pull
# may be * wildcard to include or exclude all
# may use fuzzy match (e.g. org.eclipse.*)

#
# (Nearly) Perfect Mirror example
#

#federation.example1.url = https://go.gitblit.com
#federation.example1.token = 6f3b8a24bf970f17289b234284c94f43eb42f0e4
#federation.example1.frequency = 120 mins
#federation.example1.folder =
#federation.example1.mergeAccounts = true

#
# Server Settings
#
Expand Down
2 changes: 1 addition & 1 deletion distrib/users.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## Gitblit realm file format: username=password,\#permission,repository1,repository2...
#Fri Jul 22 14:27:08 EDT 2011
admin=admin,\#admin
admin=admin,\#admin,\#notfederated
23 changes: 12 additions & 11 deletions docs/00_index.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@ Gitblit requires a Java 6 Runtime Environment (JRE) or a Java 6 Development Kit

**%VERSION%** ([go](http://code.google.com/p/gitblit/downloads/detail?name=%GO%)|[war](http://code.google.com/p/gitblit/downloads/detail?name=%WAR%)) based on [%JGIT%][jgit] &nbsp; *released %BUILDDATE%*

- fixed: active repositories with a HEAD that pointed to an empty branch caused internal errors (issue 14)
- fixed: bare-cloned repositories were listed as (empty) and were not clickable (issue 13)
- fixed: default port for Gitblit GO is now 8443 to be more linux/os x friendly (issue 12)
- fixed: repositories can now be reliably deleted and renamed (issue 10)
- fixed: users can now change their passwords (issue 1)
- fixed: always show root repository group first, i.e. don't sort root group with other groups
- fixed: tone-down repository group header color
- added: optionally display repository on-disk size on repositories page<br/>**New:** *web.showRepositorySizes = true*
- added: forward-slashes ('/', %2F) can be encoded using a custom character to workaround some servlet container default security measures for proxy servers<br/>**New:** *web.forwardSlashCharacter = /*
- updated: MarkdownPapers 1.1.0
- updated: Jetty 7.4.3
- added: federation feature to allow gitblit instances to pull repositories and, optionally, settings and accounts from other gitblit instances.<br/>
This is something like svn-sync for gitblit.
<br/>**New:** *federation.allowProposals = false*
<br/>**New:** *federation.proposalsFolder = proposals*
<br/>**New:** *federation.defaultFrequency = 60 mins*
<br/>**New:** *federation.uuid =*
<br/>**New:** *federation.name =*
<br/>**New:** *mail.* settings for sending emails
<br/>**New:** user role *#notfederated* to prevent a user account from being pulled by a federated Gitblit instance
- added: google-gson dependency
- added: javamail dependency
- updated: MarkdownPapers 1.1.1

issues, binaries, and sources @ [Google Code][googlecode]<br/>
sources @ [Github][gitbltsrc]
Expand Down
1 change: 1 addition & 0 deletions docs/01_features.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<li>![view](shield_16x16.png) *Authenticated View, Clone & Push*</li>
<li>![freeze](cold_16x16.png) Freeze repository (i.e. deny push, make read-only)
</ul>
- Ability to federate with one or more other Gitblit instances
- Gitweb inspired web UI
- Administrators may create, edit, rename, or delete repositories through the web UI
- Administrators may create, edit, rename, or delete users through the web UI
Expand Down
8 changes: 5 additions & 3 deletions docs/01_setup.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Open `web.xml` in your favorite text editor and make sure to review and set:
Open `gitblit.properties` in your favorite text editor and make sure to review and set:
- *git.repositoryFolder* (path may be relative or absolute)
- *server.tempFolder* (path may be relative or absolute)
- *server.httpPort* and *server.httpsPort*<br/>
- *server.httpPort* and *server.httpsPort*
- *server.httpBindInterface* and *server.httpsBindInterface*<br/>
**https** is strongly recommended because passwords are insecurely transmitted form your browser/git client using Basic authentication!
**https** is strongly recommended because passwords are insecurely transmitted form your browser/git client using Basic authentication!
3. Execute `gitblit.cmd` or `java -jar gitblit.jar` from a command-line
4. Wait a minute or two while all dependencies are downloaded and your self-signed *localhost* certificate is generated.<br/>Please see the section titled **Creating your own Self-Signed Certificate** to generate a certificate for *your hostname*.
5. Open your browser to <http://localhost:8080> or <https://localhost:8443> depending on your chosen configuration.
Expand Down Expand Up @@ -130,6 +130,8 @@ All repository settings are stored within the repository `.git/config` file unde
accessRestriction = clone
isFrozen = false
showReadme = false
excludeFromFederation = false
isFederated = false
#### Repository Names
Repository names must be unique and are CASE-SENSITIVE ON CASE-SENSITIVE FILESYSTEMS. The name must be composed of letters, digits, or `/ _ - .`<br/>
Expand All @@ -156,7 +158,7 @@ Whitespace is illegal.
User passwords are CASE-SENSITIVE and may be *plain* or *md5* formatted (see `gitblit.properties` -> *realm.passwordStorage*).

#### User Roles
There is only one actual *role* in Gitblit and that is *#admin* which grants administrative powers to that user. 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.
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
Instead of maintaining a `users.properties` file, you may want to integrate Gitblit into an existing environment.
Expand Down
Loading

0 comments on commit 831469b

Please sign in to comment.