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

G
gitlabhq 已提交
4
Gitlab::Application.routes.draw do
5 6 7 8 9 10 11 12 13 14 15 16 17
  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 已提交
18 19 20 21 22 23 24 25 26 27
  namespace :ci do
    # CI API
    Ci::API::API.logger Rails.logger
    mount Ci::API::API => '/api'

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

    resources :projects do
      collection do
        post :add
K
Kamil Trzcinski 已提交
28
        get :disabled
D
Douwe Maan 已提交
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
      end

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

      resources :runner_projects, only: [:create, :destroy]
    end

    resource :user_sessions do
      get :auth
      get :callback
    end

    namespace :admin do
      resources :runners, only: [:index, :show, :update, :destroy] do
        member do
          put :assign_all
          get :resume
          get :pause
        end
      end

      resources :events, only: [:index]

      resources :projects do
        resources :runner_projects
      end

      resources :builds, only: :index

      resource :application_settings, only: [:show, :update]
    end

    root to: 'projects#index'
  end

V
Valery Sizov 已提交
68
  use_doorkeeper do
69 70 71
    controllers applications: 'oauth/applications',
                authorized_applications: 'oauth/authorized_applications',
                authorizations: 'oauth/authorizations'
V
Valery Sizov 已提交
72
  end
73

74 75 76 77 78
  # Autocomplete
  get '/autocomplete/users' => 'autocomplete#users'
  get '/autocomplete/users/:id' => 'autocomplete#user'


79
  # Search
80 81
  get 'search' => 'search#show'
  get 'search/autocomplete' => 'search#autocomplete', as: :search_autocomplete
V
Valery Sizov 已提交
82

83
  # API
84 85
  API::API.logger Rails.logger
  mount API::API => '/api'
86

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

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

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

98
  # Help
J
Job van der Voort 已提交
99
  get 'help'                  => 'help#index'
100
  get 'help/:category/:file'  => 'help#show', as: :help_page, constraints: { category: /.*/, file: /[^\/\.]+/ }
M
Marin Jankovski 已提交
101
  get 'help/shortcuts'
102
  get 'help/ui'               => 'help#ui'
103

A
Andrew8xx8 已提交
104 105 106 107 108
  #
  # Global snippets
  #
  resources :snippets do
    member do
109
      get 'raw'
A
Andrew8xx8 已提交
110 111
    end
  end
112 113

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

D
Douwe Maan 已提交
115 116 117 118 119 120 121
  #
  # Invites
  #

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

126 127 128
  # Spam reports
  resources :abuse_reports, only: [:new, :create]

V
Valery Sizov 已提交
129
  #
130
  # Import
V
Valery Sizov 已提交
131
  #
132 133
  namespace :import do
    resource :github, only: [:create, :new], controller: :github do
V
Valery Sizov 已提交
134 135 136 137 138
      get :status
      get :callback
      get :jobs
    end

139
    resource :gitlab, only: [:create, :new], controller: :gitlab do
V
Valery Sizov 已提交
140 141 142 143
      get :status
      get :callback
      get :jobs
    end
M
Marcin Kulik 已提交
144

D
Douwe Maan 已提交
145 146 147 148 149
    resource :bitbucket, only: [:create, :new], controller: :bitbucket do
      get :status
      get :callback
      get :jobs
    end
150

M
Marcin Kulik 已提交
151 152 153 154 155
    resource :gitorious, only: [:create, :new], controller: :gitorious do
      get :status
      get :callback
      get :jobs
    end
156 157 158 159 160

    resource :google_code, only: [:create, :new], controller: :google_code do
      get :status
      post :callback
      get :jobs
D
Douwe Maan 已提交
161 162 163

      get   :new_user_map,    path: :user_map
      post  :create_user_map, path: :user_map
164
    end
J
Jared Szechy 已提交
165 166 167 168 169 170 171 172 173

    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 已提交
174
  end
M
Marin Jankovski 已提交
175

176 177 178
  #
  # Uploads
  #
M
Marin Jankovski 已提交
179

180 181
  scope path: :uploads do
    # Note attachments and User/Group/Project avatars
182 183
    get ":model/:mounted_as/:id/:filename",
        to:           "uploads#show",
184
        constraints:  { model: /note|user|group|project/, mounted_as: /avatar|attachment/, filename: /[^\/]+/ }
185 186

    # Project markdown uploads
187
    get ":namespace_id/:project_id/:secret/:filename",
188
      to:           "projects/uploads#show",
189
      constraints:  { namespace_id: /[a-zA-Z.0-9_\-]+/, project_id: /[a-zA-Z.0-9_\-]+/, filename: /[^\/]+/ }
190
  end
V
Valery Sizov 已提交
191

192
  # Redirect old note attachments path to new uploads path.
193 194
  get "files/note/:id/:filename",
    to:           redirect("uploads/note/attachment/%{id}/%{filename}"),
195
    constraints:  { filename: /[^\/]+/ }
196

197
  #
Y
Yatish Mehta 已提交
198
  # Explore area
199
  #
D
Dmitriy Zaporozhets 已提交
200 201 202 203
  namespace :explore do
    resources :projects, only: [:index] do
      collection do
        get :trending
204
        get :starred
D
Dmitriy Zaporozhets 已提交
205 206 207
      end
    end

208
    resources :groups, only: [:index]
209
    resources :snippets, only: [:index]
210
    root to: 'projects#trending'
211 212
  end

D
Dmitriy Zaporozhets 已提交
213
  # Compatibility with old routing
214 215
  get 'public' => 'explore/projects#index'
  get 'public/projects' => 'explore/projects#index'
D
Dmitriy Zaporozhets 已提交
216

217 218 219
  #
  # Admin Area
  #
N
Nihad Abbasov 已提交
220
  namespace :admin do
221
    resources :users, constraints: { id: /[a-zA-Z.\/0-9_\-]+/ } do
222
      resources :keys, only: [:show, :destroy]
223
      resources :identities, only: [:index, :edit, :update, :destroy]
224

225 226
      delete 'stop_impersonation' => 'impersonation#destroy', on: :collection

227
      member do
D
Dmitriy Zaporozhets 已提交
228 229 230
        get :projects
        get :keys
        get :groups
D
Dmitriy Zaporozhets 已提交
231
        put :team_update
232 233
        put :block
        put :unblock
234
        put :unlock
235
        put :confirm
236
        post 'impersonate' => 'impersonation#create'
237
        patch :disable_two_factor
238
        delete 'remove/:email_id', action: 'remove_email', as: 'remove_email'
D
Dmitriy Zaporozhets 已提交
239 240
      end
    end
A
Andrey Kumanyaev 已提交
241

242
    resources :abuse_reports, only: [:index, :destroy]
V
Valery Sizov 已提交
243 244
    resources :applications

245 246
    resources :groups, constraints: { id: /[^\/]+/ } do
      member do
247
        put :members_update
248
      end
A
Andrey Kumanyaev 已提交
249
    end
A
Andrey Kumanyaev 已提交
250

251
    resources :deploy_keys, only: [:index, :new, :create, :destroy]
252

R
Robert Speicher 已提交
253
    resources :hooks, only: [:index, :create, :destroy] do
V
Valeriy Sizov 已提交
254 255
      get :test
    end
A
Andrey Kumanyaev 已提交
256

257
    resources :broadcast_messages, only: [:index, :create, :destroy]
258
    resource :logs, only: [:show]
259
    resource :background_jobs, controller: 'background_jobs', only: [:show]
260

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

264 265
      resources(:projects,
                path: '/',
V
Vinnie Okada 已提交
266 267 268 269 270 271 272
                constraints: { id: /[a-zA-Z.0-9_\-]+/ },
                only: [:index, :show]) do
        root to: 'projects#show'

        member do
          put :transfer
        end
273 274 275
      end
    end

M
Marin Jankovski 已提交
276 277 278
    resource :application_settings, only: [:show, :update] do
      resources :services
    end
279

V
Valery Sizov 已提交
280 281
    resources :labels

282
    root to: 'dashboard#index'
G
gitlabhq 已提交
283 284
  end

R
randx 已提交
285 286 287
  #
  # Profile Area
  #
288 289
  resource :profile, only: [:show, :update] do
    member do
V
Valery Sizov 已提交
290
      get :audit_log
D
Dmitriy Zaporozhets 已提交
291
      get :applications
292 293 294 295

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

297
    scope module: :profiles do
298 299 300 301 302
      resource :account, only: [:show, :update] do
        member do
          delete :unlink
        end
      end
303
      resource :notifications, only: [:show, :update]
304 305 306 307 308
      resource :password, only: [:new, :create, :edit, :update] do
        member do
          put :reset
        end
      end
309
      resource :preferences, only: [:show, :update]
310
      resources :keys
311
      resources :emails, only: [:index, :create, :destroy]
312
      resource :avatar, only: [:destroy]
313 314
      resource :two_factor_auth, only: [:new, :create, :destroy] do
        member do
315
          post :codes
316 317
        end
      end
318
    end
319
  end
R
Robert Speicher 已提交
320

321
  get 'u/:username/calendar' => 'users#calendar', as: :user_calendar,
322 323 324 325
      constraints: { username: /.*/ }

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

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

R
randx 已提交
330 331 332
  #
  # Dashboard Area
  #
333 334 335 336
  resource :dashboard, controller: 'dashboard', only: [] do
    get :issues
    get :merge_requests
    get :activity
D
Douwe Maan 已提交
337 338 339

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

341
      resources :groups, only: [:index]
342
      resources :snippets, only: [:index]
343

344
      resources :projects, only: [:index] do
345 346 347 348
        collection do
          get :starred
        end
      end
D
Douwe Maan 已提交
349
    end
350 351

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

R
randx 已提交
354 355 356
  #
  # Groups Area
  #
D
Douwe Maan 已提交
357
  resources :groups, constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }  do
R
randx 已提交
358 359 360
    member do
      get :issues
      get :merge_requests
D
Dmitriy Zaporozhets 已提交
361
      get :projects
R
randx 已提交
362
    end
363

S
Steven Thonus 已提交
364
    scope module: :groups do
365
      resources :group_members, only: [:index, :create, :update, :destroy] do
366
        post :resend_invite, on: :member
367
        delete :leave, on: :collection
368
      end
369

S
Steven Thonus 已提交
370
      resource :avatar, only: [:destroy]
371
      resources :milestones, only: [:index, :show, :update, :new, :create]
S
Steven Thonus 已提交
372
    end
R
randx 已提交
373 374
  end

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

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

379
  devise_scope :user do
380
    get '/users/auth/:provider/omniauth_error' => 'omniauth_callbacks#omniauth_error', as: :omniauth_error
381
  end
V
Vinnie Okada 已提交
382

383
  root to: "root#index"
V
Vinnie Okada 已提交
384

385 386 387
  #
  # Project Area
  #
V
Vinnie Okada 已提交
388
  resources :namespaces, path: '/', constraints: { id: /[a-zA-Z.0-9_\-]+/ }, only: [] do
D
Douwe Maan 已提交
389
    resources(:projects, constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }, except:
V
Vinnie Okada 已提交
390 391 392
              [:new, :create, :index], path: "/") do
      member do
        put :transfer
393
        delete :remove_fork
V
Vinnie Okada 已提交
394 395 396 397 398
        post :archive
        post :unarchive
        post :toggle_star
        post :markdown_preview
        get :autocomplete_sources
399
        get :activity
S
skv 已提交
400
      end
401

V
Vinnie Okada 已提交
402 403 404 405 406 407 408 409 410
      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
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427
          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 已提交
428 429 430 431 432 433 434 435 436 437
          put(
            '/blob/*id',
            to: 'blob#update',
            constraints: { id: /.+/, format: false }
          )
          post(
            '/blob/*id',
            to: 'blob#create',
            constraints: { id: /.+/, format: false }
          )
V
Vinnie Okada 已提交
438
        end
439

V
Vinnie Okada 已提交
440 441 442 443 444 445 446
        scope do
          get(
            '/raw/*id',
            to: 'raw#show',
            constraints: { id: /.+/, format: /(html|js)/ },
            as: :raw
          )
447
        end
448

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

S
Stan Hu 已提交
458 459 460 461 462 463 464 465 466
        scope do
          post(
              '/create_dir/*id',
              to: 'tree#create_dir',
              constraints: { id: /.+/ },
              as: 'create_dir'
          )
        end

V
Vinnie Okada 已提交
467 468 469 470 471 472 473
        scope do
          get(
            '/blame/*id',
            to: 'blame#show',
            constraints: { id: /.+/, format: /(html|js)/ },
            as: :blame
          )
474
        end
D
Dmitriy Zaporozhets 已提交
475

476 477 478 479
        scope do
          get(
            '/commits/*id',
            to: 'commits#show',
D
Dmitriy Zaporozhets 已提交
480
            constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ },
481 482 483 484 485 486
            as: :commits
          )
        end

        resource  :avatar, only: [:show, :destroy]
        resources :commit, only: [:show], constraints: { id: /[[:alnum:]]{6,40}/ } do
487 488
          member do
            get :branches
K
Kamil Trzcinski 已提交
489 490 491
            get :builds
            post :cancel_builds
            post :retry_builds
492
          end
493 494 495 496 497 498
        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 已提交
499 500
          member do
            get :commits
501
            get :ci
V
Vinnie Okada 已提交
502
          end
503
        end
V
Valery Sizov 已提交
504

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

V
Vinnie Okada 已提交
508 509 510 511
        resources :snippets, constraints: { id: /\d+/ } do
          member do
            get 'raw'
          end
512
        end
513

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

S
Stan Hu 已提交
516 517 518 519 520 521 522 523 524 525 526 527
        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
528
        end
529

V
Vinnie Okada 已提交
530 531 532 533 534
        resource :repository, only: [:show, :create] do
          member do
            get 'archive', constraints: { format: Gitlab::Regex.archive_formats_regex }
          end
        end
M
miks 已提交
535

V
Vinnie Okada 已提交
536 537 538 539
        resources :services, constraints: { id: /[^\/]+/ }, only: [:index, :edit, :update] do
          member do
            get :test
          end
540
        end
G
gitlabhq 已提交
541

542
        resources :deploy_keys, constraints: { id: /\d+/ }, only: [:index, :new, :create] do
V
Vinnie Okada 已提交
543 544 545 546
          member do
            put :enable
            put :disable
          end
547
        end
G
gitlabhq 已提交
548

V
Vinnie Okada 已提交
549 550 551 552 553 554 555 556 557 558 559
        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 }
560 561
            # Directories with leading dots erroneously get rejected if git
            # ref regex used in constraints. Regex verification now done in controller.
562
            get 'logs_tree/*path' => 'refs#logs_tree', as: :logs_file, constraints: {
563
              id: /.*/,
V
Vinnie Okada 已提交
564 565 566
              path: /.*/
            }
          end
567
        end
568

V
Vinnie Okada 已提交
569 570 571
        resources :merge_requests, constraints: { id: /\d+/ }, except: [:destroy] do
          member do
            get :diffs
572
            get :commits
573 574
            post :merge
            get :merge_check
V
Vinnie Okada 已提交
575
            get :ci_status
V
tests  
Valery Sizov 已提交
576
            post :toggle_subscription
V
Vinnie Okada 已提交
577 578 579 580 581 582 583
          end

          collection do
            get :branch_from
            get :branch_to
            get :update_branches
          end
584
        end
585

V
Vinnie Okada 已提交
586
        resources :branches, only: [:index, :new, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex }
587 588
        resources :tags, only: [:index, :show, :new, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex } do
          resource :release, only: [:edit, :update]
589 590
        end

V
Vinnie Okada 已提交
591
        resources :protected_branches, only: [:index, :create, :update, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex }
592
        resource :variables, only: [:show, :update]
593
        resources :triggers, only: [:index, :create, :destroy]
594
        resource :ci_settings, only: [:edit, :update, :destroy]
595 596 597 598 599
        resources :ci_web_hooks, only: [:index, :create, :destroy] do
          member do
            get :test
          end
        end
V
Vinnie Okada 已提交
600

601 602 603 604 605 606
        resources :ci_services, constraints: { id: /[^\/]+/ }, only: [:index, :edit, :update] do
          member do
            get :test
          end
        end

K
Kamil Trzcinski 已提交
607 608
        resources :builds, only: [:index, :show] do
          collection do
K
Kamil Trzcinski 已提交
609
            post :cancel_all
K
Kamil Trzcinski 已提交
610 611
          end

612 613
          member do
            get :status
K
Kamil Trzcinski 已提交
614
            post :cancel
K
Kamil Trzcinski 已提交
615
            get :download
616 617 618
            post :retry
          end
        end
619

V
Vinnie Okada 已提交
620 621 622 623
        resources :hooks, only: [:index, :create, :destroy], constraints: { id: /\d+/ } do
          member do
            get :test
          end
624
        end
625

626
        resources :milestones, constraints: { id: /\d+/ } do
V
Vinnie Okada 已提交
627 628 629 630
          member do
            put :sort_issues
            put :sort_merge_requests
          end
D
Dmitriy Zaporozhets 已提交
631
        end
632

V
Vinnie Okada 已提交
633 634 635 636
        resources :labels, constraints: { id: /\d+/ } do
          collection do
            post :generate
          end
637
        end
638

V
Vinnie Okada 已提交
639
        resources :issues, constraints: { id: /\d+/ }, except: [:destroy] do
V
Valery Sizov 已提交
640
          member do
V
tests  
Valery Sizov 已提交
641
            post :toggle_subscription
V
Valery Sizov 已提交
642
          end
V
Vinnie Okada 已提交
643 644 645
          collection do
            post  :bulk_update
          end
646
        end
R
Robert Speicher 已提交
647

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

V
Vinnie Okada 已提交
652 653 654 655 656
            # Used for import team
            # from another project
            get :import
            post :apply_import
          end
657 658 659 660

          member do
            post :resend_invite
          end
661
        end
D
Dmitriy Zaporozhets 已提交
662

J
Jason Lee 已提交
663
        resources :notes, constraints: { id: /\d+/ } do
V
Vinnie Okada 已提交
664 665 666
          member do
            delete :delete_attachment
          end
667
        end
668 669 670

        resources :uploads, only: [:create] do
          collection do
671
            get ":secret/:filename", action: :show, as: :show, constraints: { filename: /[^\/]+/ }
672
          end
673
        end
674

675 676 677 678 679 680 681
        resources :runners, only: [:index, :edit, :update, :destroy, :show] do
          member do
            get :resume
            get :pause
          end
        end
      end
682
    end
G
gitlabhq 已提交
683
  end
R
Robert Speicher 已提交
684

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