routes.rb 18.4 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
  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 已提交
29
        get :disabled
D
Douwe Maan 已提交
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
      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 已提交
69
  use_doorkeeper do
70 71 72
    controllers applications: 'oauth/applications',
                authorized_applications: 'oauth/authorized_applications',
                authorizations: 'oauth/authorizations'
V
Valery Sizov 已提交
73
  end
74

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        member do
          put :transfer
        end
274 275 276
      end
    end

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

V
Valery Sizov 已提交
281 282
    resources :labels

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

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

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

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

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

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

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

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

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

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

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

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

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

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

S
Steven Thonus 已提交
371
      resource :avatar, only: [:destroy]
372
      resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :update, :new, :create]
S
Steven Thonus 已提交
373
    end
R
randx 已提交
374 375
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

664
        resources :notes, only: [:index, :create, :destroy, :update], constraints: { id: /\d+/ } do
V
Vinnie Okada 已提交
665 666 667
          member do
            delete :delete_attachment
          end
V
Valery Sizov 已提交
668 669 670 671

          collection do
            post :award_toggle
          end
672
        end
673 674 675

        resources :uploads, only: [:create] do
          collection do
676
            get ":secret/:filename", action: :show, as: :show, constraints: { filename: /[^\/]+/ }
677
          end
678
        end
679

680 681 682 683 684 685 686
        resources :runners, only: [:index, :edit, :update, :destroy, :show] do
          member do
            get :resume
            get :pause
          end
        end
      end
687
    end
G
gitlabhq 已提交
688
  end
R
Robert Speicher 已提交
689

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