Skip to content
SaitoWu edited this page Jun 25, 2012 · 8 revisions

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(grack will load config/grack.yml file automatically:
require'grack'

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

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

run Grack::Bundle.instance

INTEGRATE WITH RAILS

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

routes.rb:

mount Grack::Bundle.instance, at: '/git'

Have Fun!

Clone this wiki locally