routes.rb 18.5 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 92 93
  # Spam reports
  resources :abuse_reports, only: [:new, :create]

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

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

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

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

    resource :google_code, only: [:create, :new], controller: :google_code do
      get :status
      post :callback
      get :jobs
D
Douwe Maan 已提交
126 127 128

      get   :new_user_map,    path: :user_map
      post  :create_user_map, path: :user_map
129
    end
J
Jared Szechy 已提交
130 131 132 133 134 135 136 137 138

    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 已提交
139
  end
M
Marin Jankovski 已提交
140

141 142 143
  #
  # Uploads
  #
M
Marin Jankovski 已提交
144

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

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

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

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

173
    resources :groups, only: [:index]
174
    resources :snippets, only: [:index]
175
    root to: 'projects#trending'
176 177
  end

D
Dmitriy Zaporozhets 已提交
178
  # Compatibility with old routing
179 180
  get 'public' => 'explore/projects#index'
  get 'public/projects' => 'explore/projects#index'
D
Dmitriy Zaporozhets 已提交
181

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

190
      delete 'stop_impersonation' => 'impersonation#destroy', on: :collection
191

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

207
    resources :abuse_reports, only: [:index, :destroy]
V
Valery Sizov 已提交
208 209
    resources :applications

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

216
    resources :deploy_keys, only: [:index, :new, :create, :destroy]
217

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

222
    resources :broadcast_messages, only: [:index, :edit, :create, :update, :destroy]
223
    resource :logs, only: [:show]
224
    resource :background_jobs, controller: 'background_jobs', only: [:show]
225

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

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

        member do
          put :transfer
        end
K
Kamil Trzcinski 已提交
238 239

        resources :runner_projects
240 241 242
      end
    end

M
Marin Jankovski 已提交
243 244
    resource :application_settings, only: [:show, :update] do
      resources :services
245
      put :reset_runners_token
M
Marin Jankovski 已提交
246
    end
247

V
Valery Sizov 已提交
248 249
    resources :labels

K
Kamil Trzcinski 已提交
250 251 252 253 254 255 256 257 258 259 260 261 262
    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

263
    root to: 'dashboard#index'
G
gitlabhq 已提交
264 265
  end

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

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

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

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

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

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

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

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

323
      resources :groups, only: [:index]
324
      resources :snippets, only: [:index]
325

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

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

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

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

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

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

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

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

365
  root to: "root#index"
V
Vinnie Okada 已提交
366

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

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

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

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

441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458
        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 已提交
459 460
        scope do
          post(
G
Gabriel Mazetto 已提交
461
            '/create_dir/*id',
S
Stan Hu 已提交
462 463 464 465 466 467
              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
503
            get :languages
V
Vinnie Okada 已提交
504
          end
505
        end
V
Valery Sizov 已提交
506

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

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

516
        WIKI_SLUG_ID = { id: /[\S]+/ } unless defined? WIKI_SLUG_ID
D
Dmitriy Zaporozhets 已提交
517

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

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

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

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

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

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

          collection do
            get :branch_from
            get :branch_to
            get :update_branches
          end
588
        end
589

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

V
Vinnie Okada 已提交
595
        resources :protected_branches, only: [:index, :create, :update, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex }
596
        resource :variables, only: [:show, :update]
597
        resources :triggers, only: [:index, :create, :destroy]
598

K
Kamil Trzcinski 已提交
599 600
        resources :builds, only: [:index, :show] do
          collection do
K
Kamil Trzcinski 已提交
601
            post :cancel_all
K
Kamil Trzcinski 已提交
602 603
          end

604 605
          member do
            get :status
606
            post :cancel
607 608
            post :retry
          end
609

610 611
          resource :artifacts, only: [] do
            get :download
612 613
            get :browse, path: 'browse(/*path)', format: false
            get :file, path: 'file/*path', format: false
614
          end
615
        end
616

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

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

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

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

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

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

          member do
            post :resend_invite
          end
658
        end
D
Dmitriy Zaporozhets 已提交
659

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

          collection do
            post :award_toggle
          end
668
        end
669 670 671

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

676 677 678 679 680
        resources :runners, only: [:index, :edit, :update, :destroy, :show] do
          member do
            get :resume
            get :pause
          end
K
Kamil Trzcinski 已提交
681 682 683 684

          collection do
            post :toggle_shared_runners
          end
685
        end
K
Kamil Trzcinski 已提交
686 687

        resources :runner_projects, only: [:create, :destroy]
688
      end
689
    end
G
gitlabhq 已提交
690
  end
R
Robert Speicher 已提交
691

692 693 694
  # Get all keys of user
  get ':username.keys' => 'profiles/keys#get_keys' , constraints: { username: /.*/ }

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