summaryrefslogtreecommitdiff
path: root/config/routes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'config/routes.rb')
-rw-r--r--config/routes.rb132
1 files changed, 81 insertions, 51 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 4a07c449b4e..3b151891a6b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,7 +1,21 @@
require 'sidekiq/web'
+require 'sidekiq/cron/web'
require 'api/api'
-Gitlab::Application.routes.draw do
+Rails.application.routes.draw do
+ if Gitlab::Sherlock.enabled?
+ namespace :sherlock do
+ resources :transactions, only: [:index, :show] do
+ resources :queries, only: [:show]
+ resources :file_samples, only: [:show]
+
+ collection do
+ delete :destroy_all
+ end
+ end
+ end
+ end
+
namespace :ci do
# CI API
Ci::API::API.logger Rails.logger
@@ -19,53 +33,9 @@ Gitlab::Application.routes.draw do
get :status, to: 'projects#badge'
get :integration
post :toggle_shared_runners
- get :dumped_yaml
- end
-
- resources :services, only: [:index, :edit, :update] do
- member do
- get :test
- end
- end
-
- resource :charts, only: [:show]
-
- resources :refs, constraints: { ref_id: /.*/ }, only: [] do
- resources :commits, only: [:show] do
- member do
- get :status
- get :cancel
- end
- end
- end
-
- resources :builds, only: [:show] do
- member do
- get :cancel
- get :status
- post :retry
- end
- end
-
- resources :web_hooks, only: [:index, :create, :destroy] do
- member do
- get :test
- end
- end
-
- resources :triggers, only: [:index, :create, :destroy]
-
- resources :runners, only: [:index, :edit, :update, :destroy, :show] do
- member do
- get :resume
- get :pause
- end
end
resources :runner_projects, only: [:create, :destroy]
-
- resources :events, only: [:index]
- resource :variables, only: [:show, :update]
end
resource :user_sessions do
@@ -124,7 +94,7 @@ Gitlab::Application.routes.draw do
end
# Enable Grack support
- mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post]
+ mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post, :put]
# Help
get 'help' => 'help#index'
@@ -253,6 +223,8 @@ Gitlab::Application.routes.draw do
resources :keys, only: [:show, :destroy]
resources :identities, only: [:index, :edit, :update, :destroy]
+ delete 'stop_impersonation' => 'impersonation#destroy', on: :collection
+
member do
get :projects
get :keys
@@ -262,6 +234,7 @@ Gitlab::Application.routes.draw do
put :unblock
put :unlock
put :confirm
+ post 'impersonate' => 'impersonation#create'
patch :disable_two_factor
delete 'remove/:email_id', action: 'remove_email', as: 'remove_email'
end
@@ -396,7 +369,7 @@ Gitlab::Application.routes.draw do
end
resource :avatar, only: [:destroy]
- resources :milestones, only: [:index, :show, :update]
+ resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :update, :new, :create]
end
end
@@ -418,6 +391,7 @@ Gitlab::Application.routes.draw do
[:new, :create, :index], path: "/") do
member do
put :transfer
+ delete :remove_fork
post :archive
post :unarchive
post :toggle_star
@@ -483,6 +457,15 @@ Gitlab::Application.routes.draw do
end
scope do
+ post(
+ '/create_dir/*id',
+ to: 'tree#create_dir',
+ constraints: { id: /.+/ },
+ as: 'create_dir'
+ )
+ end
+
+ scope do
get(
'/blame/*id',
to: 'blame#show',
@@ -502,7 +485,12 @@ Gitlab::Application.routes.draw do
resource :avatar, only: [:show, :destroy]
resources :commit, only: [:show], constraints: { id: /[[:alnum:]]{6,40}/ } do
- get :branches, on: :member
+ member do
+ get :branches
+ get :builds
+ post :cancel_builds
+ post :retry_builds
+ end
end
resources :compare, only: [:index, :create]
@@ -570,8 +558,10 @@ Gitlab::Application.routes.draw do
member do
# tree viewer logs
get 'logs_tree', constraints: { id: Gitlab::Regex.git_reference_regex }
+ # Directories with leading dots erroneously get rejected if git
+ # ref regex used in constraints. Regex verification now done in controller.
get 'logs_tree/*path' => 'refs#logs_tree', as: :logs_file, constraints: {
- id: Gitlab::Regex.git_reference_regex,
+ id: /.*/,
path: /.*/
}
end
@@ -595,8 +585,38 @@ Gitlab::Application.routes.draw do
end
resources :branches, only: [:index, :new, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex }
- resources :tags, only: [:index, :new, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex }
+ resources :tags, only: [:index, :show, :new, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex } do
+ resource :release, only: [:edit, :update]
+ end
+
resources :protected_branches, only: [:index, :create, :update, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex }
+ resource :variables, only: [:show, :update]
+ resources :triggers, only: [:index, :create, :destroy]
+ resource :ci_settings, only: [:edit, :update, :destroy]
+ resources :ci_web_hooks, only: [:index, :create, :destroy] do
+ member do
+ get :test
+ end
+ end
+
+ resources :ci_services, constraints: { id: /[^\/]+/ }, only: [:index, :edit, :update] do
+ member do
+ get :test
+ end
+ end
+
+ resources :builds, only: [:index, :show] do
+ collection do
+ post :cancel_all
+ end
+
+ member do
+ get :status
+ post :cancel
+ get :download
+ post :retry
+ end
+ end
resources :hooks, only: [:index, :create, :destroy], constraints: { id: /\d+/ } do
member do
@@ -645,6 +665,10 @@ Gitlab::Application.routes.draw do
member do
delete :delete_attachment
end
+
+ collection do
+ post :award_toggle
+ end
end
resources :uploads, only: [:create] do
@@ -652,8 +676,14 @@ Gitlab::Application.routes.draw do
get ":secret/:filename", action: :show, as: :show, constraints: { filename: /[^\/]+/ }
end
end
- end
+ resources :runners, only: [:index, :edit, :update, :destroy, :show] do
+ member do
+ get :resume
+ get :pause
+ end
+ end
+ end
end
end