diff options
author | Stan Hu <stanhu@gmail.com> | 2018-07-05 08:41:40 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-07-05 08:41:40 -0700 |
commit | c7198166e8790a1335de0a08bd38080873806710 (patch) | |
tree | bab8c7a348e60c6f8b5e3a0ef61312b203fd7ab2 /config | |
parent | ee22da98f0d310b341782e55331036cca9560ec5 (diff) | |
parent | f2bc0723ea6cceab355d3d1cddac1f253997dbfc (diff) | |
download | gitlab-ce-c7198166e8790a1335de0a08bd38080873806710.tar.gz |
Merge branch 'master' into sh-support-bitbucket-server-import
Diffstat (limited to 'config')
-rw-r--r-- | config/application.rb | 3 | ||||
-rw-r--r-- | config/initializers/carrierwave_monkey_patch.rb | 69 | ||||
-rw-r--r-- | config/routes/group.rb | 1 | ||||
-rw-r--r-- | config/routes/project.rb | 14 |
4 files changed, 9 insertions, 78 deletions
diff --git a/config/application.rb b/config/application.rb index d9483cd806d..97bc86b3e3a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -45,7 +45,8 @@ module Gitlab #{config.root}/app/workers/concerns #{config.root}/app/services/concerns #{config.root}/app/serializers/concerns - #{config.root}/app/finders/concerns]) + #{config.root}/app/finders/concerns + #{config.root}/app/graphql/resolvers/concerns]) config.generators.templates.push("#{config.root}/generator_templates") diff --git a/config/initializers/carrierwave_monkey_patch.rb b/config/initializers/carrierwave_monkey_patch.rb deleted file mode 100644 index 7543231cd4f..00000000000 --- a/config/initializers/carrierwave_monkey_patch.rb +++ /dev/null @@ -1,69 +0,0 @@ -# This fixes the problem https://gitlab.com/gitlab-org/gitlab-ce/issues/46182 that carrierwave eagerly loads upoloading files into memory -# There is an PR https://github.com/carrierwaveuploader/carrierwave/pull/2314 which has the identical change. -module CarrierWave - module Storage - class Fog < Abstract - class File - module MonkeyPatch - ## - # Read content of file from service - # - # === Returns - # - # [String] contents of file - def read - file_body = file.body - - return if file_body.nil? - return file_body unless file_body.is_a?(::File) - - # Fog::Storage::XXX::File#body could return the source file which was upoloaded to the remote server. - read_source_file(file_body) if ::File.exist?(file_body.path) - - # If the source file doesn't exist, the remote content is read - @file = nil # rubocop:disable Gitlab/ModuleWithInstanceVariables - file.body - end - - ## - # Write file to service - # - # === Returns - # - # [Boolean] true on success or raises error - def store(new_file) - if new_file.is_a?(self.class) # rubocop:disable Cop/LineBreakAroundConditionalBlock - new_file.copy_to(path) - else - fog_file = new_file.to_file - @content_type ||= new_file.content_type # rubocop:disable Gitlab/ModuleWithInstanceVariables - @file = directory.files.create({ # rubocop:disable Gitlab/ModuleWithInstanceVariables - :body => fog_file ? fog_file : new_file.read, # rubocop:disable Style/HashSyntax - :content_type => @content_type, # rubocop:disable Style/HashSyntax,Gitlab/ModuleWithInstanceVariables - :key => path, # rubocop:disable Style/HashSyntax - :public => @uploader.fog_public # rubocop:disable Style/HashSyntax,Gitlab/ModuleWithInstanceVariables - }.merge(@uploader.fog_attributes)) # rubocop:disable Gitlab/ModuleWithInstanceVariables - fog_file.close if fog_file && !fog_file.closed? - end - true - end - - private - - def read_source_file(file_body) - return unless ::File.exist?(file_body.path) - - begin - file_body = ::File.open(file_body.path) if file_body.closed? # Reopen if it's already closed - file_body.read - ensure - file_body.close - end - end - end - - prepend MonkeyPatch - end - end - end -end diff --git a/config/routes/group.rb b/config/routes/group.rb index b09eb3c1b5b..25fbb38ba87 100644 --- a/config/routes/group.rb +++ b/config/routes/group.rb @@ -55,6 +55,7 @@ constraints(::Constraints::GroupUrlConstrainer.new) do resources :uploads, only: [:create] do collection do get ":secret/:filename", action: :show, as: :show, constraints: { filename: %r{[^/]+} } + post :authorize end end diff --git a/config/routes/project.rb b/config/routes/project.rb index 6dfbd7ecd1f..5057e937941 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -206,14 +206,8 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do resources :clusters, except: [:edit, :create] do collection do - scope :providers do - get '/user/new', to: 'clusters/user#new' - post '/user', to: 'clusters/user#create' - - get '/gcp/new', to: 'clusters/gcp#new' - get '/gcp/login', to: 'clusters/gcp#login' - post '/gcp', to: 'clusters/gcp#create' - end + post :create_gcp + post :create_user end member do @@ -235,6 +229,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end collection do + get :metrics, action: :metrics_redirect get :folder, path: 'folders/*id', constraints: { format: /(html|json)/ } end @@ -284,6 +279,8 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do post :erase get :trace, defaults: { format: 'json' } get :raw + get :terminal + get '/terminal.ws/authorize', to: 'jobs#terminal_websocket_authorize', constraints: { format: nil } end resource :artifacts, only: [] do @@ -406,6 +403,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do resources :uploads, only: [:create] do collection do get ":secret/:filename", action: :show, as: :show, constraints: { filename: %r{[^/]+} } + post :authorize end end |