diff options
Diffstat (limited to 'config/routes')
-rw-r--r-- | config/routes/admin.rb | 2 | ||||
-rw-r--r-- | config/routes/api.rb | 2 | ||||
-rw-r--r-- | config/routes/git_http.rb | 12 | ||||
-rw-r--r-- | config/routes/project.rb | 22 | ||||
-rw-r--r-- | config/routes/user.rb | 8 | ||||
-rw-r--r-- | config/routes/wiki.rb | 1 |
6 files changed, 32 insertions, 15 deletions
diff --git a/config/routes/admin.rb b/config/routes/admin.rb index f609739d9fd..6f9a5552564 100644 --- a/config/routes/admin.rb +++ b/config/routes/admin.rb @@ -73,7 +73,7 @@ namespace :admin do resource :background_jobs, controller: 'background_jobs', only: [:show] resource :system_info, controller: 'system_info', only: [:show] - resources :requests_profiles, only: [:index, :show], param: :name, constraints: { name: /.+\.html/ } + resources :requests_profiles, only: [:index, :show], param: :name, constraints: { name: /.+\.(html|txt)/ } resources :projects, only: [:index] diff --git a/config/routes/api.rb b/config/routes/api.rb index c6c17b5708e..d55bbdf6776 100644 --- a/config/routes/api.rb +++ b/config/routes/api.rb @@ -1,5 +1,5 @@ post '/api/graphql', to: 'graphql#execute' mount GraphiQL::Rails::Engine, at: '/-/graphql-explorer', graphql_path: '/api/graphql' -::API::API.logger Rails.logger +::API::API.logger Rails.logger # rubocop:disable Gitlab/RailsLogger mount ::API::API => '/' diff --git a/config/routes/git_http.rb b/config/routes/git_http.rb index a959d40881b..aac6d418a92 100644 --- a/config/routes/git_http.rb +++ b/config/routes/git_http.rb @@ -34,6 +34,18 @@ scope(path: '*namespace_id/:project_id', end end + # Redirect /group/project.wiki.git to the project wiki + scope(format: true, constraints: { project_id: Gitlab::PathRegex.project_wiki_git_route_regex, format: :git }) do + wiki_redirect = redirect do |params, request| + project_id = params[:project_id].delete_suffix('.wiki') + path = [params[:namespace_id], project_id, 'wikis'].join('/') + path << "?#{request.query_string}" unless request.query_string.blank? + path + end + + get '/', to: wiki_redirect + end + # Redirect /group/project/info/refs to /group/project.git/info/refs scope(constraints: { project_id: Gitlab::PathRegex.project_route_regex }) do # Allow /info/refs, /info/refs?service=git-upload-pack, and diff --git a/config/routes/project.rb b/config/routes/project.rb index c202463dadb..29e462f904d 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -170,7 +170,9 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do get :recent end end + resources :releases, only: [:index] + resources :starrers, only: [:index] resources :forks, only: [:index, :new, :create] resources :group_links, only: [:index, :create, :update, :destroy], constraints: { id: /\d+/ } @@ -265,6 +267,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do get :pipelines get :diffs, to: 'merge_requests/diffs#show' get :widget, to: 'merge_requests/content#widget' + get :cached_widget, to: 'merge_requests/content#cached_widget' end get :diff_for_path, controller: 'merge_requests/diffs' @@ -339,11 +342,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do resource :variables, only: [:show, :update] - resources :triggers, only: [:index, :create, :edit, :update, :destroy] do - member do - post :take_ownership - end - end + resources :triggers, only: [:index, :create, :edit, :update, :destroy] resource :mirror, only: [:show, :update] do member do @@ -360,6 +359,9 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do collection do resource :pipelines_settings, path: 'settings', only: [:show, :update] get :charts + scope '(*ref)', constraints: { ref: Gitlab::PathRegex.git_reference_regex } do + get :latest, action: :show, defaults: { latest: true } + end end member do @@ -478,7 +480,11 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do # in JSON format, or a request for tag named `latest.json`. scope format: false do resources :tags, only: [:index, :destroy], - constraints: { id: Gitlab::Regex.container_registry_tag_regex } + constraints: { id: Gitlab::Regex.container_registry_tag_regex } do + collection do + delete :bulk_destroy + end + end end end end @@ -504,6 +510,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do get :realtime_changes post :create_merge_request get :discussions, format: :json + + Gitlab.ee do + get 'designs(/*vueroute)', to: 'issues#show', as: :designs, format: false + end end collection do diff --git a/config/routes/user.rb b/config/routes/user.rb index 80f266aa8f9..d4616c8080d 100644 --- a/config/routes/user.rb +++ b/config/routes/user.rb @@ -43,13 +43,6 @@ scope '-/users', module: :users do end end -scope '-/users', module: :users do - resources :terms, only: [:index] do - post :accept, on: :member - post :decline, on: :member - end -end - scope(constraints: { username: Gitlab::PathRegex.root_namespace_route_regex }) do scope(path: 'users/:username', as: :user, @@ -59,6 +52,7 @@ scope(constraints: { username: Gitlab::PathRegex.root_namespace_route_regex }) d get :groups get :projects get :contributed, as: :contributed_projects + get :starred, as: :starred_projects get :snippets get :exists get :activity diff --git a/config/routes/wiki.rb b/config/routes/wiki.rb index 2ca52e55fca..d439c99270e 100644 --- a/config/routes/wiki.rb +++ b/config/routes/wiki.rb @@ -2,6 +2,7 @@ scope(controller: :wikis) do scope(path: 'wikis', as: :wikis) do get :git_access get :pages + get :new get '/', to: redirect('%{namespace_id}/%{project_id}/wikis/home') post '/', to: 'wikis#create' end |