routes.rb 18.7 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

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

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

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

A
Andrew8xx8 已提交
69 70 71 72 73
  #
  # Global snippets
  #
  resources :snippets do
    member do
74
      get 'raw'
A
Andrew8xx8 已提交
75 76
    end
  end
77 78

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

D
Douwe Maan 已提交
80 81 82 83 84 85 86
  #
  # Invites
  #

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

91
  resources :sent_notifications, only: [], constraints: { id: /\h{32}/ } do
92 93 94 95 96
    member do
      get :unsubscribe
    end
  end

97 98 99
  # Spam reports
  resources :abuse_reports, only: [:new, :create]

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

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

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

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

    resource :google_code, only: [:create, :new], controller: :google_code do
      get :status
      post :callback
      get :jobs
D
Douwe Maan 已提交
132 133 134

      get   :new_user_map,    path: :user_map
      post  :create_user_map, path: :user_map
135
    end
J
Jared Szechy 已提交
136 137 138 139 140 141 142 143 144

    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 已提交
145
  end
M
Marin Jankovski 已提交
146

147 148 149
  #
  # Uploads
  #
M
Marin Jankovski 已提交
150

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

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

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

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

179
    resources :groups, only: [:index]
180
    resources :snippets, only: [:index]
181
    root to: 'projects#trending'
182 183
  end

D
Dmitriy Zaporozhets 已提交
184
  # Compatibility with old routing
185 186
  get 'public' => 'explore/projects#index'
  get 'public/projects' => 'explore/projects#index'
D
Dmitriy Zaporozhets 已提交
187

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

196
      delete 'stop_impersonation' => 'impersonation#destroy', on: :collection
197

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

213
    resources :abuse_reports, only: [:index, :destroy]
214 215
    resources :spam_logs, only: [:index, :destroy]

V
Valery Sizov 已提交
216 217
    resources :applications

218 219
    resources :groups, constraints: { id: /[^\/]+/ } do
      member do
220
        put :members_update
221
      end
A
Andrey Kumanyaev 已提交
222
    end
A
Andrey Kumanyaev 已提交
223

224
    resources :deploy_keys, only: [:index, :new, :create, :destroy]
225

R
Robert Speicher 已提交
226
    resources :hooks, only: [:index, :create, :destroy] do
V
Valeriy Sizov 已提交
227 228
      get :test
    end
A
Andrey Kumanyaev 已提交
229

230
    resources :broadcast_messages, only: [:index, :edit, :create, :update, :destroy]
231
    resource :logs, only: [:show]
232
    resource :background_jobs, controller: 'background_jobs', only: [:show]
233

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

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

        member do
          put :transfer
        end
K
Kamil Trzcinski 已提交
246 247

        resources :runner_projects
248 249 250
      end
    end

M
Marin Jankovski 已提交
251 252
    resource :application_settings, only: [:show, :update] do
      resources :services
253
      put :reset_runners_token
M
Marin Jankovski 已提交
254
    end
255

V
Valery Sizov 已提交
256 257
    resources :labels

K
Kamil Trzcinski 已提交
258 259 260 261 262 263 264 265 266 267 268 269 270
    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

271
    root to: 'dashboard#index'
G
gitlabhq 已提交
272 273
  end

R
randx 已提交
274 275 276
  #
  # Profile Area
  #
277 278
  resource :profile, only: [:show, :update] do
    member do
V
Valery Sizov 已提交
279
      get :audit_log
D
Dmitriy Zaporozhets 已提交
280
      get :applications
281 282 283 284

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

286
    scope module: :profiles do
287 288 289 290 291
      resource :account, only: [:show, :update] do
        member do
          delete :unlink
        end
      end
292
      resource :notifications, only: [:show, :update]
293 294 295 296 297
      resource :password, only: [:new, :create, :edit, :update] do
        member do
          put :reset
        end
      end
298
      resource :preferences, only: [:show, :update]
299
      resources :keys
300
      resources :emails, only: [:index, :create, :destroy]
301
      resource :avatar, only: [:destroy]
302 303
      resource :two_factor_auth, only: [:new, :create, :destroy] do
        member do
304
          post :codes
G
Gabriel Mazetto 已提交
305
          patch :skip
306 307
        end
      end
308
    end
309
  end
R
Robert Speicher 已提交
310

311
  get 'u/:username/calendar' => 'users#calendar', as: :user_calendar,
312 313 314 315
      constraints: { username: /.*/ }

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

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

R
randx 已提交
320 321 322
  #
  # Dashboard Area
  #
323 324 325 326
  resource :dashboard, controller: 'dashboard', only: [] do
    get :issues
    get :merge_requests
    get :activity
D
Douwe Maan 已提交
327 328 329

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

331
      resources :groups, only: [:index]
332
      resources :snippets, only: [:index]
333

334
      resources :projects, only: [:index] do
335 336 337 338
        collection do
          get :starred
        end
      end
D
Douwe Maan 已提交
339
    end
340 341

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

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

S
Steven Thonus 已提交
354
    scope module: :groups do
355
      resources :group_members, only: [:index, :create, :update, :destroy] do
356
        post :resend_invite, on: :member
357
        delete :leave, on: :collection
358
      end
359

S
Steven Thonus 已提交
360
      resource :avatar, only: [:destroy]
361
      resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :update, :new, :create]
S
Steven Thonus 已提交
362
    end
R
randx 已提交
363 364
  end

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

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

369
  devise_scope :user do
370
    get '/users/auth/:provider/omniauth_error' => 'omniauth_callbacks#omniauth_error', as: :omniauth_error
371
  end
V
Vinnie Okada 已提交
372

373
  root to: "root#index"
V
Vinnie Okada 已提交
374

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

V
Vinnie Okada 已提交
393 394 395 396 397 398 399 400 401
      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
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418
          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 已提交
419 420 421 422 423 424 425 426 427 428
          put(
            '/blob/*id',
            to: 'blob#update',
            constraints: { id: /.+/, format: false }
          )
          post(
            '/blob/*id',
            to: 'blob#create',
            constraints: { id: /.+/, format: false }
          )
V
Vinnie Okada 已提交
429
        end
430

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

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

449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466
        scope do
          get(
            '/find_file/*id',
            to: 'find_file#show',
            constraints: { id: /.+/, format: /html/ },
            as: :find_file
          )
        end

        scope do
          get(
            '/files/*id',
            to: 'find_file#list',
            constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ },
            as: :files
          )
        end

S
Stan Hu 已提交
467 468
        scope do
          post(
G
Gabriel Mazetto 已提交
469
            '/create_dir/*id',
S
Stan Hu 已提交
470 471 472 473 474 475
              to: 'tree#create_dir',
              constraints: { id: /.+/ },
              as: 'create_dir'
          )
        end

V
Vinnie Okada 已提交
476 477 478 479 480 481 482
        scope do
          get(
            '/blame/*id',
            to: 'blame#show',
            constraints: { id: /.+/, format: /(html|js)/ },
            as: :blame
          )
483
        end
D
Dmitriy Zaporozhets 已提交
484

485 486 487 488
        scope do
          get(
            '/commits/*id',
            to: 'commits#show',
D
Dmitriy Zaporozhets 已提交
489
            constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ },
490 491 492 493 494
            as: :commits
          )
        end

        resource  :avatar, only: [:show, :destroy]
495
        resources :commit, only: [:show], constraints: { id: /\h{7,40}/ } do
496 497
          member do
            get :branches
K
Kamil Trzcinski 已提交
498 499 500
            get :builds
            post :cancel_builds
            post :retry_builds
501
          end
502 503 504 505 506 507
        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 已提交
508 509
          member do
            get :commits
510
            get :ci
511
            get :languages
V
Vinnie Okada 已提交
512
          end
513
        end
V
Valery Sizov 已提交
514

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

V
Vinnie Okada 已提交
518 519 520 521
        resources :snippets, constraints: { id: /\d+/ } do
          member do
            get 'raw'
          end
522
        end
523

524
        WIKI_SLUG_ID = { id: /\S+/ } unless defined? WIKI_SLUG_ID
D
Dmitriy Zaporozhets 已提交
525

S
Stan Hu 已提交
526 527 528 529 530 531 532 533 534 535 536 537
        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
538
        end
539

V
Vinnie Okada 已提交
540 541 542 543 544
        resource :repository, only: [:show, :create] do
          member do
            get 'archive', constraints: { format: Gitlab::Regex.archive_formats_regex }
          end
        end
M
miks 已提交
545

V
Vinnie Okada 已提交
546 547 548 549
        resources :services, constraints: { id: /[^\/]+/ }, only: [:index, :edit, :update] do
          member do
            get :test
          end
550
        end
G
gitlabhq 已提交
551

552
        resources :deploy_keys, constraints: { id: /\d+/ }, only: [:index, :new, :create] do
V
Vinnie Okada 已提交
553 554 555 556
          member do
            put :enable
            put :disable
          end
557
        end
G
gitlabhq 已提交
558

559
        resources :forks, only: [:index, :new, :create]
V
Vinnie Okada 已提交
560 561 562 563 564 565 566 567 568 569
        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 }
570 571
            # Directories with leading dots erroneously get rejected if git
            # ref regex used in constraints. Regex verification now done in controller.
572
            get 'logs_tree/*path' => 'refs#logs_tree', as: :logs_file, constraints: {
573
              id: /.*/,
V
Vinnie Okada 已提交
574 575 576
              path: /.*/
            }
          end
577
        end
578

V
Vinnie Okada 已提交
579 580
        resources :merge_requests, constraints: { id: /\d+/ }, except: [:destroy] do
          member do
581
            get :commits
V
Vinnie Okada 已提交
582
            get :diffs
D
Douwe Maan 已提交
583
            get :builds
584 585
            get :merge_check
            post :merge
586
            post :cancel_merge_when_build_succeeds
V
Vinnie Okada 已提交
587
            get :ci_status
V
tests  
Valery Sizov 已提交
588
            post :toggle_subscription
V
Vinnie Okada 已提交
589 590 591 592 593 594 595
          end

          collection do
            get :branch_from
            get :branch_to
            get :update_branches
          end
596
        end
597

V
Vinnie Okada 已提交
598
        resources :branches, only: [:index, :new, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex }
599 600
        resources :tags, only: [:index, :show, :new, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex } do
          resource :release, only: [:edit, :update]
601 602
        end

V
Vinnie Okada 已提交
603
        resources :protected_branches, only: [:index, :create, :update, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex }
604
        resource :variables, only: [:show, :update]
605
        resources :triggers, only: [:index, :create, :destroy]
606

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
614
            post :cancel
615 616
            post :retry
          end
617

618 619
          resource :artifacts, only: [] do
            get :download
620 621
            get :browse, path: 'browse(/*path)', format: false
            get :file, path: 'file/*path', format: false
622
          end
623
        end
624

V
Vinnie Okada 已提交
625 626 627 628
        resources :hooks, only: [:index, :create, :destroy], constraints: { id: /\d+/ } do
          member do
            get :test
          end
629
        end
630

631
        resources :milestones, constraints: { id: /\d+/ } do
V
Vinnie Okada 已提交
632 633 634 635
          member do
            put :sort_issues
            put :sort_merge_requests
          end
D
Dmitriy Zaporozhets 已提交
636
        end
637

V
Vinnie Okada 已提交
638 639 640 641
        resources :labels, constraints: { id: /\d+/ } do
          collection do
            post :generate
          end
642
        end
643

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

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

V
Vinnie Okada 已提交
657 658 659 660 661
            # Used for import team
            # from another project
            get :import
            post :apply_import
          end
662 663 664 665

          member do
            post :resend_invite
          end
666
        end
D
Dmitriy Zaporozhets 已提交
667

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

          collection do
            post :award_toggle
          end
676
        end
677 678 679

        resources :uploads, only: [:create] do
          collection do
680
            get ":secret/:filename", action: :show, as: :show, constraints: { filename: /[^\/]+/ }
681
          end
682
        end
683

684 685 686 687 688
        resources :runners, only: [:index, :edit, :update, :destroy, :show] do
          member do
            get :resume
            get :pause
          end
K
Kamil Trzcinski 已提交
689 690 691 692

          collection do
            post :toggle_shared_runners
          end
693
        end
K
Kamil Trzcinski 已提交
694 695

        resources :runner_projects, only: [:create, :destroy]
696
      end
697
    end
G
gitlabhq 已提交
698
  end
R
Robert Speicher 已提交
699

700 701 702
  # Get all keys of user
  get ':username.keys' => 'profiles/keys#get_keys' , constraints: { username: /.*/ }

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