diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/0_inflections.rb | 8 | ||||
-rw-r--r-- | config/initializers/1_settings.rb | 2 | ||||
-rw-r--r-- | config/initializers/sentry.rb | 13 | ||||
-rw-r--r-- | config/routes.rb | 30 | ||||
-rw-r--r-- | config/routes/api.rb | 4 | ||||
-rw-r--r-- | config/routes/profile.rb | 14 | ||||
-rw-r--r-- | config/routes/project.rb | 114 | ||||
-rw-r--r-- | config/routes/repository.rb | 2 | ||||
-rw-r--r-- | config/routes/snippets.rb | 2 | ||||
-rw-r--r-- | config/routes/user.rb | 25 |
10 files changed, 185 insertions, 29 deletions
diff --git a/config/initializers/0_inflections.rb b/config/initializers/0_inflections.rb index 1ad9ddca877..4d1f4917275 100644 --- a/config/initializers/0_inflections.rb +++ b/config/initializers/0_inflections.rb @@ -14,6 +14,14 @@ ActiveSupport::Inflector.inflections do |inflect| award_emoji project_statistics system_note_metadata + event_log project_auto_devops + project_registry + file_registry + job_artifact_registry + vulnerability_feedback + vulnerabilities_feedback + group_view ) + inflect.acronym 'EE' end diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 4b0bb86e42a..9e74a67b73f 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -368,7 +368,7 @@ Settings.cron_jobs['pages_domain_removal_cron_worker']['cron'] ||= '47 0 * * *' Settings.cron_jobs['pages_domain_removal_cron_worker']['job_class'] = 'PagesDomainRemovalCronWorker' Settings.cron_jobs['pages_domain_ssl_renewal_cron_worker'] ||= Settingslogic.new({}) -Settings.cron_jobs['pages_domain_ssl_renewal_cron_worker']['cron'] ||= '*/5 * * * *' +Settings.cron_jobs['pages_domain_ssl_renewal_cron_worker']['cron'] ||= '*/10 * * * *' Settings.cron_jobs['pages_domain_ssl_renewal_cron_worker']['job_class'] = 'PagesDomainSslRenewalCronWorker' Settings.cron_jobs['issue_due_scheduler_worker'] ||= Settingslogic.new({}) diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index e5589ce0ad1..fcc6bfa5c92 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -3,18 +3,11 @@ require 'gitlab/current_settings' def configure_sentry - # allow it to fail: it may do so when create_from_defaults is executed before migrations are actually done - begin - sentry_enabled = Gitlab::CurrentSettings.current_application_settings.sentry_enabled - rescue - sentry_enabled = false - end - - if sentry_enabled + if Gitlab::Sentry.enabled? Raven.configure do |config| - config.dsn = Gitlab::CurrentSettings.current_application_settings.sentry_dsn + config.dsn = Gitlab.config.sentry.dsn config.release = Gitlab.revision - config.current_environment = Gitlab.config.sentry.environment.presence + config.current_environment = Gitlab.config.sentry.environment # Sanitize fields based on those sanitized from Rails. config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s) diff --git a/config/routes.rb b/config/routes.rb index cb90a0134c4..a42fc037227 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -27,10 +27,16 @@ Rails.application.routes.draw do authorizations: 'oauth/authorizations' end - # 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 + # This prefixless path is required because Jira gets confused if we set it up with a path + # More information: https://gitlab.com/gitlab-org/gitlab-ee/issues/6752 scope path: '/login/oauth', controller: 'oauth/jira/authorizations', as: :oauth_jira do + Gitlab.ee do + get :authorize, action: :new + get :callback + post :access_token + end + + # This helps minimize merge conflicts with CE for this scope block match '*all', via: [:get, :post], to: proc { [404, {}, ['']] } end @@ -45,6 +51,10 @@ Rails.application.routes.draw do get '/autocomplete/award_emojis' => 'autocomplete#award_emojis' get '/autocomplete/merge_request_target_branches' => 'autocomplete#merge_request_target_branches' + Gitlab.ee do + get '/autocomplete/project_groups' => 'autocomplete#project_groups' + end + # Search get 'search' => 'search#show' get 'search/autocomplete' => 'search#autocomplete', as: :search_autocomplete @@ -73,6 +83,11 @@ Rails.application.routes.draw do end resources :issues, module: :boards, only: [:index, :update] + + Gitlab.ee do + resources :users, module: :boards, only: [:index] + resources :milestones, module: :boards, only: [:index] + end end get 'acme-challenge/' => 'acme_challenges#show' @@ -86,6 +101,11 @@ Rails.application.routes.draw do draw :operations draw :instance_statistics + Gitlab.ee do + draw :smartcard + draw :jira_connect + end + if ENV['GITLAB_ENABLE_CHAOS_ENDPOINTS'] get '/chaos/leakmem' => 'chaos#leakmem' get '/chaos/cpuspin' => 'chaos#cpuspin' @@ -102,6 +122,10 @@ Rails.application.routes.draw do end member do + Gitlab.ee do + get :metrics, format: :json + end + scope :applications do post '/:application', to: 'clusters/applications#create', as: :install_applications patch '/:application', to: 'clusters/applications#update', as: :update_applications diff --git a/config/routes/api.rb b/config/routes/api.rb index 3719b7d3a1e..3ba9176d943 100644 --- a/config/routes/api.rb +++ b/config/routes/api.rb @@ -3,5 +3,5 @@ constraints(::Constraints::FeatureConstrainer.new(:graphql, default_enabled: tru mount GraphiQL::Rails::Engine, at: '/-/graphql-explorer', graphql_path: '/api/graphql' end -API::API.logger Rails.logger -mount API::API => '/' +::API::API.logger Rails.logger +mount ::API::API => '/' diff --git a/config/routes/profile.rb b/config/routes/profile.rb index 0e213b0b989..83a2b33514b 100644 --- a/config/routes/profile.rb +++ b/config/routes/profile.rb @@ -40,6 +40,15 @@ resource :profile, only: [:show, :update] do put :resend_confirmation_instructions end end + + Gitlab.ee do + resource :slack, only: [:edit] do + member do + get :slack_link + end + end + end + resources :chat_names, only: [:index, :new, :create, :destroy] do collection do delete :deny @@ -63,5 +72,10 @@ resource :profile, only: [:show, :update] do end resources :u2f_registrations, only: [:destroy] + + Gitlab.ee do + resources :pipeline_quota, only: [:index] + resources :billings, only: [:index] + end end end diff --git a/config/routes/project.rb b/config/routes/project.rb index 898440e68eb..91613e3333f 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -79,12 +79,22 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do resource :operations, only: [:show, :update] resource :integrations, only: [:show] + Gitlab.ee do + resource :slack, only: [:destroy, :edit, :update] do + get :slack_auth + end + end + resource :repository, only: [:show], controller: :repository do post :create_deploy_token, path: 'deploy_token/create' post :cleanup end end + Gitlab.ee do + resources :feature_flags + end + resources :autocomplete_sources, only: [] do collection do get 'members' @@ -155,7 +165,11 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end - resources :boards, only: [:index, :show], constraints: { id: /\d+/ } + resources :boards, only: [:index, :show, :create, :update, :destroy], constraints: { id: /\d+/ } do + collection do + get :recent + end + end resources :releases, only: [:index] resources :forks, only: [:index, :new, :create] resources :group_links, only: [:index, :create, :update, :destroy], constraints: { id: /\d+/ } @@ -199,8 +213,18 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do resource :mattermost, only: [:new, :create] namespace :prometheus do - resources :metrics, constraints: { id: %r{[^\/]+} }, only: [] do + resources :metrics, constraints: { id: %r{[^\/]+} }, only: [:index, :new, :create, :edit, :update, :destroy] do get :active_common, on: :collection + + Gitlab.ee do + post :validate_query, on: :collection + end + end + + Gitlab.ee do + resources :alerts, constraints: { id: /\d+/ }, only: [:index, :create, :show, :update, :destroy] do + post :notify, on: :collection + end end end @@ -212,6 +236,15 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do get :pipeline_status get :ci_environments_status post :toggle_subscription + + Gitlab.ee do + get :approvals + post :approvals, action: :approve + delete :approvals, action: :unapprove + + post :rebase + end + post :remove_wip post :assign_related_issues get :discussions, format: :json @@ -245,6 +278,21 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do post :bulk_update end + Gitlab.ee do + resources :approvers, only: :destroy + delete 'approvers', to: 'approvers#destroy_via_user_id', as: :approver_via_user_id + resources :approver_groups, only: :destroy + + scope module: :merge_requests do + resources :drafts, only: [:index, :update, :create, :destroy] do + collection do + post :publish + delete :discard + end + end + end + end + resources :discussions, only: [:show], constraints: { id: /\h{40}/ } do member do post :resolve @@ -275,6 +323,17 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end + Gitlab.ee do + resources :path_locks, only: [:index, :destroy] do + collection do + post :toggle + end + end + + get '/service_desk' => 'service_desk#show', as: :service_desk + put '/service_desk' => 'service_desk#update', as: :service_desk_refresh + end + resource :variables, only: [:show, :update] resources :triggers, only: [:index, :create, :edit, :update, :destroy] do @@ -290,6 +349,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end + Gitlab.ee do + resources :push_rules, constraints: { id: /\d+/ }, only: [:update] + end + resources :pipelines, only: [:index, :new, :create, :show] do collection do resource :pipelines_settings, path: 'settings', only: [:show, :update] @@ -304,6 +367,11 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do get :builds get :failures get :status + + Gitlab.ee do + get :security + get :licenses + end end member do @@ -332,6 +400,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do get '/terminal.ws/authorize', to: 'environments#terminal_websocket_authorize', constraints: { format: nil } get '/prometheus/api/v1/*proxy_path', to: 'environments/prometheus_api#proxy', as: :prometheus_api + + Gitlab.ee do + get :logs + end end collection do @@ -348,6 +420,14 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end + Gitlab.ee do + resources :protected_environments, only: [:create, :update, :destroy], constraints: { id: /\d+/ } do + collection do + get 'search' + end + end + end + resource :cycle_analytics, only: [:show] namespace :cycle_analytics do @@ -400,6 +480,14 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end + Gitlab.ee do + namespace :security do + resource :dashboard, only: [:show], controller: :dashboard + end + + resources :vulnerability_feedback, only: [:index, :create, :update, :destroy], constraints: { id: /\d+/ } + end + get :issues, to: 'issues#calendar', constraints: lambda { |req| req.format == :ics } resources :issues, concerns: :awardable, constraints: { id: /\d+/ } do @@ -418,6 +506,15 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do collection do post :bulk_update post :import_csv + + Gitlab.ee do + post :export_csv + get :service_desk + end + end + + Gitlab.ee do + resources :issue_links, only: [:index, :create, :destroy], as: 'links', path: 'links' end end @@ -452,6 +549,11 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end + Gitlab.ee do + resources :approvers, only: :destroy + resources :approver_groups, only: :destroy + end + resources :runner_projects, only: [:create, :destroy] resources :badges, only: [:index] do collection do @@ -466,6 +568,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end + Gitlab.ee do + resources :audit_events, only: [:index] + end + resources :error_tracking, only: [:index], controller: :error_tracking do collection do post :list_projects @@ -476,6 +582,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do # its preferable to keep it below all other project routes draw :wiki draw :repository + + Gitlab.ee do + resources :managed_licenses, only: [:index, :show, :new, :create, :edit, :update, :destroy] + end end resources(:projects, diff --git a/config/routes/repository.rb b/config/routes/repository.rb index b96315bfe8b..1ea0ae72614 100644 --- a/config/routes/repository.rb +++ b/config/routes/repository.rb @@ -58,7 +58,7 @@ scope format: false do resource :release, controller: 'tags/releases', only: [:edit, :update] end - resources :protected_branches, only: [:index, :show, :create, :update, :destroy] + resources :protected_branches, only: [:index, :show, :create, :update, :destroy, :patch], constraints: { id: Gitlab::PathRegex.git_reference_regex } resources :protected_tags, only: [:index, :show, :create, :update, :destroy] end diff --git a/config/routes/snippets.rb b/config/routes/snippets.rb index 81bc890d86b..ba6da3ac57e 100644 --- a/config/routes/snippets.rb +++ b/config/routes/snippets.rb @@ -17,5 +17,5 @@ resources :snippets, concerns: :awardable do end end -get '/s/:username', to: redirect('u/%{username}/snippets'), +get '/s/:username', to: redirect('users/%{username}/snippets'), constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ } diff --git a/config/routes/user.rb b/config/routes/user.rb index e0ae264e2c0..80f266aa8f9 100644 --- a/config/routes/user.rb +++ b/config/routes/user.rb @@ -1,3 +1,8 @@ +Gitlab.ee do + get 'unsubscribes/:email', to: 'unsubscribes#show', as: :unsubscribe + post 'unsubscribes/:email', to: 'unsubscribes#create' +end + # Allows individual providers to be directed to a chosen controller # Call from inside devise_scope def override_omniauth(provider, controller, path_prefix = '/users/auth') @@ -25,6 +30,17 @@ devise_for :users, controllers: { omniauth_callbacks: :omniauth_callbacks, devise_scope :user do get '/users/auth/:provider/omniauth_error' => 'omniauth_callbacks#omniauth_error', as: :omniauth_error get '/users/almost_there' => 'confirmations#almost_there' + + Gitlab.ee do + get '/users/auth/kerberos_spnego/negotiate' => 'omniauth_kerberos_spnego#negotiate' + end +end + +scope '-/users', module: :users do + resources :terms, only: [:index] do + post :accept, on: :member + post :decline, on: :member + end end scope '-/users', module: :users do @@ -48,15 +64,6 @@ scope(constraints: { username: Gitlab::PathRegex.root_namespace_route_regex }) d get :activity get '/', to: redirect('%{username}'), as: nil end - - # Compatibility with old routing - # TODO (dzaporozhets): remove in 10.0 - get '/u/:username', to: redirect('%{username}') - # TODO (dzaporozhets): remove in 9.0 - get '/u/:username/groups', to: redirect('users/%{username}/groups') - get '/u/:username/projects', to: redirect('users/%{username}/projects') - get '/u/:username/snippets', to: redirect('users/%{username}/snippets') - get '/u/:username/contributed', to: redirect('users/%{username}/contributed') end constraints(::Constraints::UserUrlConstrainer.new) do |