forked from schacon/grack
-
Notifications
You must be signed in to change notification settings - Fork 5
Home
SaitoWu edited this page Jun 28, 2012
·
8 revisions
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.
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)
Gemfile:
gem 'grack', :git => git://github.com/SaitoWu/grack.git
routes.rb:
mount Grack::Bundle.new(YAML.load_file("config/grack.yml")), :at => '/git'
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!