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