routes.rb 17.9 KB
Newer Older
D
sidekiq  
Dmitriy Zaporozhets 已提交
1
require 'sidekiq/web'
2
require 'sidekiq/cron/web'
3
require 'api/api'
D
sidekiq  
Dmitriy Zaporozhets 已提交
4

V
Valery Sizov 已提交
5
Rails.application.routes.draw do
6 7 8 9 10 11 12 13 14 15 16 17 18
  if Gitlab::Sherlock.enabled?
    namespace :sherlock do
      resources :transactions, only: [:index, :show] do
        resources :queries, only: [:show]
        resources :file_samples, only: [:show]

        collection do
          delete :destroy_all
        end
      end
    end
  end

D
Douwe Maan 已提交
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
  namespace :ci do
    # CI API
    Ci::API::API.logger Rails.logger
    mount Ci::API::API => '/api'

    resource :lint, only: [:show, :create]

    resources :projects do
      member do
        get :status, to: 'projects#badge'
        get :integration
      end
    end

    root to: 'projects#index'
  end

V
Valery Sizov 已提交
36
  use_doorkeeper do
37 38 39
    controllers applications: 'oauth/applications',
                authorized_applications: 'oauth/authorized_applications',
                authorizations: 'oauth/authorizations'
V
Valery Sizov 已提交
40
  end
41

42 43 44 45 46
  # Autocomplete
  get '/autocomplete/users' => 'autocomplete#users'
  get '/autocomplete/users/:id' => 'autocomplete#user'


47
  # Search
48 49
  get 'search' => 'search#show'
  get 'search/autocomplete' => 'search#autocomplete', as: :search_autocomplete
V
Valery Sizov 已提交
50

51
  # API
52 53
  API::API.logger Rails.logger
  mount API::API => '/api'
54

G
GitLab 已提交
55
  # Get all keys of user
56 57
  get ':username.keys' => 'profiles/keys#get_keys' , constraints: { username: /.*/ }

58
  constraint = lambda { |request| request.env['warden'].authenticate? and request.env['warden'].user.admin? }
D
sidekiq  
Dmitriy Zaporozhets 已提交
59
  constraints constraint do
60
    mount Sidekiq::Web, at: '/admin/sidekiq', as: :sidekiq
D
sidekiq  
Dmitriy Zaporozhets 已提交
61
  end
A
Ariejan de Vroom 已提交
62

63
  # Enable Grack support
M
Marin Jankovski 已提交
64
  mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post, :put]
65

66
  # Help
J
Job van der Voort 已提交
67
  get 'help'                  => 'help#index'
68
  get 'help/:category/:file'  => 'help#show', as: :help_page, constraints: { category: /.*/, file: /[^\/\.]+/ }
M
Marin Jankovski 已提交
69
  get 'help/shortcuts'
70
  get 'help/ui'               => 'help#ui'
71

A
Andrew8xx8 已提交
72 73 74 75 76
  #
  # Global snippets
  #
  resources :snippets do
    member do
77
      get 'raw'
A
Andrew8xx8 已提交
78 79
    end
  end
80 81

  get '/s/:username' => 'snippets#index', as: :user_snippets, constraints: { username: /.*/ }
A
Andrew8xx8 已提交
82

D
Douwe Maan 已提交
83 84 85 86 87 88 89
  #
  # Invites
  #

  resources :invites, only: [:show], constraints: { id: /[A-Za-z0-9_-]+/ } do
    member do
      post :accept
D
Douwe Maan 已提交
90
      match :decline, via: [:get, :post]
D
Douwe Maan 已提交
91 92
    end
  end
M
Marin Jankovski 已提交
93

94 95 96
  # Spam reports
  resources :abuse_reports, only: [:new, :create]

V
Valery Sizov 已提交
97
  #
98
  # Import
V
Valery Sizov 已提交
99
  #
100 101
  namespace :import do
    resource :github, only: [:create, :new], controller: :github do
V
Valery Sizov 已提交
102 103 104 105 106
      get :status
      get :callback
      get :jobs
    end

107
    resource :gitlab, only: [:create, :new], controller: :gitlab do
V
Valery Sizov 已提交
108 109 110 111
      get :status
      get :callback
      get :jobs
    end
M
Marcin Kulik 已提交
112

D
Douwe Maan 已提交
113 114 115 116 117
    resource :bitbucket, only: [:create, :new], controller: :bitbucket do
      get :status
      get :callback
      get :jobs
    end
118

M
Marcin Kulik 已提交
119 120 121 122 123
    resource :gitorious, only: [:create, :new], controller: :gitorious do
      get :status
      get :callback
      get :jobs
    end
124 125 126 127 128

    resource :google_code, only: [:create, :new], controller: :google_code do
      get :status
      post :callback
      get :jobs
D
Douwe Maan 已提交
129 130 131

      get   :new_user_map,    path: :user_map
      post  :create_user_map, path: :user_map
132
    end
J
Jared Szechy 已提交
133 134 135 136 137 138 139 140 141

    resource :fogbugz, only: [:create, :new], controller: :fogbugz do
      get :status
      post :callback
      get :jobs

      get   :new_user_map,    path: :user_map
      post  :create_user_map, path: :user_map
    end
V
Valery Sizov 已提交
142
  end
M
Marin Jankovski 已提交
143

144 145 146
  #
  # Uploads
  #
M
Marin Jankovski 已提交
147

148 149
  scope path: :uploads do
    # Note attachments and User/Group/Project avatars
150 151
    get ":model/:mounted_as/:id/:filename",
        to:           "uploads#show",
152
        constraints:  { model: /note|user|group|project/, mounted_as: /avatar|attachment/, filename: /[^\/]+/ }
153 154

    # Project markdown uploads
155
    get ":namespace_id/:project_id/:secret/:filename",
156
      to:           "projects/uploads#show",
157
      constraints:  { namespace_id: /[a-zA-Z.0-9_\-]+/, project_id: /[a-zA-Z.0-9_\-]+/, filename: /[^\/]+/ }
158
  end
V
Valery Sizov 已提交
159

160
  # Redirect old note attachments path to new uploads path.
161 162
  get "files/note/:id/:filename",
    to:           redirect("uploads/note/attachment/%{id}/%{filename}"),
163
    constraints:  { filename: /[^\/]+/ }
164

165
  #
Y
Yatish Mehta 已提交
166
  # Explore area
167
  #
D
Dmitriy Zaporozhets 已提交
168 169 170 171
  namespace :explore do
    resources :projects, only: [:index] do
      collection do
        get :trending
172
        get :starred
D
Dmitriy Zaporozhets 已提交
173 174 175
      end
    end

176
    resources :groups, only: [:index]
177
    resources :snippets, only: [:index]
178
    root to: 'projects#trending'
179 180
  end

D
Dmitriy Zaporozhets 已提交
181
  # Compatibility with old routing
182 183
  get 'public' => 'explore/projects#index'
  get 'public/projects' => 'explore/projects#index'
D
Dmitriy Zaporozhets 已提交
184

185 186 187
  #
  # Admin Area
  #
N
Nihad Abbasov 已提交
188
  namespace :admin do
189
    resources :users, constraints: { id: /[a-zA-Z.\/0-9_\-]+/ } do
190
      resources :keys, only: [:show, :destroy]
191
      resources :identities, only: [:index, :edit, :update, :destroy]
192

193 194
      delete 'stop_impersonation' => 'impersonation#destroy', on: :collection

195
      member do
D
Dmitriy Zaporozhets 已提交
196 197 198
        get :projects
        get :keys
        get :groups
D
Dmitriy Zaporozhets 已提交
199
        put :team_update
200 201
        put :block
        put :unblock
202
        put :unlock
203
        put :confirm
204
        post 'impersonate' => 'impersonation#create'
205
        patch :disable_two_factor
206
        delete 'remove/:email_id', action: 'remove_email', as: 'remove_email'
D
Dmitriy Zaporozhets 已提交
207 208
      end
    end
A
Andrey Kumanyaev 已提交
209

210
    resources :abuse_reports, only: [:index, :destroy]
V
Valery Sizov 已提交
211 212
    resources :applications

213 214
    resources :groups, constraints: { id: /[^\/]+/ } do
      member do
215
        put :members_update
216
      end
A
Andrey Kumanyaev 已提交
217
    end
A
Andrey Kumanyaev 已提交
218

219
    resources :deploy_keys, only: [:index, :new, :create, :destroy]
220

R
Robert Speicher 已提交
221
    resources :hooks, only: [:index, :create, :destroy] do
V
Valeriy Sizov 已提交
222 223
      get :test
    end
A
Andrey Kumanyaev 已提交
224

225
    resources :broadcast_messages, only: [:index, :create, :destroy]
226
    resource :logs, only: [:show]
227
    resource :background_jobs, controller: 'background_jobs', only: [:show]
228

V
Vinnie Okada 已提交
229 230 231
    resources :namespaces, path: '/projects', constraints: { id: /[a-zA-Z.0-9_\-]+/ }, only: [] do
      root to: 'projects#index', as: :projects

232 233
      resources(:projects,
                path: '/',
V
Vinnie Okada 已提交
234 235 236 237 238 239 240
                constraints: { id: /[a-zA-Z.0-9_\-]+/ },
                only: [:index, :show]) do
        root to: 'projects#show'

        member do
          put :transfer
        end
K
Kamil Trzcinski 已提交
241 242

        resources :runner_projects
243 244 245
      end
    end

M
Marin Jankovski 已提交
246 247
    resource :application_settings, only: [:show, :update] do
      resources :services
248
      put :reset_runners_token
M
Marin Jankovski 已提交
249
    end
250

V
Valery Sizov 已提交
251 252
    resources :labels

K
Kamil Trzcinski 已提交
253 254 255 256 257 258 259 260 261 262 263 264 265
    resources :runners, only: [:index, :show, :update, :destroy] do
      member do
        get :resume
        get :pause
      end
    end

    resources :builds, only: :index do
      collection do
        post :cancel_all
      end
    end

266
    root to: 'dashboard#index'
G
gitlabhq 已提交
267 268
  end

R
randx 已提交
269 270 271
  #
  # Profile Area
  #
272 273
  resource :profile, only: [:show, :update] do
    member do
V
Valery Sizov 已提交
274
      get :audit_log
D
Dmitriy Zaporozhets 已提交
275
      get :applications
276 277 278 279

      put :reset_private_token
      put :update_username
    end
D
Dmitriy Zaporozhets 已提交
280

281
    scope module: :profiles do
282 283 284 285 286
      resource :account, only: [:show, :update] do
        member do
          delete :unlink
        end
      end
287
      resource :notifications, only: [:show, :update]
288 289 290 291 292
      resource :password, only: [:new, :create, :edit, :update] do
        member do
          put :reset
        end
      end
293
      resource :preferences, only: [:show, :update]
294
      resources :keys
295
      resources :emails, only: [:index, :create, :destroy]
296
      resource :avatar, only: [:destroy]
297 298
      resource :two_factor_auth, only: [:new, :create, :destroy] do
        member do
299
          post :codes
300 301
        end
      end
302
    end
303
  end
R
Robert Speicher 已提交
304

305
  get 'u/:username/calendar' => 'users#calendar', as: :user_calendar,
306 307 308 309
      constraints: { username: /.*/ }

  get 'u/:username/calendar_activities' => 'users#calendar_activities', as: :user_calendar_activities,
      constraints: { username: /.*/ }
310

311
  get '/u/:username' => 'users#show', as: :user,
D
Douwe Maan 已提交
312
      constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }
D
Dmitriy Zaporozhets 已提交
313

R
randx 已提交
314 315 316
  #
  # Dashboard Area
  #
317 318 319 320
  resource :dashboard, controller: 'dashboard', only: [] do
    get :issues
    get :merge_requests
    get :activity
D
Douwe Maan 已提交
321 322 323

    scope module: :dashboard do
      resources :milestones, only: [:index, :show]
324

325
      resources :groups, only: [:index]
326
      resources :snippets, only: [:index]
327

328
      resources :projects, only: [:index] do
329 330 331 332
        collection do
          get :starred
        end
      end
D
Douwe Maan 已提交
333
    end
334 335

    root to: "dashboard/projects#index"
D
Dmitriy Zaporozhets 已提交
336
  end
G
gitlabhq 已提交
337

R
randx 已提交
338 339 340
  #
  # Groups Area
  #
D
Douwe Maan 已提交
341
  resources :groups, constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }  do
R
randx 已提交
342 343 344
    member do
      get :issues
      get :merge_requests
D
Dmitriy Zaporozhets 已提交
345
      get :projects
R
randx 已提交
346
    end
347

S
Steven Thonus 已提交
348
    scope module: :groups do
349
      resources :group_members, only: [:index, :create, :update, :destroy] do
350
        post :resend_invite, on: :member
351
        delete :leave, on: :collection
352
      end
353

S
Steven Thonus 已提交
354
      resource :avatar, only: [:destroy]
355
      resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :update, :new, :create]
S
Steven Thonus 已提交
356
    end
R
randx 已提交
357 358
  end

359
  resources :projects, constraints: { id: /[^\/]+/ }, only: [:index, :new, :create]
360

361
  devise_for :users, controllers: { omniauth_callbacks: :omniauth_callbacks, registrations: :registrations , passwords: :passwords, sessions: :sessions, confirmations: :confirmations }
G
gitlabhq 已提交
362

363
  devise_scope :user do
364
    get '/users/auth/:provider/omniauth_error' => 'omniauth_callbacks#omniauth_error', as: :omniauth_error
365
  end
V
Vinnie Okada 已提交
366

367
  root to: "root#index"
V
Vinnie Okada 已提交
368

369 370 371
  #
  # Project Area
  #
V
Vinnie Okada 已提交
372
  resources :namespaces, path: '/', constraints: { id: /[a-zA-Z.0-9_\-]+/ }, only: [] do
D
Douwe Maan 已提交
373
    resources(:projects, constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }, except:
V
Vinnie Okada 已提交
374 375 376
              [:new, :create, :index], path: "/") do
      member do
        put :transfer
377
        delete :remove_fork
V
Vinnie Okada 已提交
378 379 380 381 382
        post :archive
        post :unarchive
        post :toggle_star
        post :markdown_preview
        get :autocomplete_sources
383
        get :activity
S
skv 已提交
384
      end
385

V
Vinnie Okada 已提交
386 387 388 389 390 391 392 393 394
      scope module: :projects do
        # Blob routes:
        get '/new/*id', to: 'blob#new', constraints: { id: /.+/ }, as: 'new_blob'
        post '/create/*id', to: 'blob#create', constraints: { id: /.+/ }, as: 'create_blob'
        get '/edit/*id', to: 'blob#edit', constraints: { id: /.+/ }, as: 'edit_blob'
        put '/update/*id', to: 'blob#update', constraints: { id: /.+/ }, as: 'update_blob'
        post '/preview/*id', to: 'blob#preview', constraints: { id: /.+/ }, as: 'preview_blob'

        scope do
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411
          get(
            '/blob/*id/diff',
            to: 'blob#diff',
            constraints: { id: /.+/, format: false },
            as: :blob_diff
          )
          get(
            '/blob/*id',
            to: 'blob#show',
            constraints: { id: /.+/, format: false },
            as: :blob
          )
          delete(
            '/blob/*id',
            to: 'blob#destroy',
            constraints: { id: /.+/, format: false }
          )
L
liyakun 已提交
412 413 414 415 416 417 418 419 420 421
          put(
            '/blob/*id',
            to: 'blob#update',
            constraints: { id: /.+/, format: false }
          )
          post(
            '/blob/*id',
            to: 'blob#create',
            constraints: { id: /.+/, format: false }
          )
V
Vinnie Okada 已提交
422
        end
423

V
Vinnie Okada 已提交
424 425 426 427 428 429 430
        scope do
          get(
            '/raw/*id',
            to: 'raw#show',
            constraints: { id: /.+/, format: /(html|js)/ },
            as: :raw
          )
431
        end
432

V
Vinnie Okada 已提交
433 434 435 436 437 438 439 440 441
        scope do
          get(
            '/tree/*id',
            to: 'tree#show',
            constraints: { id: /.+/, format: /(html|js)/ },
            as: :tree
          )
        end

S
Stan Hu 已提交
442 443
        scope do
          post(
G
Gabriel Mazetto 已提交
444
            '/create_dir/*id',
S
Stan Hu 已提交
445 446 447 448 449 450
              to: 'tree#create_dir',
              constraints: { id: /.+/ },
              as: 'create_dir'
          )
        end

V
Vinnie Okada 已提交
451 452 453 454 455 456 457
        scope do
          get(
            '/blame/*id',
            to: 'blame#show',
            constraints: { id: /.+/, format: /(html|js)/ },
            as: :blame
          )
458
        end
D
Dmitriy Zaporozhets 已提交
459

460 461 462 463
        scope do
          get(
            '/commits/*id',
            to: 'commits#show',
D
Dmitriy Zaporozhets 已提交
464
            constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ },
465 466 467 468 469 470
            as: :commits
          )
        end

        resource  :avatar, only: [:show, :destroy]
        resources :commit, only: [:show], constraints: { id: /[[:alnum:]]{6,40}/ } do
471 472
          member do
            get :branches
K
Kamil Trzcinski 已提交
473 474 475
            get :builds
            post :cancel_builds
            post :retry_builds
476
          end
477 478 479 480 481 482
        end

        resources :compare, only: [:index, :create]
        resources :network, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ }

        resources :graphs, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ } do
V
Vinnie Okada 已提交
483 484
          member do
            get :commits
485
            get :ci
486
            get :languages
V
Vinnie Okada 已提交
487
          end
488
        end
V
Valery Sizov 已提交
489

V
Vinnie Okada 已提交
490 491
        get '/compare/:from...:to' => 'compare#show', :as => 'compare',
            :constraints => { from: /.+/, to: /.+/ }
492

V
Vinnie Okada 已提交
493 494 495 496
        resources :snippets, constraints: { id: /\d+/ } do
          member do
            get 'raw'
          end
497
        end
498

S
Stan Hu 已提交
499
        WIKI_SLUG_ID = { id: /[a-zA-Z.0-9_\-\/]+/ } unless defined? WIKI_SLUG_ID
D
Dmitriy Zaporozhets 已提交
500

S
Stan Hu 已提交
501 502 503 504 505 506 507 508 509 510 511 512
        scope do
          # Order matters to give priority to these matches
          get '/wikis/git_access', to: 'wikis#git_access'
          get '/wikis/pages', to: 'wikis#pages', as: 'wiki_pages'
          post '/wikis', to: 'wikis#create'

          get '/wikis/*id/history', to: 'wikis#history', as: 'wiki_history', constraints: WIKI_SLUG_ID
          get '/wikis/*id/edit', to: 'wikis#edit', as: 'wiki_edit', constraints: WIKI_SLUG_ID

          get '/wikis/*id', to: 'wikis#show', as: 'wiki', constraints: WIKI_SLUG_ID
          delete '/wikis/*id', to: 'wikis#destroy', constraints: WIKI_SLUG_ID
          put '/wikis/*id', to: 'wikis#update', constraints: WIKI_SLUG_ID
513
        end
514

V
Vinnie Okada 已提交
515 516 517 518 519
        resource :repository, only: [:show, :create] do
          member do
            get 'archive', constraints: { format: Gitlab::Regex.archive_formats_regex }
          end
        end
M
miks 已提交
520

V
Vinnie Okada 已提交
521 522 523 524
        resources :services, constraints: { id: /[^\/]+/ }, only: [:index, :edit, :update] do
          member do
            get :test
          end
525
        end
G
gitlabhq 已提交
526

527
        resources :deploy_keys, constraints: { id: /\d+/ }, only: [:index, :new, :create] do
V
Vinnie Okada 已提交
528 529 530 531
          member do
            put :enable
            put :disable
          end
532
        end
G
gitlabhq 已提交
533

V
Vinnie Okada 已提交
534 535 536 537 538 539 540 541 542 543 544
        resource :fork, only: [:new, :create]
        resource :import, only: [:new, :create, :show]

        resources :refs, only: [] do
          collection do
            get 'switch'
          end

          member do
            # tree viewer logs
            get 'logs_tree', constraints: { id: Gitlab::Regex.git_reference_regex }
545 546
            # Directories with leading dots erroneously get rejected if git
            # ref regex used in constraints. Regex verification now done in controller.
547
            get 'logs_tree/*path' => 'refs#logs_tree', as: :logs_file, constraints: {
548
              id: /.*/,
V
Vinnie Okada 已提交
549 550 551
              path: /.*/
            }
          end
552
        end
553

V
Vinnie Okada 已提交
554 555
        resources :merge_requests, constraints: { id: /\d+/ }, except: [:destroy] do
          member do
556
            get :commits
V
Vinnie Okada 已提交
557
            get :diffs
D
Douwe Maan 已提交
558
            get :builds
559
            get :merge_check
560
            post :merge
561
            post :cancel_merge_when_build_succeeds
V
Vinnie Okada 已提交
562
            get :ci_status
V
tests  
Valery Sizov 已提交
563
            post :toggle_subscription
V
Vinnie Okada 已提交
564 565 566 567 568 569 570
          end

          collection do
            get :branch_from
            get :branch_to
            get :update_branches
          end
571
        end
572

V
Vinnie Okada 已提交
573
        resources :branches, only: [:index, :new, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex }
574 575
        resources :tags, only: [:index, :show, :new, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex } do
          resource :release, only: [:edit, :update]
576 577
        end

V
Vinnie Okada 已提交
578
        resources :protected_branches, only: [:index, :create, :update, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex }
579
        resource :variables, only: [:show, :update]
580
        resources :triggers, only: [:index, :create, :destroy]
581

K
Kamil Trzcinski 已提交
582 583
        resources :builds, only: [:index, :show] do
          collection do
K
Kamil Trzcinski 已提交
584
            post :cancel_all
K
Kamil Trzcinski 已提交
585 586
          end

587 588
          member do
            get :status
K
Kamil Trzcinski 已提交
589
            post :cancel
K
Kamil Trzcinski 已提交
590
            get :download
591 592 593
            post :retry
          end
        end
594

V
Vinnie Okada 已提交
595 596 597 598
        resources :hooks, only: [:index, :create, :destroy], constraints: { id: /\d+/ } do
          member do
            get :test
          end
599
        end
600

601
        resources :milestones, constraints: { id: /\d+/ } do
V
Vinnie Okada 已提交
602 603 604 605
          member do
            put :sort_issues
            put :sort_merge_requests
          end
D
Dmitriy Zaporozhets 已提交
606
        end
607

V
Vinnie Okada 已提交
608 609 610 611
        resources :labels, constraints: { id: /\d+/ } do
          collection do
            post :generate
          end
612
        end
613

V
Vinnie Okada 已提交
614
        resources :issues, constraints: { id: /\d+/ }, except: [:destroy] do
V
Valery Sizov 已提交
615
          member do
V
tests  
Valery Sizov 已提交
616
            post :toggle_subscription
V
Valery Sizov 已提交
617
          end
V
Vinnie Okada 已提交
618 619 620
          collection do
            post  :bulk_update
          end
621
        end
R
Robert Speicher 已提交
622

623
        resources :project_members, except: [:new, :edit], constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ } do
V
Vinnie Okada 已提交
624 625
          collection do
            delete :leave
D
Dmitriy Zaporozhets 已提交
626

V
Vinnie Okada 已提交
627 628 629 630 631
            # Used for import team
            # from another project
            get :import
            post :apply_import
          end
632 633 634 635

          member do
            post :resend_invite
          end
636
        end
D
Dmitriy Zaporozhets 已提交
637

V
Vinnie Okada 已提交
638 639 640 641
        resources :notes, only: [:index, :create, :destroy, :update], constraints: { id: /\d+/ } do
          member do
            delete :delete_attachment
          end
V
Valery Sizov 已提交
642 643 644 645

          collection do
            post :award_toggle
          end
646
        end
647 648 649

        resources :uploads, only: [:create] do
          collection do
650
            get ":secret/:filename", action: :show, as: :show, constraints: { filename: /[^\/]+/ }
651
          end
652
        end
653

654 655 656 657 658
        resources :runners, only: [:index, :edit, :update, :destroy, :show] do
          member do
            get :resume
            get :pause
          end
K
Kamil Trzcinski 已提交
659 660 661 662

          collection do
            post :toggle_shared_runners
          end
663
        end
K
Kamil Trzcinski 已提交
664 665

        resources :runner_projects, only: [:create, :destroy]
666
      end
667
    end
G
gitlabhq 已提交
668
  end
R
Robert Speicher 已提交
669

670
  get ':id' => 'namespaces#show', constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ }
G
gitlabhq 已提交
671
end