Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Home

skrillsa edited this page · 10 revisions
Clone this wiki locally

WHY U FORK THIS REPO

schacon/grack is a wonderful server to implement Git‘s smart http protocol.

But, i really need a convenient way to integrate this function.

So, I made a gem.

HOW TO USE THIS GEM

Create a config file called config/grack.yml this is a example file:

:project_root: /home/git/repositories/
:git_path: /usr/bin/git
:upload_pack: => true
:receive_pack: => true

Create a config.ru file:

  • If u just want to serve a git server without authentication:
require 'yaml'
require 'grack/server'

config = YAML.load_file("config/grack.yml")

run Grack::Server.new(config)
  • With Authentication:
require'grack'

module Grack
  class Auth < Rack::Auth::Basic

    # implement ur valid? method.
    def valid?
      false
    end
  end
end

config = YAML.load_file("config/grack.yml")
run Grack::Bundle.new(config)

INTEGRATE WITH RAILS

Gemfile:

gem 'grack', :git => git://github.com/SaitoWu/grack.git

routes.rb:

mount Grack::Bundle.new(YAML.load_file("config/grack.yml")), :at => '/git'

DONE

U have ur own http git server now!

Start ur rack server:

rackup -p 3000

Just try:

git clone http://localhost:3000/grack.git

Have Fun!

Something went wrong with that request. Please try again.