2013-01-09 00:14:05 -05:00
|
|
|
require 'sidekiq/web'
|
2015-12-03 18:24:39 -05:00
|
|
|
require 'sidekiq/cron/web'
|
2013-01-09 00:14:05 -05:00
|
|
|
|
2015-11-25 11:18:44 -05:00
|
|
|
Rails.application.routes.draw do
|
2016-06-01 12:07:23 -04:00
|
|
|
concern :access_requestable do
|
|
|
|
post :request_access, on: :collection
|
2016-06-01 12:17:03 -04:00
|
|
|
post :approve_access_request, on: :member
|
2016-06-01 12:07:23 -04:00
|
|
|
end
|
|
|
|
|
2016-09-19 03:26:37 -04:00
|
|
|
concern :awardable do
|
|
|
|
post :toggle_award_emoji, on: :member
|
|
|
|
end
|
|
|
|
|
2018-06-18 05:31:37 -04:00
|
|
|
favicon_redirect = redirect do |_params, _request|
|
|
|
|
ActionController::Base.helpers.asset_url(Gitlab::Favicon.main)
|
|
|
|
end
|
|
|
|
get 'favicon.png', to: favicon_redirect
|
|
|
|
get 'favicon.ico', to: favicon_redirect
|
|
|
|
|
2016-10-05 11:43:47 -04:00
|
|
|
draw :sherlock
|
|
|
|
draw :development
|
|
|
|
draw :ci
|
2015-08-25 21:42:46 -04:00
|
|
|
|
2014-12-19 09:15:29 -05:00
|
|
|
use_doorkeeper do
|
2015-02-02 22:30:09 -05:00
|
|
|
controllers applications: 'oauth/applications',
|
|
|
|
authorized_applications: 'oauth/authorized_applications',
|
|
|
|
authorizations: 'oauth/authorizations'
|
2014-12-19 09:15:29 -05:00
|
|
|
end
|
2015-03-08 17:46:22 -04:00
|
|
|
|
2018-08-16 21:05:07 -04:00
|
|
|
# This is here so we can "reserve" the path for the Jira integration in GitLab EE
|
|
|
|
# Having a non-existent controller here does not affect the scope in any way since all possible routes
|
|
|
|
# get a 404 proc returned. It is written in this way to minimize merge conflicts with EE
|
|
|
|
scope path: '/login/oauth', controller: 'oauth/jira/authorizations', as: :oauth_jira do
|
2018-09-11 16:46:02 -04:00
|
|
|
match '*all', via: [:get, :post], to: proc { [404, {}, ['']] }
|
2018-08-16 21:05:07 -04:00
|
|
|
end
|
|
|
|
|
2018-10-17 12:55:42 -04:00
|
|
|
draw :oauth
|
|
|
|
|
2016-12-09 12:36:50 -05:00
|
|
|
use_doorkeeper_openid_connect
|
|
|
|
|
2015-03-26 22:06:19 -04:00
|
|
|
# Autocomplete
|
|
|
|
get '/autocomplete/users' => 'autocomplete#users'
|
|
|
|
get '/autocomplete/users/:id' => 'autocomplete#user'
|
2016-05-16 10:24:51 -04:00
|
|
|
get '/autocomplete/projects' => 'autocomplete#projects'
|
2017-08-30 03:48:55 -04:00
|
|
|
get '/autocomplete/award_emojis' => 'autocomplete#award_emojis'
|
2019-03-09 07:22:58 -05:00
|
|
|
get '/autocomplete/merge_request_target_branches' => 'autocomplete#merge_request_target_branches'
|
2015-03-26 22:06:19 -04:00
|
|
|
|
2012-06-13 02:03:53 -04:00
|
|
|
# Search
|
2015-01-19 15:37:20 -05:00
|
|
|
get 'search' => 'search#show'
|
|
|
|
get 'search/autocomplete' => 'search#autocomplete', as: :search_autocomplete
|
2012-02-19 09:35:31 -05:00
|
|
|
|
2016-05-02 07:29:17 -04:00
|
|
|
# JSON Web Token
|
|
|
|
get 'jwt/auth' => 'jwt#auth'
|
|
|
|
|
2016-04-22 12:50:08 -04:00
|
|
|
# Health check
|
2016-05-13 03:51:13 -04:00
|
|
|
get 'health_check(/:checks)' => 'health_check#index', as: :health_check
|
2016-04-22 12:50:08 -04:00
|
|
|
|
2017-05-19 12:27:36 -04:00
|
|
|
scope path: '-' do
|
2018-07-27 15:19:51 -04:00
|
|
|
# '/-/health' implemented by BasicHealthMiddleware
|
2017-05-19 12:27:36 -04:00
|
|
|
get 'liveness' => 'health#liveness'
|
|
|
|
get 'readiness' => 'health#readiness'
|
2017-05-29 17:23:19 -04:00
|
|
|
resources :metrics, only: [:index]
|
2018-03-19 15:06:09 -04:00
|
|
|
mount Peek::Railtie => '/peek', as: 'peek_routes'
|
2017-10-13 04:28:25 -04:00
|
|
|
|
|
|
|
# Boards resources shared between group and projects
|
|
|
|
resources :boards, only: [] do
|
|
|
|
resources :lists, module: :boards, only: [:index, :create, :update, :destroy] do
|
|
|
|
collection do
|
|
|
|
post :generate
|
|
|
|
end
|
|
|
|
|
|
|
|
resources :issues, only: [:index, :create, :update]
|
|
|
|
end
|
|
|
|
|
|
|
|
resources :issues, module: :boards, only: [:index, :update]
|
|
|
|
end
|
2018-01-27 12:44:14 -05:00
|
|
|
|
2018-10-31 20:39:01 -04:00
|
|
|
# UserCallouts
|
|
|
|
resources :user_callouts, only: [:create]
|
|
|
|
|
|
|
|
get 'ide' => 'ide#index'
|
|
|
|
get 'ide/*vueroute' => 'ide#index', format: false
|
|
|
|
|
|
|
|
draw :operations
|
|
|
|
draw :instance_statistics
|
2018-11-01 08:56:32 -04:00
|
|
|
|
2018-11-01 13:20:34 -04:00
|
|
|
if ENV['GITLAB_ENABLE_CHAOS_ENDPOINTS']
|
|
|
|
get '/chaos/leakmem' => 'chaos#leakmem'
|
|
|
|
get '/chaos/cpuspin' => 'chaos#cpuspin'
|
|
|
|
get '/chaos/sleep' => 'chaos#sleep'
|
|
|
|
get '/chaos/kill' => 'chaos#kill'
|
|
|
|
end
|
2018-10-31 20:39:01 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
concern :clusterable do
|
|
|
|
resources :clusters, only: [:index, :new, :show, :update, :destroy] do
|
2018-10-18 21:42:30 -04:00
|
|
|
collection do
|
|
|
|
post :create_user
|
|
|
|
post :create_gcp
|
|
|
|
end
|
|
|
|
|
|
|
|
member do
|
|
|
|
scope :applications do
|
|
|
|
post '/:application', to: 'clusters/applications#create', as: :install_applications
|
2019-02-18 12:06:51 -05:00
|
|
|
patch '/:application', to: 'clusters/applications#update', as: :update_applications
|
2018-10-18 21:42:30 -04:00
|
|
|
end
|
|
|
|
|
2018-10-31 20:39:01 -04:00
|
|
|
get :cluster_status, format: :json
|
2018-10-18 21:42:30 -04:00
|
|
|
end
|
|
|
|
end
|
2018-10-14 23:37:51 -04:00
|
|
|
end
|
|
|
|
|
2016-10-05 11:43:47 -04:00
|
|
|
draw :api
|
|
|
|
draw :sidekiq
|
|
|
|
draw :help
|
|
|
|
draw :snippets
|
2013-03-24 18:17:20 -04:00
|
|
|
|
2015-04-10 09:22:31 -04:00
|
|
|
# Invites
|
|
|
|
resources :invites, only: [:show], constraints: { id: /[A-Za-z0-9_-]+/ } do
|
|
|
|
member do
|
|
|
|
post :accept
|
2015-04-10 10:37:02 -04:00
|
|
|
match :decline, via: [:get, :post]
|
2015-04-10 09:22:31 -04:00
|
|
|
end
|
|
|
|
end
|
2015-02-11 20:34:41 -05:00
|
|
|
|
2016-01-09 13:32:03 -05:00
|
|
|
resources :sent_notifications, only: [], constraints: { id: /\h{32}/ } do
|
2015-12-09 05:59:25 -05:00
|
|
|
member do
|
|
|
|
get :unsubscribe
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-08-06 08:03:27 -04:00
|
|
|
# Spam reports
|
|
|
|
resources :abuse_reports, only: [:new, :create]
|
|
|
|
|
2016-06-14 14:36:36 -04:00
|
|
|
# Notification settings
|
|
|
|
resources :notification_settings, only: [:create, :update]
|
|
|
|
|
2017-09-25 03:10:25 -04:00
|
|
|
draw :google_api
|
2016-10-05 08:21:27 -04:00
|
|
|
draw :import
|
|
|
|
draw :uploads
|
|
|
|
draw :explore
|
|
|
|
draw :admin
|
|
|
|
draw :profile
|
|
|
|
draw :dashboard
|
|
|
|
draw :group
|
|
|
|
draw :user
|
|
|
|
draw :project
|
2011-10-08 17:36:38 -04:00
|
|
|
|
2015-09-08 09:49:20 -04:00
|
|
|
root to: "root#index"
|
2016-10-14 17:11:19 -04:00
|
|
|
|
2016-11-14 09:55:31 -05:00
|
|
|
get '*unmatched_route', to: 'application#route_not_found'
|
2011-10-08 17:36:38 -04:00
|
|
|
end
|