|
1 |
| -RedmineApp::Application.routes.draw do |
2 |
| - # Handle the public keys plugin to my/account. |
3 |
| - scope 'my' do |
4 |
| - resources :public_keys, controller: 'gitolite_public_keys' |
5 |
| - end |
6 |
| - |
7 |
| - # Don't create routes for repositories resources with only: [] |
8 |
| - # to not override Redmine's routes. |
9 |
| - resources :repositories, only: [] do |
10 |
| - member do |
11 |
| - get 'download_revision', to: 'download_git_revision#index', as: 'download_git_revision' |
12 |
| - end |
| 1 | +# Handle the public keys plugin to my/account. |
| 2 | +scope 'my' do |
| 3 | + resources :public_keys, controller: 'gitolite_public_keys' |
| 4 | +end |
13 | 5 |
|
14 |
| - resource :git_extras, controller: 'repository_git_extras', only: [:update] |
15 |
| - resource :git_notifications, controller: 'repository_git_notifications' |
| 6 | +# Don't create routes for repositories resources with only: [] |
| 7 | +# to not override Redmine's routes. |
| 8 | +resources :repositories, only: [] do |
| 9 | + member do |
| 10 | + get 'download_revision', to: 'download_git_revision#index', as: 'download_git_revision' |
| 11 | + end |
16 | 12 |
|
17 |
| - resources :post_receive_urls, controller: 'repository_post_receive_urls' |
18 |
| - resources :deployment_credentials, controller: 'repository_deployment_credentials' |
19 |
| - resources :git_config_keys, controller: 'repository_git_config_keys' |
| 13 | + resource :git_extras, controller: 'repository_git_extras', only: [:update] |
| 14 | + resource :git_notifications, controller: 'repository_git_notifications' |
20 | 15 |
|
21 |
| - resources :mirrors, controller: 'repository_mirrors' do |
22 |
| - member { get :push } |
23 |
| - end |
| 16 | + resources :post_receive_urls, controller: 'repository_post_receive_urls' |
| 17 | + resources :deployment_credentials, controller: 'repository_deployment_credentials' |
| 18 | + resources :git_config_keys, controller: 'repository_git_config_keys' |
24 | 19 |
|
25 |
| - resources :protected_branches, controller: 'repository_protected_branches' do |
26 |
| - member { get :clone } |
27 |
| - collection { post :sort } |
28 |
| - end |
| 20 | + resources :mirrors, controller: 'repository_mirrors' do |
| 21 | + member { get :push } |
29 | 22 | end
|
30 | 23 |
|
31 |
| - # Enable Redirector for Go Lang repositories |
32 |
| - get 'go/:repo_path', repo_path: /([^\/]+\/)*?[^\/]+/, to: 'go_redirector#index' |
| 24 | + resources :protected_branches, controller: 'repository_protected_branches' do |
| 25 | + member { get :clone } |
| 26 | + collection { post :sort } |
| 27 | + end |
| 28 | +end |
33 | 29 |
|
34 |
| - # Enable SmartHTTP Grack support |
35 |
| - mount Grack::Bundle.new({}), at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post] |
| 30 | +# Enable Redirector for Go Lang repositories |
| 31 | +get 'go/:repo_path', repo_path: /([^\/]+\/)*?[^\/]+/, to: 'go_redirector#index' |
36 | 32 |
|
37 |
| - # Post Receive Hooks |
38 |
| - match 'githooks/post-receive/:type/:projectid', to: 'gitolite_hooks#post_receive', via: [:post] |
| 33 | +# Enable SmartHTTP Grack support |
| 34 | +mount Grack::Bundle.new({}), at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post] |
39 | 35 |
|
40 |
| - # Archived Repositories |
41 |
| - get 'archived_projects/index', to: 'archived_repositories#index' |
42 |
| - get 'archived_projects/:id/repository/:repository_id/statistics', to: 'archived_repositories#stats' |
43 |
| - get 'archived_projects/:id/repository/:repository_id/graph', to: 'archived_repositories#graph' |
44 |
| - get 'archived_projects/:id/repository/:repository_id/changes(/*path(.:ext))', to: 'archived_repositories#changes' |
45 |
| - get 'archived_projects/:id/repository/:repository_id/revisions/:rev', to: 'archived_repositories#revision' |
46 |
| - get 'archived_projects/:id/repository/:repository_id/revision', to: 'archived_repositories#revision' |
47 |
| - get 'archived_projects/:id/repository/:repository_id/revisions', to: 'archived_repositories#revisions' |
48 |
| - get 'archived_projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))', |
49 |
| - controller: 'archived_repositories', |
50 |
| - format: false, |
51 |
| - constraints: { |
52 |
| - action: /(browse|show|entry|raw|annotate|diff)/, |
53 |
| - rev: /[a-z0-9\.\-_]+/ |
54 |
| - } |
| 36 | +# Post Receive Hooks |
| 37 | +match 'githooks/post-receive/:type/:projectid', to: 'gitolite_hooks#post_receive', via: [:post] |
55 | 38 |
|
56 |
| - get 'archived_projects/:id/repository/statistics', to: 'archived_repositories#stats' |
57 |
| - get 'archived_projects/:id/repository/graph', to: 'archived_repositories#graph' |
58 |
| - get 'archived_projects/:id/repository/changes(/*path(.:ext))', to: 'archived_repositories#changes' |
59 |
| - get 'archived_projects/:id/repository/revisions', to: 'archived_repositories#revisions' |
60 |
| - get 'archived_projects/:id/repository/revisions/:rev', to: 'archived_repositories#revision' |
61 |
| - get 'archived_projects/:id/repository/revision', to: 'archived_repositories#revision' |
62 |
| - get 'archived_projects/:id/repository/revisions/:rev/:action(/*path(.:ext))', |
63 |
| - controller: 'archived_repositories', |
64 |
| - format: false, |
65 |
| - constraints: { |
66 |
| - action: /(browse|show|entry|raw|annotate|diff)/, |
67 |
| - rev: /[a-z0-9\.\-_]+/ |
68 |
| - } |
69 |
| - get 'archived_projects/:id/repository/:repository_id/:action(/*path(.:ext))', |
70 |
| - controller: 'archived_repositories', |
71 |
| - action: /(browse|show|entry|raw|changes|annotate|diff)/ |
| 39 | +# Archived Repositories |
| 40 | +get 'archived_projects/index', to: 'archived_repositories#index' |
| 41 | +get 'archived_projects/:id/repository/:repository_id/statistics', to: 'archived_repositories#stats' |
| 42 | +get 'archived_projects/:id/repository/:repository_id/graph', to: 'archived_repositories#graph' |
| 43 | +get 'archived_projects/:id/repository/:repository_id/changes(/*path(.:ext))', to: 'archived_repositories#changes' |
| 44 | +get 'archived_projects/:id/repository/:repository_id/revisions/:rev', to: 'archived_repositories#revision' |
| 45 | +get 'archived_projects/:id/repository/:repository_id/revision', to: 'archived_repositories#revision' |
| 46 | +get 'archived_projects/:id/repository/:repository_id/revisions', to: 'archived_repositories#revisions' |
| 47 | +get 'archived_projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))', |
| 48 | + controller: 'archived_repositories', |
| 49 | + format: false, |
| 50 | + constraints: { |
| 51 | + action: /(browse|show|entry|raw|annotate|diff)/, |
| 52 | + rev: /[a-z0-9\.\-_]+/ |
| 53 | + } |
72 | 54 |
|
73 |
| - get 'archived_projects/:id/repository/:action(/*path(.:ext))', |
74 |
| - controller: 'archived_repositories', |
75 |
| - action: /(browse|show|entry|raw|changes|annotate|diff)/ |
| 55 | +get 'archived_projects/:id/repository/statistics', to: 'archived_repositories#stats' |
| 56 | +get 'archived_projects/:id/repository/graph', to: 'archived_repositories#graph' |
| 57 | +get 'archived_projects/:id/repository/changes(/*path(.:ext))', to: 'archived_repositories#changes' |
| 58 | +get 'archived_projects/:id/repository/revisions', to: 'archived_repositories#revisions' |
| 59 | +get 'archived_projects/:id/repository/revisions/:rev', to: 'archived_repositories#revision' |
| 60 | +get 'archived_projects/:id/repository/revision', to: 'archived_repositories#revision' |
| 61 | +get 'archived_projects/:id/repository/revisions/:rev/:action(/*path(.:ext))', |
| 62 | + controller: 'archived_repositories', |
| 63 | + format: false, |
| 64 | + constraints: { |
| 65 | + action: /(browse|show|entry|raw|annotate|diff)/, |
| 66 | + rev: /[a-z0-9\.\-_]+/ |
| 67 | + } |
| 68 | +get 'archived_projects/:id/repository/:repository_id/:action(/*path(.:ext))', |
| 69 | + controller: 'archived_repositories', |
| 70 | + action: /(browse|show|entry|raw|changes|annotate|diff)/ |
76 | 71 |
|
77 |
| - get 'archived_projects/:id/repository/:repository_id', to: 'archived_repositories#show', path: nil |
78 |
| - get 'archived_projects/:id/repository', to: 'archived_repositories#show', path: nil |
| 72 | +get 'archived_projects/:id/repository/:action(/*path(.:ext))', |
| 73 | + controller: 'archived_repositories', |
| 74 | + action: /(browse|show|entry|raw|changes|annotate|diff)/ |
79 | 75 |
|
80 |
| -end |
| 76 | +get 'archived_projects/:id/repository/:repository_id', to: 'archived_repositories#show', path: nil |
| 77 | +get 'archived_projects/:id/repository', to: 'archived_repositories#show', path: nil |
0 commit comments