summaryrefslogtreecommitdiff
path: root/config/routes.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-08-16 15:51:41 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-08-16 15:51:41 +0200
commita2bf638e4044a20daa62bb6ddfa07c4e409a3d39 (patch)
tree7399abbf5e9d3d555857af8109b9d85da84a953c /config/routes.rb
parentdb3c5a042d2cd03fb64d7f85b130d065dce3eb42 (diff)
parent5a4ecb9825f34011e9e021af70a3ff0a696ec3f7 (diff)
downloadgitlab-ce-a2bf638e4044a20daa62bb6ddfa07c4e409a3d39.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into 18681-pipelines-merge-request
Diffstat (limited to 'config/routes.rb')
-rw-r--r--config/routes.rb77
1 files changed, 50 insertions, 27 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 84a89200111..634ca35b5b4 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -42,10 +42,9 @@ Rails.application.routes.draw do
resource :lint, only: [:show, :create]
- resources :projects do
+ resources :projects, only: [:index, :show] do
member do
get :status, to: 'projects#badge'
- get :integration
end
end
@@ -85,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'
@@ -144,13 +140,13 @@ Rails.application.routes.draw do
get :jobs
end
- resource :gitlab, only: [:create, :new], controller: :gitlab do
+ resource :gitlab, only: [:create], controller: :gitlab do
get :status
get :callback
get :jobs
end
- resource :bitbucket, only: [:create, :new], controller: :bitbucket do
+ resource :bitbucket, only: [:create], controller: :bitbucket do
get :status
get :callback
get :jobs
@@ -243,7 +239,6 @@ Rails.application.routes.draw do
get :projects
get :keys
get :groups
- put :team_update
put :block
put :unblock
put :unlock
@@ -257,7 +252,11 @@ Rails.application.routes.draw do
resource :impersonation, only: :destroy
resources :abuse_reports, only: [:index, :destroy]
- resources :spam_logs, only: [:index, :destroy]
+ resources :spam_logs, only: [:index, :destroy] do
+ member do
+ post :mark_as_ham
+ end
+ end
resources :applications
@@ -281,6 +280,7 @@ Rails.application.routes.draw do
resource :health_check, controller: 'health_check', only: [:show]
resource :background_jobs, controller: 'background_jobs', only: [:show]
resource :system_info, controller: 'system_info', only: [:show]
+ resources :requests_profiles, only: [:index, :show], param: :name, constraints: { name: /.+\.html/ }
resources :namespaces, path: '/projects', constraints: { id: /[a-zA-Z.0-9_\-]+/ }, only: [] do
root to: 'projects#index', as: :projects
@@ -300,7 +300,7 @@ Rails.application.routes.draw do
end
end
- resource :appearances, path: 'appearance' do
+ resource :appearances, only: [:show, :create, :update], path: 'appearance' do
member do
get :preview
delete :logo
@@ -309,7 +309,7 @@ Rails.application.routes.draw do
end
resource :application_settings, only: [:show, :update] do
- resources :services
+ resources :services, only: [:index, :edit, :update]
put :reset_runners_token
put :reset_health_check_token
put :clear_repository_check_states
@@ -346,7 +346,7 @@ Rails.application.routes.draw do
end
scope module: :profiles do
- resource :account, only: [:show, :update] do
+ resource :account, only: [:show] do
member do
delete :unlink
end
@@ -358,7 +358,7 @@ Rails.application.routes.draw do
end
end
resource :preferences, only: [:show, :update]
- resources :keys
+ resources :keys, only: [:index, :show, :new, :create, :destroy]
resources :emails, only: [:index, :create, :destroy]
resource :avatar, only: [:destroy]
@@ -472,7 +472,7 @@ Rails.application.routes.draw do
post :unarchive
post :housekeeping
post :toggle_star
- post :markdown_preview
+ post :preview_markdown
post :export
post :remove_export
post :generate_new_export
@@ -483,11 +483,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
@@ -627,13 +642,17 @@ Rails.application.routes.draw do
get '/compare/:from...:to', to: 'compare#show', as: 'compare', constraints: { from: /.+/, to: /.+/ }
- resources :network, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ }
+ # Don't use format parameter as file extension (old 3.0.x behavior)
+ # See http://guides.rubyonrails.org/routing.html#route-globbing-and-wildcard-segments
+ scope format: false do
+ resources :network, only: [:show], constraints: { id: Gitlab::Regex.git_reference_regex }
- resources :graphs, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ } do
- member do
- get :commits
- get :ci
- get :languages
+ resources :graphs, only: [:show], constraints: { id: Gitlab::Regex.git_reference_regex } do
+ member do
+ get :commits
+ get :ci
+ get :languages
+ end
end
end
@@ -657,10 +676,10 @@ Rails.application.routes.draw do
get '/wikis/*id', to: 'wikis#show', as: 'wiki', constraints: WIKI_SLUG_ID
delete '/wikis/*id', to: 'wikis#destroy', constraints: WIKI_SLUG_ID
put '/wikis/*id', to: 'wikis#update', constraints: WIKI_SLUG_ID
- post '/wikis/*id/markdown_preview', to: 'wikis#markdown_preview', constraints: WIKI_SLUG_ID, as: 'wiki_markdown_preview'
+ post '/wikis/*id/preview_markdown', to: 'wikis#preview_markdown', constraints: WIKI_SLUG_ID, as: 'wiki_preview_markdown'
end
- resource :repository, only: [:show, :create] do
+ resource :repository, only: [:create] do
member do
get 'archive', constraints: { format: Gitlab::Regex.archive_formats_regex }
end
@@ -743,7 +762,7 @@ Rails.application.routes.draw do
end
end
- resources :environments, only: [:index, :show, :new, :create, :destroy]
+ resources :environments
resources :builds, only: [:index, :show], constraints: { id: /\d+/ } do
collection do
@@ -783,7 +802,7 @@ Rails.application.routes.draw do
end
end
- resources :labels, constraints: { id: /\d+/ } do
+ resources :labels, except: [:show], constraints: { id: /\d+/ } do
collection do
post :generate
post :set_priorities
@@ -799,6 +818,7 @@ Rails.application.routes.draw do
member do
post :toggle_subscription
post :toggle_award_emoji
+ post :mark_as_spam
get :referenced_merge_requests
get :related_branches
get :can_create_branch
@@ -808,7 +828,7 @@ Rails.application.routes.draw do
end
end
- resources :project_members, except: [:new, :edit], constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ }, concerns: :access_requestable do
+ resources :project_members, except: [:show, :new, :edit], constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ }, concerns: :access_requestable do
collection do
delete :leave
@@ -855,7 +875,10 @@ Rails.application.routes.draw do
resources :badges, only: [:index] do
collection do
scope '*ref', constraints: { ref: Gitlab::Regex.git_reference_regex } do
- get :build, constraints: { format: /svg/ }
+ constraints format: /svg/ do
+ get :build
+ get :coverage
+ end
end
end
end