From 7888e3ae2985c4abdaeaa7b9dd6617649a19fa3d Mon Sep 17 00:00:00 2001 From: Saito Date: Fri, 29 Jun 2012 21:39:40 +0800 Subject: [PATCH 1/2] now works with git clone http://localhost/repo.git now --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index b1bd5a7b2d6..beedb6a87b2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -14,7 +14,7 @@ Gitlab::Application.routes.draw do project_root: GIT_HOST['base_path'], upload_pack: GIT_HOST['upload_pack'], receive_pack: GIT_HOST['receive_pack'] - }), at: '/git' + }), at: '/:path', constraints: { path: /[\w-]+.git*/ } # # Help From aefe4dc3a2668ec12782f7ac1a245effb60b9339 Mon Sep 17 00:00:00 2001 From: Saito Date: Fri, 29 Jun 2012 21:40:23 +0800 Subject: [PATCH 2/2] fix a npe, and need a patch for path_info --- config/initializers/grack_auth.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/initializers/grack_auth.rb b/config/initializers/grack_auth.rb index bb34ce6dc54..b44a01f4a0c 100644 --- a/config/initializers/grack_auth.rb +++ b/config/initializers/grack_auth.rb @@ -5,7 +5,10 @@ module Grack # Authentication with username and password email, password = @auth.credentials user = User.find_by_email(email) - return false unless user.valid_password?(password) + return false unless user.try(:valid_password?, password) + + # Need this patch because the rails mount + @env['PATH_INFO'] = @env['REQUEST_PATH'] # Find project by PATH_INFO from env if m = /^\/([\w-]+).git/.match(@env['PATH_INFO']).to_a