diff options
author | Rémy Coutable <remy@rymai.me> | 2016-08-11 17:36:40 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-08-11 17:36:40 +0300 |
commit | 4c29c25497c9a20a5d1f57cd287123cd41edad96 (patch) | |
tree | a9eda345190f046c80456e4979973f3489ddfa21 /config/routes.rb | |
parent | 7e9b41896d8c2ffae36152401f35479b39297e78 (diff) | |
parent | 6e6ad3e2fc386044134cbb33395cceb97e913fa0 (diff) |
Merge branch 'remove-grack-lfs' into 'master'
Remove Grack::Auth: part 2 (LFS)
Deprecate Grack::Auth and handle LFS in Rails controllers under the Project namespace.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/14501
See merge request !5369
Diffstat (limited to 'config/routes.rb')
-rw-r--r-- | config/routes.rb | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/config/routes.rb b/config/routes.rb index 2f5f32d9e30..99a2cd884fe 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -84,9 +84,6 @@ Rails.application.routes.draw do # Health check get 'health_check(/:checks)' => 'health_check#index', as: :health_check - # Enable Grack support (for LFS only) - mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\/(info\/lfs|gitlab-lfs)/.match(request.path_info) }, via: [:get, :post, :put] - # Help get 'help' => 'help#index' get 'help/shortcuts' => 'help#shortcuts' @@ -482,11 +479,26 @@ Rails.application.routes.draw do end scope module: :projects do - # Git HTTP clients ('git clone' etc.) scope constraints: { id: /.+\.git/, format: nil } do + # Git HTTP clients ('git clone' etc.) get '/info/refs', to: 'git_http#info_refs' post '/git-upload-pack', to: 'git_http#git_upload_pack' post '/git-receive-pack', to: 'git_http#git_receive_pack' + + # Git LFS API (metadata) + post '/info/lfs/objects/batch', to: 'lfs_api#batch' + post '/info/lfs/objects', to: 'lfs_api#deprecated' + get '/info/lfs/objects/*oid', to: 'lfs_api#deprecated' + + # GitLab LFS object storage + scope constraints: { oid: /[a-f0-9]{64}/ } do + get '/gitlab-lfs/objects/*oid', to: 'lfs_storage#download' + + scope constraints: { size: /[0-9]+/ } do + put '/gitlab-lfs/objects/*oid/*size/authorize', to: 'lfs_storage#upload_authorize' + put '/gitlab-lfs/objects/*oid/*size', to: 'lfs_storage#upload_finalize' + end + end end # Allow /info/refs, /info/refs?service=git-upload-pack, and |