2017-04-13 16:44:52 +00:00
|
|
|
# All routing related to repository browsing
|
2016-11-07 15:14:34 +00:00
|
|
|
|
|
|
|
resource :repository, only: [:create] do
|
|
|
|
member do
|
2017-08-10 08:49:11 +00:00
|
|
|
# deprecated since GitLab 9.5
|
2018-02-19 20:41:04 +00:00
|
|
|
get 'archive', constraints: { format: Gitlab::PathRegex.archive_formats_regex }, as: 'archive_alternative', defaults: { append_sha: true }
|
|
|
|
|
|
|
|
# deprecated since GitLab 10.7
|
|
|
|
get ':id/archive', constraints: { format: Gitlab::PathRegex.archive_formats_regex, id: /.+/ }, action: 'archive', as: 'archive_deprecated', defaults: { append_sha: true }
|
2016-11-07 15:14:34 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-04-13 16:44:52 +00:00
|
|
|
# Don't use format parameter as file extension (old 3.0.x behavior)
|
|
|
|
# See http://guides.rubyonrails.org/routing.html#route-globbing-and-wildcard-segments
|
|
|
|
scope format: false do
|
|
|
|
get '/compare/:from...:to', to: 'compare#show', as: 'compare', constraints: { from: /.+/, to: /.+/ }
|
|
|
|
|
|
|
|
resources :compare, only: [:index, :create] do
|
|
|
|
collection do
|
|
|
|
get :diff_for_path
|
2018-05-07 08:41:36 +00:00
|
|
|
get :signatures
|
2017-04-13 16:44:52 +00:00
|
|
|
end
|
2016-11-07 15:14:34 +00:00
|
|
|
end
|
|
|
|
|
2017-04-13 16:44:52 +00:00
|
|
|
resources :refs, only: [] do
|
|
|
|
collection do
|
|
|
|
get 'switch'
|
|
|
|
end
|
|
|
|
|
|
|
|
member do
|
|
|
|
# tree viewer logs
|
2017-05-24 20:59:26 +00:00
|
|
|
get 'logs_tree', constraints: { id: Gitlab::PathRegex.git_reference_regex }
|
2017-04-13 16:44:52 +00:00
|
|
|
# Directories with leading dots erroneously get rejected if git
|
|
|
|
# ref regex used in constraints. Regex verification now done in controller.
|
|
|
|
get 'logs_tree/*path', action: :logs_tree, as: :logs_file, format: false, constraints: {
|
|
|
|
id: /.*/,
|
|
|
|
path: /.*/
|
|
|
|
}
|
|
|
|
end
|
2016-11-07 15:14:34 +00:00
|
|
|
end
|
|
|
|
|
2017-05-24 20:59:26 +00:00
|
|
|
scope constraints: { id: Gitlab::PathRegex.git_reference_regex } do
|
2017-04-13 16:44:52 +00:00
|
|
|
resources :network, only: [:show]
|
2016-11-07 15:14:34 +00:00
|
|
|
|
2017-04-13 16:44:52 +00:00
|
|
|
resources :graphs, only: [:show] do
|
|
|
|
member do
|
|
|
|
get :charts
|
|
|
|
get :commits
|
|
|
|
get :ci
|
|
|
|
get :languages
|
|
|
|
end
|
|
|
|
end
|
2016-11-07 15:14:34 +00:00
|
|
|
|
2017-11-15 14:56:36 +00:00
|
|
|
get '/branches/:state', to: 'branches#index', as: :branches_filtered, constraints: { state: /active|stale|all/ }
|
2017-04-13 16:44:52 +00:00
|
|
|
resources :branches, only: [:index, :new, :create, :destroy]
|
|
|
|
delete :merged_branches, controller: 'branches', action: :destroy_all_merged
|
|
|
|
resources :tags, only: [:index, :show, :new, :create, :destroy] do
|
2018-12-17 09:53:17 +00:00
|
|
|
resource :release, controller: 'tags/releases', only: [:edit, :update]
|
2017-04-13 16:44:52 +00:00
|
|
|
end
|
2016-11-07 15:14:34 +00:00
|
|
|
|
2017-04-13 16:44:52 +00:00
|
|
|
resources :protected_branches, only: [:index, :show, :create, :update, :destroy]
|
|
|
|
resources :protected_tags, only: [:index, :show, :create, :update, :destroy]
|
|
|
|
end
|
|
|
|
|
|
|
|
scope constraints: { id: /.+/ } do
|
|
|
|
scope controller: :blob do
|
|
|
|
get '/new/*id', action: :new, as: :new_blob
|
|
|
|
post '/create/*id', action: :create, as: :create_blob
|
|
|
|
get '/edit/*id', action: :edit, as: :edit_blob
|
|
|
|
put '/update/*id', action: :update, as: :update_blob
|
|
|
|
post '/preview/*id', action: :preview, as: :preview_blob
|
2016-11-07 15:14:34 +00:00
|
|
|
|
2017-04-13 16:44:52 +00:00
|
|
|
scope path: '/blob/*id', as: :blob do
|
|
|
|
get :diff
|
|
|
|
get '/', action: :show
|
|
|
|
delete '/', action: :destroy
|
|
|
|
post '/', action: :create
|
|
|
|
put '/', action: :update
|
|
|
|
end
|
|
|
|
end
|
2016-11-07 15:14:34 +00:00
|
|
|
|
2017-04-13 16:44:52 +00:00
|
|
|
get '/tree/*id', to: 'tree#show', as: :tree
|
|
|
|
get '/raw/*id', to: 'raw#show', as: :raw
|
|
|
|
get '/blame/*id', to: 'blame#show', as: :blame
|
2017-07-25 07:40:23 +00:00
|
|
|
|
2018-07-24 00:04:16 +00:00
|
|
|
get '/commits', to: 'commits#commits_root', as: :commits_root
|
2017-07-25 07:40:23 +00:00
|
|
|
get '/commits/*id/signatures', to: 'commits#signatures', as: :signatures
|
2017-04-13 16:44:52 +00:00
|
|
|
get '/commits/*id', to: 'commits#show', as: :commits
|
2016-11-07 15:14:34 +00:00
|
|
|
|
2017-04-13 16:44:52 +00:00
|
|
|
post '/create_dir/*id', to: 'tree#create_dir', as: :create_dir
|
2016-11-07 15:14:34 +00:00
|
|
|
|
2017-04-13 16:44:52 +00:00
|
|
|
scope controller: :find_file do
|
|
|
|
get '/find_file/*id', action: :show, as: :find_file
|
2016-11-07 15:14:34 +00:00
|
|
|
|
2017-04-13 16:44:52 +00:00
|
|
|
get '/files/*id', action: :list, as: :files
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|