diff options
author | Stan Hu <stanhu@gmail.com> | 2018-07-25 05:12:24 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-07-25 05:12:24 -0700 |
commit | 537f87a169576544b26347b5b3a6ab22d2cbfc00 (patch) | |
tree | 58cb66cf9639ef46acc4927fef0b4e0a84269568 /config | |
parent | f94b52256d1bedfe6b01ef31f0bed0615b10d918 (diff) | |
parent | d22db4f492d5ae676bea6bc699203d2fc120fe96 (diff) | |
download | gitlab-ce-537f87a169576544b26347b5b3a6ab22d2cbfc00.tar.gz |
Merge branch 'master' into sh-support-bitbucket-server-import
Diffstat (limited to 'config')
-rw-r--r-- | config/gitlab.yml.example | 16 | ||||
-rw-r--r-- | config/initializers/1_settings.rb | 29 | ||||
-rw-r--r-- | config/initializers/8_metrics.rb | 16 | ||||
-rw-r--r-- | config/initializers/devise.rb | 2 | ||||
-rw-r--r-- | config/initializers/omniauth.rb | 5 | ||||
-rw-r--r-- | config/object_store_settings.rb | 15 |
6 files changed, 29 insertions, 54 deletions
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index ab109f5d04f..561ff57c9fb 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -78,15 +78,15 @@ production: &base # username_changing_enabled: false # default: true - User can change her username/namespace ## Default theme ID ## 1 - Indigo - ## 2 - Light Indigo - ## 3 - Blue - ## 4 - Light Blue + ## 2 - Dark + ## 3 - Light + ## 4 - Blue ## 5 - Green - ## 6 - Light Green - ## 7 - Red - ## 8 - Light Red - ## 9 - Dark - ## 10 - Light + ## 6 - Light Indigo + ## 7 - Light Blue + ## 8 - Light Green + ## 9 - Red + ## 10 - Light Red # default_theme: 1 # default: 1 ## Automatic issue closing diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index c3122827a6b..9ad55e21d11 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -1,4 +1,5 @@ require_relative '../settings' +require_relative '../object_store_settings' # Default settings Settings['ldap'] ||= Settingslogic.new({}) @@ -179,14 +180,7 @@ Settings.artifacts['storage_path'] = Settings.absolute(Settings.artifacts.values # Settings.artifact['path'] is deprecated, use `storage_path` instead Settings.artifacts['path'] = Settings.artifacts['storage_path'] Settings.artifacts['max_size'] ||= 100 # in megabytes -Settings.artifacts['object_store'] ||= Settingslogic.new({}) -Settings.artifacts['object_store']['enabled'] = false if Settings.artifacts['object_store']['enabled'].nil? -Settings.artifacts['object_store']['remote_directory'] ||= nil -Settings.artifacts['object_store']['direct_upload'] = false if Settings.artifacts['object_store']['direct_upload'].nil? -Settings.artifacts['object_store']['background_upload'] = true if Settings.artifacts['object_store']['background_upload'].nil? -Settings.artifacts['object_store']['proxy_download'] = false if Settings.artifacts['object_store']['proxy_download'].nil? -# Convert upload connection settings to use string keys, to make Fog happy -Settings.artifacts['object_store']['connection']&.deep_stringify_keys! +Settings.artifacts['object_store'] = ObjectStoreSettings.parse(Settings.artifacts['object_store']) # # Registry @@ -225,14 +219,7 @@ Settings.pages.admin['certificate'] ||= '' Settings['lfs'] ||= Settingslogic.new({}) Settings.lfs['enabled'] = true if Settings.lfs['enabled'].nil? Settings.lfs['storage_path'] = Settings.absolute(Settings.lfs['storage_path'] || File.join(Settings.shared['path'], "lfs-objects")) -Settings.lfs['object_store'] ||= Settingslogic.new({}) -Settings.lfs['object_store']['enabled'] = false if Settings.lfs['object_store']['enabled'].nil? -Settings.lfs['object_store']['remote_directory'] ||= nil -Settings.lfs['object_store']['direct_upload'] = false if Settings.lfs['object_store']['direct_upload'].nil? -Settings.lfs['object_store']['background_upload'] = true if Settings.lfs['object_store']['background_upload'].nil? -Settings.lfs['object_store']['proxy_download'] = false if Settings.lfs['object_store']['proxy_download'].nil? -# Convert upload connection settings to use string keys, to make Fog happy -Settings.lfs['object_store']['connection']&.deep_stringify_keys! +Settings.lfs['object_store'] = ObjectStoreSettings.parse(Settings.lfs['object_store']) # # Uploads @@ -240,14 +227,8 @@ Settings.lfs['object_store']['connection']&.deep_stringify_keys! Settings['uploads'] ||= Settingslogic.new({}) Settings.uploads['storage_path'] = Settings.absolute(Settings.uploads['storage_path'] || 'public') Settings.uploads['base_dir'] = Settings.uploads['base_dir'] || 'uploads/-/system' -Settings.uploads['object_store'] ||= Settingslogic.new({}) -Settings.uploads['object_store']['enabled'] = false if Settings.uploads['object_store']['enabled'].nil? +Settings.uploads['object_store'] = ObjectStoreSettings.parse(Settings.uploads['object_store']) Settings.uploads['object_store']['remote_directory'] ||= 'uploads' -Settings.uploads['object_store']['direct_upload'] = false if Settings.uploads['object_store']['direct_upload'].nil? -Settings.uploads['object_store']['background_upload'] = true if Settings.uploads['object_store']['background_upload'].nil? -Settings.uploads['object_store']['proxy_download'] = false if Settings.uploads['object_store']['proxy_download'].nil? -# Convert upload connection settings to use string keys, to make Fog happy -Settings.uploads['object_store']['connection']&.deep_stringify_keys! # # Mattermost @@ -437,7 +418,7 @@ Settings['extra'] ||= Settingslogic.new({}) # Settings['rack_attack'] ||= Settingslogic.new({}) Settings.rack_attack['git_basic_auth'] ||= Settingslogic.new({}) -Settings.rack_attack.git_basic_auth['enabled'] = true if Settings.rack_attack.git_basic_auth['enabled'].nil? +Settings.rack_attack.git_basic_auth['enabled'] = false if Settings.rack_attack.git_basic_auth['enabled'].nil? Settings.rack_attack.git_basic_auth['ip_whitelist'] ||= %w{127.0.0.1} Settings.rack_attack.git_basic_auth['maxretry'] ||= 10 Settings.rack_attack.git_basic_auth['findtime'] ||= 1.minute diff --git a/config/initializers/8_metrics.rb b/config/initializers/8_metrics.rb index 8a851b89c56..4d8d35bf6cf 100644 --- a/config/initializers/8_metrics.rb +++ b/config/initializers/8_metrics.rb @@ -58,20 +58,6 @@ def instrument_classes(instrumentation) instrumentation.instrument_instance_methods(const) end - # Instruments all Banzai filters and reference parsers - { - Filter: Rails.root.join('lib', 'banzai', 'filter', '*.rb'), - ReferenceParser: Rails.root.join('lib', 'banzai', 'reference_parser', '*.rb') - }.each do |const_name, path| - Dir[path].each do |file| - klass = File.basename(file, File.extname(file)).camelize - const = Banzai.const_get(const_name).const_get(klass) - - instrumentation.instrument_methods(const) - instrumentation.instrument_instance_methods(const) - end - end - instrumentation.instrument_methods(Banzai::Renderer) instrumentation.instrument_methods(Banzai::Querying) @@ -94,8 +80,6 @@ def instrument_classes(instrumentation) instrumentation.instrument_instance_methods(RepositoryCheck::SingleRepositoryWorker) - instrumentation.instrument_instance_methods(Rouge::Plugins::CommonMark) - instrumentation.instrument_instance_methods(Rouge::Plugins::Redcarpet) instrumentation.instrument_instance_methods(Rouge::Formatters::HTMLGitlab) [:XML, :HTML].each do |namespace| diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index e5772c33307..c41b2db722c 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -219,7 +219,7 @@ Devise.setup do |config| end end - if Gitlab::OmniauthInitializer.enabled? + if Gitlab::Auth.omniauth_enabled? Gitlab::OmniauthInitializer.new(config).execute(Gitlab.config.omniauth.providers) end end diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index c558eb28ced..ef23ca065c6 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -16,8 +16,3 @@ OmniAuth.config.allowed_request_methods << :get if Gitlab.config.omniauth.auto_s OmniAuth.config.before_request_phase do |env| Gitlab::RequestForgeryProtection.call(env) end - -if Gitlab::OmniauthInitializer.enabled? - provider_names = Gitlab.config.omniauth.providers.map(&:name) - Gitlab::Auth.omniauth_setup_providers(provider_names) -end diff --git a/config/object_store_settings.rb b/config/object_store_settings.rb new file mode 100644 index 00000000000..d85ff394dcc --- /dev/null +++ b/config/object_store_settings.rb @@ -0,0 +1,15 @@ +# Set default values for object_store settings +class ObjectStoreSettings + def self.parse(object_store) + object_store ||= Settingslogic.new({}) + object_store['enabled'] = false if object_store['enabled'].nil? + object_store['remote_directory'] ||= nil + object_store['direct_upload'] = false if object_store['direct_upload'].nil? + object_store['background_upload'] = true if object_store['background_upload'].nil? + object_store['proxy_download'] = false if object_store['proxy_download'].nil? + + # Convert upload connection settings to use string keys, to make Fog happy + object_store['connection']&.deep_stringify_keys! + object_store + end +end |