1 % the "rc" file (`$HOME/.gitolite.rc`)
5 **IMPORTANT**: if you have a v3.0-v3.3 rc file it is documented [here][rc-33],
6 and it will still work. In fact internally the v3.4 rc file data gets
7 converted to the v3.3 format. That is, you don't have to upgrade your rc file
8 just because you upgraded gitolite; you only need to do that if you wish to
9 use any new features. There's a simple program to help you do that
10 (@@gray(v3.6.1)@@ -- see contrib/utils/rc-format-v3.4).
12 @@gray(**If you're migrating from v2**, there are some settings that MUST be
13 dealt with **before** running `gitolite setup`; please read the
14 [migration][migr] page and linked pages, and especially the one on "presetting
19 @@box-r(Note: This page has several [forward references][fr]!)@@
21 The rc file is designed to be the only thing unique to your site for most
22 setups. What is new is that it is easy to extend it when new needs come up,
23 without having to touch core gitolite.
25 The rc file is perl code, but you do NOT need to know perl to edit it. Just
26 mind the commas, use single quotes unless you know what you're doing, and make
27 sure the brackets and braces stay matched up!
29 The rc file is well commented. Please look at the `~/.gitolite.rc` file that
30 gets installed when you setup gitolite. You can always get a default copy for
31 your current version by running `gitolite print-default-rc`.
33 As you can see there are 3 types of variables in it:
35 * A lot of simple variables (like `UMASK`, `GIT_CONFIG_KEYS`, etc.).
36 * A hash or two (like `ROLES`).
37 * And one large list of features to be enabled (`ENABLE`).
39 This page documents only some of them; for most of them it's best to look in
40 the actual rc file or in each of their individual documentation files around;
41 start with ["non-core" gitolite][non-core]. If a setting is used by a command
42 then running that command with '-h' may give you additional information.
46 * `$UMASK`, octal, default `0077`
48 The default UMASK that gitolite uses gives `rwx------` permissions to all
49 the repos and their contents. People who want to run gitweb (or cgit,
50 redmine, etc) realise that this will not do.
52 The correct way to deal with this is to give this variable a value like
53 `0027` (note the syntax: the leading 0 is required), and then make the
54 user running the webserver (apache, www-data, whatever) a member of the
57 If you've already installed gitolite then existing files will have to be
58 fixed up manually (for a umask or 0027, that would be `chmod -R g+rX`).
59 This is because umask only affects permissions on newly created files, not
62 * `$GIT_CONFIG_KEYS`, string, default empty
64 @@box-r(See the [security note][privesc] at the end of this page for why we do
67 This setting allows the repo admin to define acceptable gitconfig keys.
69 Gitolite allows you to set git config values using the "config" keyword;
70 see [here][git-config] for details and syntax.
72 You have 3 choices. By default `$GIT_CONFIG_KEYS` is left empty, which
73 completely disables this feature (meaning you cannot set git configs via
76 The second choice is to give it a space separated list of settings you
77 consider safe. (These are actually treated as a set of [regular
78 expressions][regex], and any one of them must match).
82 $GIT_CONFIG_KEYS = 'core\.logAllRefUpdates core\..*compression';
84 Each regex should match the *whole* key (in other words, there
85 is an implicit `^` at the start of each regex, and a `$` at the
88 The third choice (which you may have guessed already if you're familiar
89 with regular expressions) is to allow anything and everything:
90 `$GIT_CONFIG_KEYS = '.*';`
92 * `ROLES`, hash, default keys 'READERS' and 'WRITERS'
94 This specifies the role names allowed to be used by users running the
95 [perms][] command. The [wild][] repos doc has more info on roles.
97 * `OWNER_ROLENAME`, string, default undef
99 (requires v3.5 or later)
101 By default, permissions on a wild repo can only be set by the *creator* of
102 the repo (using the [perms][] command). But some sites want to allow
103 other people to do this as well.
105 To enable this behaviour, the server admin must first set this variable to
106 some string, say 'OWNERS'. (He must also add 'OWNERS' to the ROLES hash
107 described in the previous bullet).
109 The creator of the repo can then add other users to the OWNERS role using
110 the [perms][] command.
112 The [perms][] command, the new "owns" command, and possibly other commands
113 in future, will then give these users the same privileges that they give
114 to the creator of the repo.
116 (Also see the full documentation on [roles][]).
118 * `LOCAL_CODE`, string
120 This is described in more detail [here][localcode]. Please be aware
121 **this must be a FULL path**, not a relative path.
123 # security note: gitolite admin and shell access {#privesc}
125 @@box-r(If you *must* revision control it, you can. Just add it to your admin
126 repo, push the change, then replace `~/.gitolite.rc` with a symlink to
127 `~/.gitolite/.gitolite.rc`.)@@
129 People sometimes ask why this file is also not revision controlled. Here's
132 Gitolite maintains a clear distinction between
134 * people who can push to the gitolite-admin repo, and
135 * people who can get a shell or run arbitrary commands on the server.
137 This may not matter to many (small) sites, but in large installations, the
138 former is often a much larger set of people that you really don't want to give
141 Therefore, gitolite tries very hard to make sure that people in the first set
142 are not allowed to do anything that gets them into the second set.