Skip to content

Instantly share code, notes, and snippets.

@bflad
Created April 30, 2010 01:32
Show Gist options
  • Save bflad/384577 to your computer and use it in GitHub Desktop.
Save bflad/384577 to your computer and use it in GitHub Desktop.

Gitosis Deployment

  • On the server:
  • Install EPEL (likely to be added to RHN shortly which would be just: yum install epel-release)
  • rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
  • yum install gitosis
  • useradd git
  • passwd git
  • On your client:
  • ssh-keygen ...if necessary
  • scp ~/.ssh/id_rsa.pub git@SERVER:/home/git
  • On the server:
  • su - git
  • gitosis-init < id_rsa.pub
  • rm id_rsa.pub
  • chmod 755 /home/git
  • chmod 700 /home/git/.ssh
  • chmod 644 /home/git/.ssh/authorized_keys

You're all done on the server! Now follow the instructions in the Gitosis Administration section on the client that you just initialized it's pubkey

Gitosis Administration

This is the standard command line way of doing it... seems it would be real easy to wrap a web application around this... stay tuned for the Mitosis project :)

Your key must already be in the members section of gitosis-admin!

  • if you don't have the repo already...
  • git clone git@SERVER:gitosis-admin.git
  • cd gitosis-admin
  • make sure you have the latest version of the admin repo
  • git pull
  • MODIFY FILES ACCORDINGLY!
  • git commit -am "useful commit message about what you just did"
  • git push
  • server has been updated!

Mitosis

Objects/Concepts: Users, Keys, Groups, Repositories, Read/Write/Admin Permissions

Web Workflow

(these steps are performed by the web app itself)

  1. git pull
  2. Clear database?
  3. Read current gitosis.conf and keydir files, fill database
  4. USER MAKES CHANGES + SAVES
  5. Clear keydir?
  6. Read database, write gitosis.conf and keydir files
  7. git add .
  8. git commit -am "Mitosis: $user: CHANGE DESCRIPTION"
  9. git push

Database to gitosis-admin repo

For each key:

  • write keydir/user-key_description.pub

For each user: [group user] members= key ...

For each group: [group group_name] members= (@user|@group) ...

For each repository: [group repository-writable] writable= repository members= (@user|@group) ...

[group repository-readonly]
readonly= repository
members= (@user|@group) ...

[repo repository]
description= repository_description
owner= repository_owner
gitweb= repository_gitweb
daemon= repository_public

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment