Posts Tagged ‘github’

merb-auth-slice-activation progress

December 8th, 2008

I have been playing around with merb-auth for an upcoming project and have had my first, very small, contribution to the community. It is a fork of CK’s original merb-auth-slice-activation, but with options to modify functionality through additional configuration parameters. You can follow, or contribute, to it over at github.

Tags: ,
Posted in Development, Merb | Comments (0)

Git your own server!

August 11th, 2008

With the recent boom of GitHub, there are thousands migrating from old subversion and even cvs servers to git. Surprisingly however, many people would rather pay GitHub to host their site instead of doing it themselves. Well I may be on the git bandwagon, but I am definitely not on the pay-for-git one. I recently setup two git servers (for redundancy). This will be a brief tutorial on getting your own git server running on Debian Etch/Lenny/Sid (or Ubuntu).

First we need to install git. Simple enough with this command:
[code language="shell"]$ sudo apt-get install git-core git-doc git-svn git-email git-cvs[/code]
Now we want to ensure git installed correctly
[code language="shell"]$ git –version
git version 1.5.6.3[/code]
If you are running Debian Etch, you need to use the backports-etch repo to install git >= 1.5. Or compile it from source.

Alright then just follow the commands:
[sourcecode language="shell"]$ sudo apt-get install python
$ sudo apt-get install python-setuptools[/sourcecode]
Once those are installed just copy paste the following commands. We are going to use gitosis as a way to manage repositories and git access privileges.
[code language="shell"]$ git clone git://eagain.net/gitosis
$ cd gitosis
$ python setup.py install[/code]
If you receive any errors from running the setup.py script, ensure you installed all the packages above from apt-get.
[sourcecode language="shell"]$ sudo adduser \
–system \
–shell /bin/sh \
–gecos ‘git version control’ \
–group \
–disabled-password \
–home /home/git \
git[/sourcecode]
This will setup all your repositories inside of /home/git, feel free to change this to whatever location you desire. Now thats all done, we just need to get your SSH certificate setup so that you can initialize your gitosis install.

This is how it would be done on OSX (this guide for full info on generating SSH keys). From your local machine, issue this command:
[code language="shell"]$ scp ~/.ssh/id_rsa.pub yourusername@yourserver:/tmp/[/code]
Now to wrap this up quickly, go back to your server and setup the SSH key for the gitosis repo.
[code language="shell"]$ sudo -H -u git gitosis-init < /tmp/id_rsa.pub[/code]
If you get an error on initialization then you do not have git >= 1.5. For the rest of us, now we just need to edit the gitosis repo to add/delete users and git repositories! Issuing a simple git push, will propegate the change. For full information, see the gitosis README.

Tags: , , , , , , , ,
Posted in Development | Comments (0)