2013-01-09 05:14:05 +00:00
|
|
|
require 'sidekiq/web'
|
2015-12-03 23:24:39 +00:00
|
|
|
require 'sidekiq/cron/web'
|
2013-01-09 05:14:05 +00:00
|
|
|
|
2015-11-25 16:18:44 +00:00
|
|
|
Rails.application.routes.draw do
|
2016-06-01 16:07:23 +00:00
|
|
|
concern :access_requestable do
|
|
|
|
post :request_access, on: :collection
|
2016-06-01 16:17:03 +00:00
|
|
|
post :approve_access_request, on: :member
|
2016-06-01 16:07:23 +00:00
|
|
|
end
|
|
|
|
|
2016-09-19 07:26:37 +00:00
|
|
|
concern :awardable do
|
|
|
|
post :toggle_award_emoji, on: :member
|
|
|
|
end
|
|
|
|
|
2018-06-18 09:31:37 +00: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 15:43:47 +00:00
|
|
|
draw :sherlock
|
|
|
|
draw :development
|
|
|
|
draw :ci
|
2015-08-26 01:42:46 +00:00
|
|
|
|
2014-12-19 14:15:29 +00:00
|
|
|
use_doorkeeper do
|
2015-02-03 03:30:09 +00:00
|
|
|
controllers applications: 'oauth/applications',
|
|
|
|
authorized_applications: 'oauth/authorized_applications',
|
2020-02-18 03:08:54 +00:00
|
|
|
authorizations: 'oauth/authorizations',
|
|
|
|
token_info: 'oauth/token_info'
|
2014-12-19 14:15:29 +00:00
|
|
|
end
|
2015-03-08 21:46:22 +00:00
|
|
|
|
2019-06-24 16:53:17 +00:00
|
|
|
# This prefixless path is required because Jira gets confused if we set it up with a path
|
2019-09-18 14:02:45 +00:00
|
|
|
# More information: https://gitlab.com/gitlab-org/gitlab/issues/6752
|
2018-08-17 01:05:07 +00:00
|
|
|
scope path: '/login/oauth', controller: 'oauth/jira/authorizations', as: :oauth_jira do
|
2019-06-25 18:53:57 +00:00
|
|
|
Gitlab.ee do
|
|
|
|
get :authorize, action: :new
|
|
|
|
get :callback
|
|
|
|
post :access_token
|
|
|
|
end
|
|
|
|
|
2019-06-24 16:53:17 +00:00
|
|
|
# This helps minimize merge conflicts with CE for this scope block
|
2018-09-11 20:46:02 +00:00
|
|
|
match '*all', via: [:get, :post], to: proc { [404, {}, ['']] }
|
2018-08-17 01:05:07 +00:00
|
|
|
end
|
|
|
|
|
2018-10-17 16:55:42 +00:00
|
|
|
draw :oauth
|
|
|
|
|
2016-12-09 17:36:50 +00:00
|
|
|
use_doorkeeper_openid_connect
|
|
|
|
|
2015-03-27 02:06:19 +00:00
|
|
|
# Autocomplete
|
|
|
|
get '/autocomplete/users' => 'autocomplete#users'
|
|
|
|
get '/autocomplete/users/:id' => 'autocomplete#user'
|
2016-05-16 14:24:51 +00:00
|
|
|
get '/autocomplete/projects' => 'autocomplete#projects'
|
2017-08-30 07:48:55 +00:00
|
|
|
get '/autocomplete/award_emojis' => 'autocomplete#award_emojis'
|
2019-03-09 12:22:58 +00:00
|
|
|
get '/autocomplete/merge_request_target_branches' => 'autocomplete#merge_request_target_branches'
|
2015-03-27 02:06:19 +00:00
|
|
|
|
2019-06-25 18:53:57 +00:00
|
|
|
Gitlab.ee do
|
|
|
|
get '/autocomplete/project_groups' => 'autocomplete#project_groups'
|
|
|
|
end
|
|
|
|
|
2019-10-18 21:06:37 +00:00
|
|
|
# Sign up
|
|
|
|
get 'users/sign_up/welcome' => 'registrations#welcome'
|
2019-11-08 15:06:21 +00:00
|
|
|
patch 'users/sign_up/update_registration' => 'registrations#update_registration'
|
2019-10-18 21:06:37 +00:00
|
|
|
|
2012-06-13 06:03:53 +00:00
|
|
|
# Search
|
2015-01-19 20:37:20 +00:00
|
|
|
get 'search' => 'search#show'
|
|
|
|
get 'search/autocomplete' => 'search#autocomplete', as: :search_autocomplete
|
2019-07-15 17:59:57 +00:00
|
|
|
get 'search/count' => 'search#count', as: :search_count
|
2012-02-19 14:35:31 +00:00
|
|
|
|
2016-05-02 11:29:17 +00:00
|
|
|
# JSON Web Token
|
|
|
|
get 'jwt/auth' => 'jwt#auth'
|
|
|
|
|
2016-04-22 16:50:08 +00:00
|
|
|
# Health check
|
2016-05-13 07:51:13 +00:00
|
|
|
get 'health_check(/:checks)' => 'health_check#index', as: :health_check
|
2016-04-22 16:50:08 +00:00
|
|
|
|
2017-05-19 16:27:36 +00:00
|
|
|
scope path: '-' do
|
2019-09-03 16:15:47 +00:00
|
|
|
# '/-/health' implemented by BasicHealthCheck middleware
|
2017-05-19 16:27:36 +00:00
|
|
|
get 'liveness' => 'health#liveness'
|
|
|
|
get 'readiness' => 'health#readiness'
|
2017-05-29 21:23:19 +00:00
|
|
|
resources :metrics, only: [:index]
|
2018-03-19 19:06:09 +00:00
|
|
|
mount Peek::Railtie => '/peek', as: 'peek_routes'
|
2017-10-13 08:28:25 +00: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
|
|
|
|
|
2019-07-11 13:29:16 +00:00
|
|
|
resources :issues, module: :boards, only: [:index, :update] do
|
|
|
|
collection do
|
|
|
|
put :bulk_move, format: :json
|
|
|
|
end
|
|
|
|
end
|
2019-06-24 16:53:17 +00:00
|
|
|
|
2019-06-25 18:53:57 +00:00
|
|
|
Gitlab.ee do
|
|
|
|
resources :users, module: :boards, only: [:index]
|
|
|
|
resources :milestones, module: :boards, only: [:index]
|
|
|
|
end
|
2017-10-13 08:28:25 +00:00
|
|
|
end
|
2018-01-27 17:44:14 +00:00
|
|
|
|
2019-06-06 18:55:31 +00:00
|
|
|
get 'acme-challenge/' => 'acme_challenges#show'
|
|
|
|
|
2018-11-01 00:39:01 +00:00
|
|
|
# UserCallouts
|
|
|
|
resources :user_callouts, only: [:create]
|
|
|
|
|
|
|
|
get 'ide' => 'ide#index'
|
|
|
|
get 'ide/*vueroute' => 'ide#index', format: false
|
|
|
|
|
|
|
|
draw :operations
|
|
|
|
draw :instance_statistics
|
2019-06-25 18:53:57 +00:00
|
|
|
|
|
|
|
Gitlab.ee do
|
2019-09-05 19:07:04 +00:00
|
|
|
draw :security
|
2019-06-25 18:53:57 +00:00
|
|
|
draw :smartcard
|
|
|
|
draw :jira_connect
|
2019-08-20 01:18:00 +00:00
|
|
|
draw :username
|
2019-09-13 13:26:31 +00:00
|
|
|
draw :trial
|
2019-08-26 22:16:03 +00:00
|
|
|
draw :trial_registration
|
2019-09-11 16:02:11 +00:00
|
|
|
draw :country
|
2019-12-11 00:08:25 +00:00
|
|
|
draw :country_state
|
2019-12-12 12:07:33 +00:00
|
|
|
draw :subscription
|
2020-02-29 00:07:44 +00:00
|
|
|
draw :analytics
|
2019-07-10 20:26:34 +00:00
|
|
|
end
|
|
|
|
|
2019-07-16 20:10:44 +00:00
|
|
|
if ENV['GITLAB_CHAOS_SECRET'] || Rails.env.development? || Rails.env.test?
|
2019-07-10 09:43:51 +00:00
|
|
|
resource :chaos, only: [] do
|
|
|
|
get :leakmem
|
|
|
|
get :cpu_spin
|
|
|
|
get :db_spin
|
|
|
|
get :sleep
|
|
|
|
get :kill
|
|
|
|
end
|
2018-11-01 17:20:34 +00:00
|
|
|
end
|
2020-03-13 00:09:34 +00:00
|
|
|
|
|
|
|
# Notification settings
|
|
|
|
resources :notification_settings, only: [:create, :update]
|
2018-11-01 00:39:01 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
concern :clusterable do
|
|
|
|
resources :clusters, only: [:index, :new, :show, :update, :destroy] do
|
2018-10-19 01:42:30 +00:00
|
|
|
collection do
|
|
|
|
post :create_user
|
|
|
|
post :create_gcp
|
2019-11-13 06:06:38 +00:00
|
|
|
post :create_aws
|
2019-11-08 06:06:24 +00:00
|
|
|
post :authorize_aws_role
|
2018-10-19 01:42:30 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
member do
|
2019-06-24 16:53:17 +00:00
|
|
|
Gitlab.ee do
|
|
|
|
get :metrics, format: :json
|
2019-09-18 14:02:45 +00:00
|
|
|
get :metrics_dashboard
|
|
|
|
get :'/prometheus/api/v1/*proxy_path', to: 'clusters#prometheus_proxy', as: :prometheus_api
|
2019-10-15 06:07:25 +00:00
|
|
|
get :environments, format: :json
|
2019-06-24 16:53:17 +00:00
|
|
|
end
|
|
|
|
|
2018-10-19 01:42:30 +00:00
|
|
|
scope :applications do
|
|
|
|
post '/:application', to: 'clusters/applications#create', as: :install_applications
|
2019-02-18 17:06:51 +00:00
|
|
|
patch '/:application', to: 'clusters/applications#update', as: :update_applications
|
2019-04-12 12:19:28 +00:00
|
|
|
delete '/:application', to: 'clusters/applications#destroy', as: :uninstall_applications
|
2018-10-19 01:42:30 +00:00
|
|
|
end
|
|
|
|
|
2018-11-01 00:39:01 +00:00
|
|
|
get :cluster_status, format: :json
|
2019-11-26 09:08:36 +00:00
|
|
|
delete :clear_cache
|
2018-10-19 01:42:30 +00:00
|
|
|
end
|
|
|
|
end
|
2018-10-15 03:37:51 +00:00
|
|
|
end
|
|
|
|
|
2015-04-10 13:22:31 +00:00
|
|
|
# Invites
|
|
|
|
resources :invites, only: [:show], constraints: { id: /[A-Za-z0-9_-]+/ } do
|
|
|
|
member do
|
|
|
|
post :accept
|
2015-04-10 14:37:02 +00:00
|
|
|
match :decline, via: [:get, :post]
|
2015-04-10 13:22:31 +00:00
|
|
|
end
|
|
|
|
end
|
2015-02-12 01:34:41 +00:00
|
|
|
|
2016-01-09 18:32:03 +00:00
|
|
|
resources :sent_notifications, only: [], constraints: { id: /\h{32}/ } do
|
2015-12-09 10:59:25 +00:00
|
|
|
member do
|
|
|
|
get :unsubscribe
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-08-06 12:03:27 +00:00
|
|
|
# Spam reports
|
|
|
|
resources :abuse_reports, only: [:new, :create]
|
|
|
|
|
2020-01-28 18:08:35 +00:00
|
|
|
resources :groups, only: [:index, :new, :create] do
|
|
|
|
post :preview_markdown
|
|
|
|
end
|
|
|
|
|
|
|
|
resources :projects, only: [:index, :new, :create]
|
|
|
|
|
|
|
|
get '/projects/:id' => 'projects#resolve'
|
|
|
|
|
|
|
|
Gitlab.ee do
|
|
|
|
scope '/-/push_from_secondary/:geo_node_id' do
|
|
|
|
draw :git_http
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
draw :git_http
|
|
|
|
draw :api
|
|
|
|
draw :sidekiq
|
|
|
|
draw :help
|
|
|
|
draw :snippets
|
2017-09-25 07:10:25 +00:00
|
|
|
draw :google_api
|
2016-10-05 12:21:27 +00:00
|
|
|
draw :import
|
|
|
|
draw :uploads
|
|
|
|
draw :explore
|
|
|
|
draw :admin
|
|
|
|
draw :profile
|
|
|
|
draw :dashboard
|
|
|
|
draw :group
|
|
|
|
draw :user
|
|
|
|
draw :project
|
2011-10-08 21:36:38 +00:00
|
|
|
|
2015-09-08 13:49:20 +00:00
|
|
|
root to: "root#index"
|
2016-10-14 21:11:19 +00:00
|
|
|
|
2016-11-14 14:55:31 +00:00
|
|
|
get '*unmatched_route', to: 'application#route_not_found'
|
2011-10-08 21:36:38 +00:00
|
|
|
end
|