summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorSaito <saitowu@gmail.com>2012-06-29 11:30:31 +0800
committerSaito <saitowu@gmail.com>2012-06-29 11:30:31 +0800
commit86807b8ecc1b6e6e55e297d52bd2c04375d1e3f1 (patch)
treef8a3e86acf7e1424aef3ad144888896d60253f78 /config
parent61b85aed59481d0ebbb6aacc74b05f8d1b289703 (diff)
downloadgitlab-ce-86807b8ecc1b6e6e55e297d52bd2c04375d1e3f1.tar.gz
mount grack to git, u can 'git clone http://localhost/git/xx.git' now
Diffstat (limited to 'config')
-rw-r--r--config/gitlab.yml.example4
-rw-r--r--config/initializers/grack_auth.rb8
-rw-r--r--config/routes.rb52
3 files changed, 42 insertions, 22 deletions
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index f29bafa1f21..b74082c360d 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -17,11 +17,15 @@ git_host:
base_path: /home/git/repositories/
host: localhost
git_user: git
+ upload_pack: true
+ receive_pack: true
# port: 22
+
# Git settings
# Use default values unless you understand it
git:
+ path: /usr/bin/git
# Max size of git object like commit, in bytes
# This value can be increased if you have a very large commits
git_max_size: 5242880 # 5.megabytes
diff --git a/config/initializers/grack_auth.rb b/config/initializers/grack_auth.rb
new file mode 100644
index 00000000000..17d3641a366
--- /dev/null
+++ b/config/initializers/grack_auth.rb
@@ -0,0 +1,8 @@
+module Grack
+ class Auth < Rack::Auth::Basic
+
+ def valid?
+ true
+ end
+ end
+end
diff --git a/config/routes.rb b/config/routes.rb
index 67e4aedd030..b1bd5a7b2d6 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -8,6 +8,14 @@ Gitlab::Application.routes.draw do
require 'resque/server'
mount Resque::Server.new, at: '/info/resque'
+ # Enable Grack support
+ mount Grack::Bundle.new({
+ git_path: GIT_OPTS['path'],
+ project_root: GIT_HOST['base_path'],
+ upload_pack: GIT_HOST['upload_pack'],
+ receive_pack: GIT_HOST['receive_pack']
+ }), at: '/git'
+
#
# Help
#
@@ -20,15 +28,15 @@ Gitlab::Application.routes.draw do
# Admin Area
#
namespace :admin do
- resources :users do
- member do
+ resources :users do
+ member do
put :team_update
put :block
put :unblock
end
end
- resources :projects, :constraints => { :id => /[^\/]+/ } do
- member do
+ resources :projects, :constraints => { :id => /[^\/]+/ } do
+ member do
get :team
put :team_update
end
@@ -79,12 +87,12 @@ Gitlab::Application.routes.draw do
resources :wikis, :only => [:show, :edit, :destroy, :create] do
member do
- get "history"
+ get "history"
end
end
- resource :repository do
- member do
+ resource :repository do
+ member do
get "branches"
get "tags"
get "archive"
@@ -94,14 +102,14 @@ Gitlab::Application.routes.draw do
resources :deploy_keys
resources :protected_branches, :only => [:index, :create, :destroy]
- resources :refs, :only => [], :path => "/" do
- collection do
+ resources :refs, :only => [], :path => "/" do
+ collection do
get "switch"
end
- member do
+ member do
get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ }
- get "blob",
+ get "blob",
:constraints => {
:id => /[a-zA-Z.0-9\/_\-]+/,
:path => /.*/
@@ -126,36 +134,36 @@ Gitlab::Application.routes.draw do
end
end
- resources :merge_requests do
- member do
+ resources :merge_requests do
+ member do
get :diffs
get :automerge
get :automerge_check
end
- collection do
+ collection do
get :branch_from
get :branch_to
end
end
-
- resources :snippets do
- member do
+
+ resources :snippets do
+ member do
get "raw"
end
end
- resources :hooks, :only => [:index, :create, :destroy] do
- member do
+ resources :hooks, :only => [:index, :create, :destroy] do
+ member do
get :test
end
end
- resources :commits do
- collection do
+ resources :commits do
+ collection do
get :compare
end
- member do
+ member do
get :patch
end
end