Gitosis
Download Source: | See Below |
---|
Contents
Introduction to Gitosis
gitosis aims to make hosting git repos easier and safer. It manages multiple repositories under one user account, using SSH keys to identify users. End users do not need shell accounts on the server, they will talk to one shared account that will not let them run arbitrary commands.
Project Homepage: Unknown
Getting the Source
Make sure that you have GIT installed and working then execute the following command:
git clone git://eagain.net/gitosis.git
You may wish to create a tarball of the checked out code for future reference.
tar cvjf gitosis-$(date '+%Y%m%d').tar.bz2 gitosis
Dependencies
Required
Recommended
- Sudo (For Configuration, su can be used instead)
Git User/Group
groupadd -g 55 git && useradd -c 'GIT User' -d /home/git -g git -s /bin/false -u 55 git && install -o git -g git -d git
Non-Multilib
Install the package
python setup.py install
Multilib
32Bit
Install the package
USE_ARCH=32 python setup.py install
N32
Install the package
USE_ARCH=n32 python setup.py install
64Bit
Install the package
USE_ARCH=64 python setup.py install
Configuring Gitosis
If you do not already have a ssh key for your user generate one now with:
ssh-keygen -t rsa
Two files will be generated in your ~/.ssh directory, id_rsa and id_rsa.pub. Copy id_rsa.pub to the machine with the Gitosis install. Any directory that the git user has access too works. Then execute the following command:
sudo -H -u git gitosis-init < /path/to/id_rsa.pub
Note: -H makes sudo switch the user's home directory. -u git says to switch to the git user.
The previous command authorized that public key to the Gitosis repository.
On the machine with the Gitosis install make sure that the post-update hook is executeable in the Gitosis repository:
chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update
From the machine that you created the ssh key on, create a clone of the gitosis repository:
git clone git@[YOUR_SERVER_HOSTNAME]:gitosis-admin.git cd gitosis-admin