We now have a working git server for
testing purposes (do with it as you please but don't put anything important there as that jail will be destroyed and rebuilt later!). It's located in an automatically created (using SaltStack) jail on the virtual server that is meant to become the EU mirror in the future. That jail uses a program called
Gitolite to manage the repos. (That "admin_key" is currently mine; it will have the proper name when I rebuild the jail.)
Here's a quick guide on how to work with the repos
------------------------------------------------------------------------
First clone a repo called "gitolite-admin" to your workstation:
Code: Select all
% git clone ssh://git@212.77.245.35:220/gitolite-admin
This repo is used to control the whole thing, no need to actually log into the jail (except for deleting repos which has to be done by hand). First take a look at what you cloned. It has the following structure:
Code: Select all
.
├── conf
│ └── gitolite.conf
└── keydir
├── admin_key.pub
├── asx.pub
└── ericbsd.pub
To add any new user, simply place a .pub file containing an SSH key into the "keydir" directory, git add, git commit and git push. Gitolite will automatically create the new user then (with a username that matches the filename without the extension).
And then there's
gitolite.conf in the
conf dir. This is what controls the repos.
Want Gitolite to create a new repo called "somename"? Just add a line to the configuration:
Then again: Add, commit and push. That's all.
Below each repo you assign permissions like this:
Code: Select all
repo example
RW+ = ericbsd
RW = asx
R = kraileth
In this example I (if my key was named correctly...) wold be allowed to clone the repo but not to do anything else. ASX could clone it, change things and push changes. And Eric could do all that and even has the power to delete files (that's the "+" privilege).
We can also define groups. Group definitions start with an @ and then you assign members. The group "@all" is implicit and can be used even without defining it. I've added a group called "staff":
Well, that's actually the basics already. There's not much more to know to use it. Happy testing (and let me know if you find out anything)!