2009-08-26 02:47:27 +02:00
|
|
|
# example conf file for gitolite
|
2009-08-23 07:59:07 +02:00
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# ----------------------------------------------------------------------------
|
2009-08-24 06:37:33 +02:00
|
|
|
# overall syntax:
|
2009-11-12 13:58:08 +01:00
|
|
|
# - everything is space-separated; no commas, semicolons, etc (except in
|
|
|
|
# the description string for gitweb)
|
2009-08-24 06:37:33 +02:00
|
|
|
# - comments in the normal shell-ish style; no surprises there
|
2009-11-12 13:58:08 +01:00
|
|
|
# - there are NO continuation lines of any kind
|
2009-12-08 10:33:38 +01:00
|
|
|
# - user/repo names as simple as possible; they must start with an
|
|
|
|
# alphanumeric, but after that they can also contain ".", "_", "-".
|
|
|
|
# - usernames can optionally be followed by an "@" and a domainname
|
|
|
|
# containing at least one "." (this allows you to use an email
|
|
|
|
# address as someone's username)
|
|
|
|
# - reponames can contain "/" characters (this allows you to
|
|
|
|
# put your repos in a tree-structure for convenience)
|
2009-08-23 10:14:46 +02:00
|
|
|
|
2009-08-23 07:59:07 +02:00
|
|
|
# objectives, over and above gitosis:
|
|
|
|
# - simpler syntax
|
2009-09-25 08:47:33 +02:00
|
|
|
# - easier gitweb/daemon control
|
|
|
|
# - specify who can push a branch/tag
|
|
|
|
# - specify who can rewind a branch/rewrite a tag
|
|
|
|
|
2009-08-23 07:59:07 +02:00
|
|
|
# ----------------------------------------------------------------------------
|
2009-11-12 13:58:08 +01:00
|
|
|
|
|
|
|
# GROUPS
|
|
|
|
# ------
|
2009-08-24 06:37:33 +02:00
|
|
|
|
|
|
|
# syntax:
|
2009-11-12 13:58:08 +01:00
|
|
|
# @groupname = [one or more names]
|
2009-08-24 06:37:33 +02:00
|
|
|
|
2009-11-30 02:30:31 +01:00
|
|
|
# groups let you club (user or group) names together for convenience
|
|
|
|
|
|
|
|
# * a group is like a #define in C except that it can *accumulate* values
|
|
|
|
# * the config file is parsed in a single-pass, so later *additions* to a
|
|
|
|
# group name cannot affect earlier *uses* of it
|
|
|
|
|
|
|
|
# The following examples should illustrate all this:
|
2009-10-14 07:40:06 +02:00
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# you can have a group of people...
|
|
|
|
@staff = sitaram some_dev another-dev
|
2009-10-14 07:40:06 +02:00
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# ...or a group of repos
|
|
|
|
@oss_repos = gitolite linux git perl rakudo entrans vkc
|
2009-08-24 06:37:33 +02:00
|
|
|
|
2010-06-15 19:31:22 +02:00
|
|
|
# ...or even a group of refexes
|
|
|
|
@important = master$ QA_done refs/tags/v[0-9]
|
|
|
|
# (see later for what "refex"s are; I'm only mentioning it
|
|
|
|
# here to emphasise that you can group them too)
|
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# even sliced and diced differently
|
|
|
|
@admins = sitaram admin2
|
|
|
|
# notice that sitaram is in 2 groups (staff and admins)
|
2009-08-24 10:00:58 +02:00
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# if you repeat a group name in another definition line, the
|
|
|
|
# new ones get added to the old ones (they accumulate)
|
|
|
|
@staff = au.thor
|
|
|
|
# so now "@staff" expands to all 4 names
|
2009-08-23 07:59:07 +02:00
|
|
|
|
2009-11-30 02:30:31 +01:00
|
|
|
# groups can include other groups, and the included group will
|
|
|
|
# be expanded to whatever value it currently has
|
2009-11-12 13:58:08 +01:00
|
|
|
@interns = indy james
|
|
|
|
@staff = bob @interns
|
|
|
|
# "@staff" expands to 7 names now
|
2009-11-30 02:30:31 +01:00
|
|
|
@interns = han
|
|
|
|
# "@interns" now has 3 names in it, but note that this does
|
|
|
|
# not change @staff
|
2009-09-15 17:37:00 +02:00
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# REPO AND BRANCH PERMISSIONS
|
|
|
|
# ---------------------------
|
2009-10-14 07:40:06 +02:00
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# syntax:
|
|
|
|
# start line:
|
|
|
|
# repo [one or more repos and/or repo groups]
|
|
|
|
# followed by one or more permissions lines:
|
2010-06-18 16:44:40 +02:00
|
|
|
# (C|R|RW|RW+|RWC|RW+C|RWD|RW+D|RWCD|RW+CD) [zero or more refexes] = [one or more users]
|
2009-09-15 17:37:00 +02:00
|
|
|
|
2010-04-15 03:02:39 +02:00
|
|
|
# there are 6 types of permissions: R, RW, and RW+ are simple (the "+" means
|
2010-03-30 16:31:49 +02:00
|
|
|
# permission to "rewind" -- force push a non-fast forward to -- a branch).
|
2010-06-18 16:44:40 +02:00
|
|
|
# The *standalone* C permission pertains to creating a REPO and is described
|
2010-11-15 00:54:03 +01:00
|
|
|
# in doc/wildcard-repositories.mkd. The C and D *suffixes* to the RW/RW+
|
2010-06-18 16:44:40 +02:00
|
|
|
# permissions pertain to creating or deleting a BRANCH, and are described in
|
|
|
|
# doc/3-faq-tips-etc.mkd, in the sections on "separating push and create
|
|
|
|
# rights" and "separating delete and rewind rights" respectively.
|
2009-08-24 06:37:33 +02:00
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# how permissions are matched:
|
|
|
|
# - user, repo, and access (W or +) are known. For that combination, if
|
|
|
|
# any of the refexes match the refname being updated, the push succeeds.
|
|
|
|
# If none of them match, it fails
|
|
|
|
|
|
|
|
# what's a refex? a regex to match against the ref being updated (get it?)
|
2010-02-08 05:29:27 +01:00
|
|
|
# See next section for more on refexes
|
2009-08-24 06:37:33 +02:00
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# BASIC PERMISSIONS (repo level only; apply to all branches/tags in repo)
|
2009-08-23 07:59:07 +02:00
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# most important rule of all -- specify who can make changes
|
|
|
|
# to *this* file take effect
|
|
|
|
repo gitolite-admin
|
|
|
|
RW+ = @admins
|
2009-09-10 15:35:07 +02:00
|
|
|
|
2009-12-08 09:21:11 +01:00
|
|
|
# "@all" is a special, predefined, group name of all users
|
|
|
|
# (everyone who has a pubkey in keydir)
|
2009-11-12 13:58:08 +01:00
|
|
|
repo testing
|
|
|
|
RW+ = @all
|
2009-08-24 06:37:33 +02:00
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# this repo is visible to staff but only sitaram can write to it
|
|
|
|
repo gitolite
|
|
|
|
R = @staff
|
|
|
|
RW+ = sitaram
|
|
|
|
|
2010-02-26 21:11:38 +01:00
|
|
|
# you can split up access rules for a repo for convenience
|
2009-11-12 13:58:08 +01:00
|
|
|
# (notice that @oss_repos contains gitolite also)
|
|
|
|
repo @oss_repos
|
|
|
|
R = @all
|
|
|
|
|
2010-03-23 17:50:34 +01:00
|
|
|
# set permissions to all repos. *Please* do see
|
|
|
|
# doc/3-faq-tips-etc.mkd for notes on this feature
|
2009-12-21 00:55:45 +01:00
|
|
|
repo @all
|
|
|
|
RW+ = @admins
|
|
|
|
|
2010-02-08 05:29:27 +01:00
|
|
|
# SPECIFYING AND USING A REFEX
|
2009-09-16 16:22:03 +02:00
|
|
|
|
|
|
|
# - refexes are specified in perl regex syntax
|
2010-02-08 05:29:27 +01:00
|
|
|
# - refexes are prefix-matched (they are internally anchored with "^"
|
|
|
|
# before being used), which means a refex like "refs/tags/v[0-9]"
|
|
|
|
# matches anything *starting with* that pattern. There may be text
|
|
|
|
# after it (example: refs/tags/v4-r3/p7), and it will still match
|
|
|
|
|
|
|
|
# ADVANCED PERMISSIONS USING REFEXES
|
|
|
|
|
2009-09-16 16:22:03 +02:00
|
|
|
# - if no refex appears, the rule applies to all refs in that repo
|
|
|
|
# - a refex is automatically prefixed by "refs/heads/" if it doesn't start
|
|
|
|
# with "refs/" (so tags have to be explicitly named as
|
|
|
|
# refs/tags/pattern)
|
2009-08-23 07:59:07 +02:00
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# here's the example from
|
|
|
|
# Documentation/howto/update-hook-example.txt:
|
2009-08-23 07:59:07 +02:00
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# refs/heads/master junio
|
|
|
|
# +refs/heads/pu junio
|
|
|
|
# refs/heads/cogito$ pasky
|
|
|
|
# refs/heads/bw/.* linus
|
|
|
|
# refs/heads/tmp/.* .*
|
|
|
|
# refs/tags/v[0-9].* junio
|
2009-09-16 16:22:03 +02:00
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# and here're the equivalent gitolite refexes
|
|
|
|
repo git
|
|
|
|
RW master = junio
|
|
|
|
RW+ pu = junio
|
|
|
|
RW cogito$ = pasky
|
|
|
|
RW bw/ = linus
|
|
|
|
RW tmp/ = @all
|
|
|
|
RW refs/tags/v[0-9] = junio
|
2009-09-16 16:22:03 +02:00
|
|
|
|
2009-12-01 02:45:05 +01:00
|
|
|
# DENY/EXCLUDE RULES
|
2009-09-18 14:33:53 +02:00
|
|
|
|
2010-01-31 07:13:43 +01:00
|
|
|
# ***IMPORTANT NOTES ABOUT "DENY" RULES***:
|
|
|
|
|
2010-12-24 06:31:28 +01:00
|
|
|
# - deny rules do NOT affect read access. They only apply to write access.
|
2010-01-31 07:13:43 +01:00
|
|
|
#
|
|
|
|
# - when using deny rules, the order of your rules starts to matter, where
|
|
|
|
# earlier it did not. The first matching rule applies, where "matching" is
|
|
|
|
# defined as either permitting the operation you're attempting (`W` or `+`),
|
|
|
|
# which results in success, or a "deny" (`-`), which results in failure.
|
|
|
|
# (As before, a fallthrough also results in failure).
|
2009-09-18 14:33:53 +02:00
|
|
|
|
|
|
|
# in the example above, you cannot easily say "anyone can write any tag,
|
|
|
|
# except version tags can only be written by junio". The following might look
|
|
|
|
# like it works but it doesn't:
|
|
|
|
|
|
|
|
# RW refs/tags/v[0-9] = junio
|
|
|
|
# RW refs/tags/ = junio linus pasky @others
|
|
|
|
|
2009-12-01 02:45:05 +01:00
|
|
|
# if you use "deny" rules, however, you can do this (a "deny" rule just uses
|
|
|
|
# "-" instead of "R" or "RW" or "RW+" in the permission field)
|
2009-09-18 14:33:53 +02:00
|
|
|
|
|
|
|
RW refs/tags/v[0-9] = junio
|
|
|
|
- refs/tags/v[0-9] = linus pasky @others
|
|
|
|
RW refs/tags/ = junio linus pasky @others
|
|
|
|
|
2010-01-07 13:29:34 +01:00
|
|
|
# FILE/DIR NAME BASED RESTRICTIONS
|
|
|
|
# --------------------------------
|
|
|
|
|
|
|
|
# Here's a hopefully self-explanatory example. Assume the project has the
|
|
|
|
# following contents at the top level: a README, a "doc/" directory, and an
|
|
|
|
# "src/" directory.
|
|
|
|
|
|
|
|
repo foo
|
|
|
|
RW+ = lead_dev # rule 1
|
|
|
|
RW = dev1 dev2 dev3 dev4 # rule 2
|
|
|
|
|
|
|
|
RW NAME/ = lead_dev # rule 3
|
|
|
|
RW NAME/doc/ = dev1 dev2 # rule 4
|
|
|
|
RW NAME/src/ = dev1 dev2 dev3 dev4 # rule 5
|
|
|
|
|
|
|
|
# Notes
|
|
|
|
|
2010-02-08 05:29:27 +01:00
|
|
|
# - the "NAME/" is part of the syntax; think of it as a keyword if you like.
|
|
|
|
# The rest of it is treated as a refex to match against each file being
|
|
|
|
# touched (see "SPECIFYING AND USING A REFEX" above for details)
|
2010-01-07 13:29:34 +01:00
|
|
|
|
|
|
|
# - file/dir NAME-based restrictions are *in addition* to normal (branch-name
|
|
|
|
# based) restrictions; they are not a *replacement* for them. This is why
|
|
|
|
# rule #2 (or something like it, maybe with a more specific branch-name) is
|
|
|
|
# needed; without it, dev1/2/3/4 cannot push any branches.
|
|
|
|
|
|
|
|
# - if a repo has *any* NAME/ rules, then NAME-based restrictions are checked
|
|
|
|
# for *all* users. This is why rule 3 is needed, even though we don't
|
|
|
|
# actually have any NAME-based restrictions on lead_dev. Notice the pattern
|
|
|
|
# on rule 3.
|
|
|
|
|
|
|
|
# - *each* file touched by the commits being pushed is checked against those
|
|
|
|
# rules. So, lead_dev can push changes to any files, dev1/2 can push
|
|
|
|
# changes to files in "doc/" and "src/" (but not the top level README), and
|
|
|
|
# dev3/4 can only push changes to files in "src/".
|
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# GITWEB AND DAEMON STUFF
|
|
|
|
# -----------------------
|
2009-08-23 07:59:07 +02:00
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# No specific syntax for gitweb and daemon access; just make the repo readable
|
|
|
|
# ("R" access) to the special users "gitweb" and "daemon"
|
2009-10-14 07:40:06 +02:00
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# make "@oss_repos" (all 7 of them!) accessible via git daemon
|
|
|
|
repo @oss_repos
|
|
|
|
R = daemon
|
2009-08-23 07:59:07 +02:00
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# make the two *large* repos accessible via gitweb
|
|
|
|
repo linux perl
|
|
|
|
R = gitweb
|
2009-10-14 07:40:06 +02:00
|
|
|
|
2009-11-27 09:17:21 +01:00
|
|
|
# REPO OWNER/DESCRIPTION LINE FOR GITWEB
|
2009-08-23 07:59:07 +02:00
|
|
|
|
2009-11-27 09:17:21 +01:00
|
|
|
# syntax, one of:
|
2009-11-12 13:58:08 +01:00
|
|
|
# reponame = "some description string in double quotes"
|
2009-11-27 09:17:21 +01:00
|
|
|
# reponame "owner name" = "some description string in double quotes"
|
2009-09-25 08:47:33 +02:00
|
|
|
|
2009-11-12 13:58:08 +01:00
|
|
|
# note: setting a description also gives gitweb access; you do not have to
|
|
|
|
# give gitweb access as described above if you're specifying a description
|
2009-09-25 08:47:33 +02:00
|
|
|
|
2009-11-27 09:17:21 +01:00
|
|
|
gitolite "Sitaram Chamarty" = "fast, secure, access control for git in a corporate environment"
|
2009-12-09 07:46:22 +01:00
|
|
|
|
|
|
|
# REPO SPECIFIC GITCONFIG
|
|
|
|
# -----------------------
|
|
|
|
|
2010-02-07 08:39:16 +01:00
|
|
|
# update 2010-02-06; this won't work unless the rc file has the right
|
|
|
|
# settings; please see comments around the variable $GL_GITCONFIG_KEYS in
|
|
|
|
# conf/example.gitolite.rc for details and security information.
|
|
|
|
|
2009-12-09 07:46:22 +01:00
|
|
|
# (Thanks to teemu dot matilainen at iki dot fi)
|
|
|
|
|
|
|
|
# this should be specified within a "repo" stanza
|
|
|
|
|
|
|
|
# syntax:
|
|
|
|
# config sectionname.keyname = [optional value_string]
|
|
|
|
|
2010-03-10 01:54:53 +01:00
|
|
|
# example usage: if you placed a hook in hooks/common that requires
|
|
|
|
# configuration information that is specific to each repo, you could do this:
|
2009-12-09 07:46:22 +01:00
|
|
|
|
|
|
|
repo gitolite
|
|
|
|
config hooks.mailinglist = gitolite-commits@example.tld
|
|
|
|
config hooks.emailprefix = "[gitolite] "
|
|
|
|
config foo.bar = ""
|
|
|
|
config foo.baz =
|
|
|
|
|
|
|
|
# This does either a plain "git config section.key value" (for the first 3
|
|
|
|
# examples above) or "git config --unset-all section.key" (for the last
|
|
|
|
# example). Other forms (--add, the value_regex, etc) are not supported.
|
2010-01-27 12:18:56 +01:00
|
|
|
|
|
|
|
# INCLUDE SOME OTHER FILE
|
|
|
|
# -----------------------
|
|
|
|
|
|
|
|
include "foo.conf"
|
|
|
|
|
|
|
|
# this includes the contents of $GL_ADMINDIR/conf/foo.conf here
|
|
|
|
|
|
|
|
# Notes:
|
|
|
|
# - the include statement is not allowed inside delegated fragments for
|
|
|
|
# security reasons.
|
|
|
|
# - you can also use an absolute path if you like, although in the interests
|
|
|
|
# of cloning the admin-repo sanely you should avoid doing this!
|
2010-01-31 15:54:36 +01:00
|
|
|
|
|
|
|
# EXTERNAL COMMAND HELPERS -- RSYNC
|
|
|
|
# ---------------------------------
|
|
|
|
|
|
|
|
# If $RSYNC_BASE is non-empty, the following config entries come into play
|
|
|
|
# (otherwise they are ignored):
|
|
|
|
|
|
|
|
# a "fake" git repository to collect rsync rules. Gitolite does not
|
|
|
|
# auto-create any repo whose name starts with EXTCMD/
|
|
|
|
repo EXTCMD/rsync
|
|
|
|
# grant permissions to files/dirs within the $RSYNC_BASE tree. A leading
|
|
|
|
# NAME/ is required as a prefix; the actual path starts after that. Matching
|
2010-02-08 05:29:27 +01:00
|
|
|
# follows the same rules as given in "FILE/DIR NAME BASED RESTRICTIONS" above
|
2010-01-31 15:54:36 +01:00
|
|
|
RW NAME/ = sitaram
|
|
|
|
RW NAME/foo/ = user1
|
|
|
|
R NAME/bar/ = user2
|
|
|
|
# just to remind you that these are perl regexes, not shell globs
|
|
|
|
RW NAME/baz/.*/*.c = user3
|