Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin do not load all the sinatra stuff in the shell February 01, 2010
Octocat-spinner-32 lib FIXME: Do some logging. Make this nicer and configurable February 01, 2010
Octocat-spinner-32 routes completely migrated January 29, 2010
Octocat-spinner-32 spec fix key spec January 30, 2010
Octocat-spinner-32 vendor rr ohm August 30, 2011
Octocat-spinner-32 views typo February 01, 2010
Octocat-spinner-32 .gitignore update gitignore January 29, 2010
Octocat-spinner-32 .gitmodules rr ohm August 30, 2011
Octocat-spinner-32 FEEDBACK April 01, 2010
Octocat-spinner-32 Gemfile add Gemfile for remaining deps August 30, 2011
Octocat-spinner-32 README.rdoc readme update January 31, 2010
Octocat-spinner-32 Rakefile rake sloccount January 29, 2010
Octocat-spinner-32 config.rb.example fix config example January 30, 2010
Octocat-spinner-32 config.ru now we run on rubinius, yay January 28, 2010
Octocat-spinner-32 init.rb fix twitter + twitter layout January 30, 2010
Octocat-spinner-32 krb5.conf.example added krb5 config example, copy to /etc/krb5.conf January 29, 2010
Octocat-spinner-32 redis.conf seperate configs January 29, 2010
Octocat-spinner-32 redis_test.conf test config January 29, 2010
Octocat-spinner-32 users.yaml dashboard content January 30, 2010
README.rdoc

Bithug

Bithug is a small, experimental Github clone.

Features

  • Git access management

  • Private and public repositories

  • Forking

  • Following/Feed generation

  • SVN import/tracking

  • Kerberos/LDAP support

  • Twitter integration

  • Gravatar support

  • Lightweight (uses Sinatra and Redis)

Road Map/Planned Features

  • Commit Views / File Views (currently only supports directory views)

  • Better error handling (currently not many error messages for the user)

  • Bug fixes (currently issues browsing old commits/other branches)

  • Experimental switch of persistence layer (possibly to Maglev)

  • AMQ / background jobs for forking/repo creation and such

How do I install Bithug?

Pre-requirements

General pre-requirement                      | What we used for development/deployment
---------------------------------------------|---------------------------------------------
Unix with a SSH server (we)                  | Fedora Linux 12 and Mac OSX 10.6
                                             | with OpenSSH. Any Linux/BSD should work.
                                             |
A decent ruby implementation (>= 1.8.7)      | Rubinius 1.0.0-rc2 and JRuby 1.4.0, installed
                                             | with RVM. We experienced frequent segmentation
                                             | faults with the official Ruby implementation.
                                             |
A web server                                 | Mongrel. All Rubies ship with Webrick, but it
                                             | has poor performance. For deployment, consider
                                             | Passenger/Apache.
                                             |
Redis                                        | Installed from official tar ball on Linux.
                                             | Via MacPorts on OSX.
                                             |
Kerberos Support (optional)                  | You'll need either to install our patched
                                             | krb5-auth* or install ruby ffi.
                                             | krb5-auth is the preferred option, but works
                                             | only on MRI/REE and Rubinius.
                                             | Rubinius, JRuby, MacRuby and Meglav already ship
                                             | with ffi. To use the ffi krb5 implementation,
                                             | you will have to run 'make' in vendor/simple-krb5/ext
                                             | once. You will need the krb5 development headers.
                                             |
                                             |
Git                                          | sudo (port|apt-get|yum|brew) install git-core
                                             |

* gem install timfel-krb5-auth

All other requirements are shipped with Bithug inside the vendor directory.

Getting the source

git clone git://github.com/rkh/bithug.git
cd bithug
git submodule init
git submodule update

Configuring Bithug

In the projects root directory, create a config.rb. Inside that file you may configure your Bithug system.

The simplest configuration should look something like this:

Bithug.configure do
  use :Redis, :host => "127.0.0.1", :port => 6379 # Your redis server
  use :Git
  use :Local
end

Note that “Local” was mainly used for development (read: there is no admin interface to manage the users, users cannot change their passwords) and it is highly recommended to use either Kerberos or LDAP or both.

If you are inside HPI, it is even easier:

Bithug.configure do
  use :Redis, :host => "127.0.0.1", :port => 6379
  use :Hpi
end

A full blown configuration could look like this:

Bithug.configure do

  # Redis connection
  use :Redis, :host => "127.0.0.1", :port => 6379

  # Git repo support
  use :Git

  # Subversion repo support
  use :Svn

  # Twitter integration
  use :Twitter, :consumer_key => "...", :consumer_secret => "..."

  # LDAP authentication
  use :Ldap, :host => "ldap.com", :port => 10

  # Hostname for git url
  hostname "example.com"

  # System user (for urls)
  git_user "git"

  # Sets title to hostname ("example.com")
  title hostname

end

Note that names like :Twitter or :Git refer to Modules which represent Bithug extensions. You can easily provide you own, documentation might follow (for now, have a look at the source, lib/bithug/hpi.rb might be a good starting point).

Running a ruby shell

Make sure redis is running.

In the root directory, run

irb -rinit

Starting the server

Ideally, when you install bithug on a server, you would create an unpriviliged git user on that machine. That user should have a private ruby stack with the dependencies, git and bin/bithug-serve need to be in his PATH.

Also, make sure redis is running.

As that user, try something along the lines of

ruby init.rb

or

thin start -D -R config.ru

or

rackup

Starting on another port:

ruby init.rb -p 80

All users will need to authenticate against their supplied public-keys, the bithug shell invoked by bithug-serve will take care of checking access rights and logging repository activity.

Something went wrong with that request. Please try again.