2014-09-02 18:07:02 +05:30
|
|
|
require 'sidekiq/web'
|
2015-12-23 02:04:40 +05:30
|
|
|
require 'sidekiq/cron/web'
|
2016-06-02 11:05:42 +05:30
|
|
|
|
2016-11-03 12:29:30 +05:30
|
|
|
Rails.application.routes.draw do
|
2016-06-16 23:09:34 +05:30
|
|
|
concern :access_requestable do
|
|
|
|
post :request_access, on: :collection
|
|
|
|
post :approve_access_request, on: :member
|
|
|
|
end
|
|
|
|
|
2016-09-29 09:46:39 +05:30
|
|
|
concern :awardable do
|
|
|
|
post :toggle_award_emoji, on: :member
|
|
|
|
end
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
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-11-03 12:29:30 +05:30
|
|
|
draw :sherlock
|
|
|
|
draw :development
|
|
|
|
draw :ci
|
2015-09-25 12:07:36 +05:30
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
use_doorkeeper do
|
|
|
|
controllers applications: 'oauth/applications',
|
|
|
|
authorized_applications: 'oauth/authorized_applications',
|
|
|
|
authorizations: 'oauth/authorizations'
|
|
|
|
end
|
|
|
|
|
2018-11-20 20:47:30 +05:30
|
|
|
# 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-12-05 23:21:45 +05:30
|
|
|
match '*all', via: [:get, :post], to: proc { [404, {}, ['']] }
|
2018-11-20 20:47:30 +05:30
|
|
|
end
|
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
draw :oauth
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
use_doorkeeper_openid_connect
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
# Autocomplete
|
|
|
|
get '/autocomplete/users' => 'autocomplete#users'
|
|
|
|
get '/autocomplete/users/:id' => 'autocomplete#user'
|
2016-06-16 23:09:34 +05:30
|
|
|
get '/autocomplete/projects' => 'autocomplete#projects'
|
2018-03-17 18:26:18 +05:30
|
|
|
get '/autocomplete/award_emojis' => 'autocomplete#award_emojis'
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
# Search
|
2015-04-26 12:48:37 +05:30
|
|
|
get 'search' => 'search#show'
|
|
|
|
get 'search/autocomplete' => 'search#autocomplete', as: :search_autocomplete
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
# JSON Web Token
|
|
|
|
get 'jwt/auth' => 'jwt#auth'
|
|
|
|
|
|
|
|
# Health check
|
|
|
|
get 'health_check(/:checks)' => 'health_check#index', as: :health_check
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
scope path: '-' do
|
2018-11-18 11:00:15 +05:30
|
|
|
# '/-/health' implemented by BasicHealthMiddleware
|
2017-09-10 17:25:29 +05:30
|
|
|
get 'liveness' => 'health#liveness'
|
|
|
|
get 'readiness' => 'health#readiness'
|
|
|
|
resources :metrics, only: [:index]
|
2018-05-09 12:01:36 +05:30
|
|
|
mount Peek::Railtie => '/peek', as: 'peek_routes'
|
2018-03-17 18:26:18 +05:30
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# UserCallouts
|
|
|
|
resources :user_callouts, only: [:create]
|
2018-05-09 12:01:36 +05:30
|
|
|
|
|
|
|
get 'ide' => 'ide#index'
|
|
|
|
get 'ide/*vueroute' => 'ide#index', format: false
|
2018-11-18 11:00:15 +05:30
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
draw :operations
|
2018-11-18 11:00:15 +05:30
|
|
|
draw :instance_statistics
|
2018-12-13 13:39:08 +05:30
|
|
|
|
|
|
|
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
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
concern :clusterable do
|
|
|
|
resources :clusters, only: [:index, :new, :show, :update, :destroy] do
|
|
|
|
collection do
|
|
|
|
post :create_user
|
|
|
|
post :create_gcp
|
|
|
|
end
|
|
|
|
|
|
|
|
member do
|
|
|
|
scope :applications do
|
|
|
|
post '/:application', to: 'clusters/applications#create', as: :install_applications
|
|
|
|
end
|
|
|
|
|
|
|
|
get :cluster_status, format: :json
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2016-09-13 17:45:13 +05:30
|
|
|
|
2016-11-03 12:29:30 +05:30
|
|
|
draw :api
|
|
|
|
draw :sidekiq
|
|
|
|
draw :help
|
|
|
|
draw :snippets
|
2015-04-26 12:48:37 +05:30
|
|
|
|
|
|
|
# Invites
|
|
|
|
resources :invites, only: [:show], constraints: { id: /[A-Za-z0-9_-]+/ } do
|
|
|
|
member do
|
|
|
|
post :accept
|
|
|
|
match :decline, via: [:get, :post]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-01-19 16:12:03 +05:30
|
|
|
resources :sent_notifications, only: [], constraints: { id: /\h{32}/ } do
|
|
|
|
member do
|
|
|
|
get :unsubscribe
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-09-11 14:41:01 +05:30
|
|
|
# Spam reports
|
|
|
|
resources :abuse_reports, only: [:new, :create]
|
|
|
|
|
2016-06-22 15:30:34 +05:30
|
|
|
# Notification settings
|
|
|
|
resources :notification_settings, only: [:create, :update]
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
draw :google_api
|
2016-11-03 12:29:30 +05:30
|
|
|
draw :import
|
|
|
|
draw :uploads
|
|
|
|
draw :explore
|
|
|
|
draw :admin
|
|
|
|
draw :profile
|
|
|
|
draw :dashboard
|
|
|
|
draw :group
|
|
|
|
draw :user
|
|
|
|
draw :project
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2016-11-03 12:29:30 +05:30
|
|
|
root to: "root#index"
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
get '*unmatched_route', to: 'application#route_not_found'
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|