Questions tagged [gitolite]

Gitolite allows you to setup a centralised Git server, with very fine-grained access control and mother powerful features.

Gitolite lets you use a single user on a server to host many git repositories and provide access to many developers, without having to give them real userids on or shell access to the server. The essential magic in doing this is ssh's pubkey access and the authorized_keys file, and the inspiration was an older program called gitosis.

Gitolite can restrict who can read from (clone/fetch) or write to (push) a repository. It can also restrict who can push to what branch or tag, which is very important in a corporate environment. Gitolite can be installed without requiring root permissions, and with no additional software than git itself and perl. It also has several other neat features described below and elsewhere in the doc/ directory.

Gitolite is separate from git, and needs to be installed and configured. So... why do we bother?

Gitolite is useful in any server that is going to host multiple git repositories, each with many developers, where some sort of access control is required.

In theory, this can be done with plain old Unix permissions: each user is a member of one or more groups, each group "owns" one or more repositories, and using unix permissions (especially the setgid bit -- chmod g+s) you can allow/disallow users access to repos.

But there are several disadvantages here:

  • every user needs a userid and password on the server. This is usually a killer, especially in tightly controlled environments
  • adding/removing access rights involves complex usermod -G ... mumblings which most admins would rather not deal with
  • viewing (aka auditing) the current set of permissions requires running multiple commands to list directories and their permissions/ownerships, users and their group memberships, and then correlating all these manually
  • auditing historical permissions or permission changes is pretty much impossible without extraneous tools
  • errors or omissions in setting the permissions exactly can cause problems of either kind: false accepts or false rejects
  • without going into ACLs it is not possible to give someone read-only access to a repo; they either get read-write access or no access
  • it is absolutely impossible to restrict pushing by branch name or tag name.

Gitolite does away with all this:

  • it uses ssh magic to remove the need to give actual unix userids to developers
  • it uses a simple but powerful config file format to specify access rights
  • access control changes are affected by modifying this file, adding or removing user's public keys, and "compiling" the configuration
  • this also makes auditing trivial -- all the data is in one place, and changes to the configuration are also logged, so you can audit them.
  • finally, the config file allows distinguishing between read-only and read-write access, not only at the repository level, but at the branch level within repositories.

Main Features

The most important feature I needed was per-branch permissions. This is pretty much mandatory in a corporate environment, and is almost the single reason I started thinking about writing gitolite.

It's not just "read-only" versus "read-write". Rewinding a branch (aka "non fast forward push") is potentially dangerous, but sometimes needed. So is deleting a branch (which is really just an extreme form of rewind). I needed something in between allowing anyone to do it (the default) and disabling it completely (receive.denyNonFastForwards or receive.denyDeletes).

Some more features - all of them, and more, are documented in detail somewhere in gitolite's doc/ subdirectory:

  • simple, yet powerful, config file syntax, including specifying gitweb/daemon access. You'll need this power if you manage lots of users+repos+combinations of access
  • apart from branch-name based restrictions, you can also restrict by file/dir name changed (i.e., output of git diff --name-only)
  • if your requirements are still too complex, you can split up the config file and delegate authority over parts of it
  • easy to specify gitweb owner, description and gitweb/daemon access
  • easy to sync gitweb (http) authorisation with gitolite's access config
  • comprehensive logging [aka: management does not think "blame" is just a synonym for "annotate" :-)]
  • "personal namespace" prefix for each dev
  • migration guide and simple converter for gitosis conf file
  • "exclude" (or "deny") rights at the branch/tag level
  • specify repos using patterns (patterns may include creator's name)
  • define powerful operations on the server side, even github-like forking

Support

Most installation problems are caused by not knowing ssh. Take a look at this transcript to see how simple it actually is, if your server's ssh daemon is behaving itself. Someone also wrote a tutorial, see here.

If I suspect your problem is an ssh issue, I will probably ignore it. Please learn how gitolite uses ssh and then methodically go through the ssh trouble shooting document. These two documents contain everything I could possibly tell you. I have nothing to add.

Even for other topics, please look through at least the table of contents of at least the numbered documents to see if your question is already answered, before asking.

Security

Due to the environment in which this was created and the need it fills, I consider this a "security" program, albeit a very modest one.

For the first person to find a security hole in it, defined as allowing a normal user (not the gitolite admin) to read a repo, or write/rewind a ref, that the config file says he shouldn't, and caused by a bug in code that is in the "master" branch, (not in the other branches, or the configuration file or in Unix, perl, shell, etc.).

However, there are a few optional features (which must be explicitly enabled in the RC file) where I just haven't had the time to reason about security thoroughly enough. Please read the comments in conf/example.gitolite.rc for details, looking for the word "security".

License

Gitolite is released under GPL v2.

85 questions
1
vote
1 answer

Gitweb gives 404 no projects found

I'm having trouble setting up gitweb with gitolite. Gitolite works correctly, but gitweb keeps giving me a 404 - no projects found. What's strange is that when I run the cgi script as the apache user the following way it seems to work correctly. #…
alexanbj
  • 41
  • 1
  • 6
1
vote
1 answer

Gitolite 502 when trying to clone/fetch any repo over http

I am trying to configure gitolite to work on nginx with gitweb. And despite gitweb working flawlessly and recognizing all the access control functionality provided by gitolite, I can't seem to be able to access the repos themselves over http. For…
Anon34623
  • 21
  • 6
0
votes
1 answer

Possible to rename sub domain for gitolite host?

When I setup my gitolite server back in the day, I called it gitolite.example.com and the users are asking for it to be git.example.com instead. Question If I change the sub domain will all the users repos continue to work? Or do I have to change…
Jasmine Lognnes
  • 2,520
  • 8
  • 33
  • 51
0
votes
1 answer

gitolite admin DENIED by fallthru

I have an issue with SSH keys and gitolite on my macbook. Gitolite is running on my debian server: gitolite3 3.6.4-1 (Debian) on git 2.7.4 gitolite-admin/keydir i have the keys bob.pub and admin.pub They are different keys. my conf file is…
SpiRail
  • 171
  • 2
  • 6
0
votes
1 answer

Impossible configuration in gitolite?

I am banging my head on a wall with this one and getting nowhere. I hope that someone here has a clue or just confirm my impression that it's impossible to do. I am using gitolite 2.3 on an internal repository to apply advanced ACLs. I have been…
bronto
  • 121
  • 11
0
votes
1 answer

nginx separate regex for git-upload-pack and git-receive-pack

I have this location ~ ^.*user/repo\.git\/(HEAD|info/refs|objects/info/.*|git-upload-pack)${ //send to fastcgi_param SCRIPT_FILENAME /usr/bin/gitolite-shell; } This is working for clone. I have modified Gitolite so I can make public repos…
pregmatch
  • 303
  • 1
  • 5
  • 14
0
votes
0 answers

How to setup separate projectName/gitolite-admin.git configuration repositories with Gitolite?

I want to setup a Gitolite based installation for hosting git repositories in a small organization for a limited set of projects (100 projects at most, probably less than 30) with repositories under directories…
jotik
  • 159
  • 6
0
votes
1 answer

Gitlab setup, rake fails because no --global user.name

Following the 5.1 instructions to install gitlab https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md When I run the command to test the install, I get an error "Git configured for user? ... no" root@gitlab:/home/git/gitlab#…
spuder
  • 1,725
  • 3
  • 26
  • 42
0
votes
1 answer

Allow users to configure notified email addresses

I want my users to be able to subscribe new commit notifications. Subscriptions should be per gitolite repository, and the user shouldn't have to contact me every time they want to add a subscription or project. Is there a hook which allows that?
phihag
  • 232
  • 1
  • 11
0
votes
2 answers

gitolite post commit hook to update redmine's repository

I currently have a ubuntu server machine which has gitolite and redmine installed. Redmine accesses repository copies which are updated using a cron task. Having a cron task to pull the updates seems like an overkill is there anyway a gitolite…
eliocs
  • 197
  • 1
  • 2
  • 9
1 2 3 4 5
6