diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/dependency_decisions.yml | 6 | ||||
-rw-r--r-- | config/initializers/1_settings.rb | 38 | ||||
-rw-r--r-- | config/initializers/acts_as_taggable.rb | 5 | ||||
-rw-r--r-- | config/initializers/devise.rb | 8 | ||||
-rw-r--r-- | config/initializers/gollum.rb | 2 | ||||
-rw-r--r-- | config/initializers/health_check.rb | 4 | ||||
-rw-r--r-- | config/initializers/metrics.rb | 14 | ||||
-rw-r--r-- | config/initializers/mysql_ignore_postgresql_options.rb | 2 | ||||
-rw-r--r-- | config/initializers/rack_lineprof.rb | 2 | ||||
-rw-r--r-- | config/initializers/trusted_proxies.rb | 2 | ||||
-rw-r--r-- | config/initializers/workhorse_multipart.rb | 2 | ||||
-rw-r--r-- | config/mail_room.yml | 5 | ||||
-rw-r--r-- | config/routes/sidekiq.rb | 2 | ||||
-rw-r--r-- | config/routes/wiki.rb | 2 | ||||
-rw-r--r-- | config/webpack.config.js | 14 |
15 files changed, 68 insertions, 40 deletions
diff --git a/config/dependency_decisions.yml b/config/dependency_decisions.yml index 7336d7c842a..072ed8a3864 100644 --- a/config/dependency_decisions.yml +++ b/config/dependency_decisions.yml @@ -320,3 +320,9 @@ :why: https://github.com/shinnn/spdx-license-ids/blob/v1.2.2/LICENSE :versions: [] :when: 2017-02-08 22:35:00.225232000 Z +- - :approve + - opener + - :who: Mike Greiling + :why: https://github.com/domenic/opener/blob/1.4.3/LICENSE.txt + :versions: [] + :when: 2017-02-21 22:33:41.729629000 Z diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 3f716dd8833..c64ae15fa92 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -14,12 +14,15 @@ class Settings < Settingslogic end def build_gitlab_ci_url - if on_standard_port?(gitlab) - custom_port = nil - else - custom_port = ":#{gitlab.port}" - end - [ gitlab.protocol, + custom_port = + if on_standard_port?(gitlab) + nil + else + ":#{gitlab.port}" + end + + [ + gitlab.protocol, "://", gitlab.host, custom_port, @@ -80,7 +83,9 @@ class Settings < Settingslogic def base_url(config) custom_port = on_standard_port?(config) ? nil : ":#{config.port}" - [ config.protocol, + + [ + config.protocol, "://", config.host, custom_port @@ -160,15 +165,16 @@ if github_settings github_settings["args"] ||= Settingslogic.new({}) - if github_settings["url"].include?(github_default_url) - github_settings["args"]["client_options"] = OmniAuth::Strategies::GitHub.default_options[:client_options] - else - github_settings["args"]["client_options"] = { - "site" => File.join(github_settings["url"], "api/v3"), - "authorize_url" => File.join(github_settings["url"], "login/oauth/authorize"), - "token_url" => File.join(github_settings["url"], "login/oauth/access_token") - } - end + github_settings["args"]["client_options"] = + if github_settings["url"].include?(github_default_url) + OmniAuth::Strategies::GitHub.default_options[:client_options] + else + { + "site" => File.join(github_settings["url"], "api/v3"), + "authorize_url" => File.join(github_settings["url"], "login/oauth/authorize"), + "token_url" => File.join(github_settings["url"], "login/oauth/access_token") + } + end end Settings['shared'] ||= Settingslogic.new({}) diff --git a/config/initializers/acts_as_taggable.rb b/config/initializers/acts_as_taggable.rb new file mode 100644 index 00000000000..c564c0cab11 --- /dev/null +++ b/config/initializers/acts_as_taggable.rb @@ -0,0 +1,5 @@ +ActsAsTaggableOn.strict_case_match = true + +# tags_counter enables caching count of tags which results in an update whenever a tag is added or removed +# since the count is not used anywhere its better performance wise to disable this cache +ActsAsTaggableOn.tags_counter = false diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 738dbeefc11..3b1317030bc 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -24,7 +24,7 @@ Devise.setup do |config| # session. If you need permissions, you should implement that in a before filter. # You can also supply a hash where the value is a boolean determining whether # or not authentication should be aborted when the value is not present. - config.authentication_keys = [ :login ] + config.authentication_keys = [:login] # Configure parameters from the request object used for authentication. Each entry # given should be a request method and it will automatically be passed to the @@ -36,12 +36,12 @@ Devise.setup do |config| # Configure which authentication keys should be case-insensitive. # These keys will be downcased upon creating or modifying a user and when used # to authenticate or find a user. Default is :email. - config.case_insensitive_keys = [ :email ] + config.case_insensitive_keys = [:email] # Configure which authentication keys should have whitespace stripped. # These keys will have whitespace before and after removed upon creating or # modifying a user and when used to authenticate or find a user. Default is :email. - config.strip_whitespace_keys = [ :email ] + config.strip_whitespace_keys = [:email] # Tell if authentication through request.params is enabled. True by default. # config.params_authenticatable = true @@ -124,7 +124,7 @@ Devise.setup do |config| config.lock_strategy = :failed_attempts # Defines which key will be used when locking and unlocking an account - config.unlock_keys = [ :email ] + config.unlock_keys = [:email] # Defines which strategy will be used to unlock an account. # :email = Sends an unlock link to the user email diff --git a/config/initializers/gollum.rb b/config/initializers/gollum.rb index 703f24f93b2..1ebe3c7a742 100644 --- a/config/initializers/gollum.rb +++ b/config/initializers/gollum.rb @@ -1,5 +1,5 @@ module Gollum - GIT_ADAPTER = "rugged" + GIT_ADAPTER = "rugged".freeze end require "gollum-lib" diff --git a/config/initializers/health_check.rb b/config/initializers/health_check.rb index 4c91a61fb4a..959daa93f78 100644 --- a/config/initializers/health_check.rb +++ b/config/initializers/health_check.rb @@ -1,4 +1,4 @@ HealthCheck.setup do |config| - config.standard_checks = ['database', 'migrations', 'cache'] - config.full_checks = ['database', 'migrations', 'cache'] + config.standard_checks = %w(database migrations cache) + config.full_checks = %w(database migrations cache) end diff --git a/config/initializers/metrics.rb b/config/initializers/metrics.rb index e0702e06cc9..a1517e6afc8 100644 --- a/config/initializers/metrics.rb +++ b/config/initializers/metrics.rb @@ -20,13 +20,13 @@ def instrument_classes(instrumentation) # Path to search => prefix to strip from constant paths_to_instrument = { - ['app', 'finders'] => ['app', 'finders'], - ['app', 'mailers', 'emails'] => ['app', 'mailers'], - ['app', 'services', '**'] => ['app', 'services'], - ['lib', 'gitlab', 'conflicts'] => ['lib'], - ['lib', 'gitlab', 'diff'] => ['lib'], - ['lib', 'gitlab', 'email', 'message'] => ['lib'], - ['lib', 'gitlab', 'checks'] => ['lib'] + %w(app finders) => %w(app finders), + %w(app mailers emails) => %w(app mailers), + %w(app services **) => %w(app services), + %w(lib gitlab conflicts) => ['lib'], + %w(lib gitlab diff) => ['lib'], + %w(lib gitlab email message) => ['lib'], + %w(lib gitlab checks) => ['lib'] } paths_to_instrument.each do |(path, prefix)| diff --git a/config/initializers/mysql_ignore_postgresql_options.rb b/config/initializers/mysql_ignore_postgresql_options.rb index 835f3ec5574..9a569be7674 100644 --- a/config/initializers/mysql_ignore_postgresql_options.rb +++ b/config/initializers/mysql_ignore_postgresql_options.rb @@ -31,7 +31,7 @@ if defined?(ActiveRecord::ConnectionAdapters::Mysql2Adapter) end def add_index_options(table_name, column_name, options = {}) - if options[:using] and options[:using] == :gin + if options[:using] && options[:using] == :gin options = options.dup options.delete(:using) end diff --git a/config/initializers/rack_lineprof.rb b/config/initializers/rack_lineprof.rb index 22e77a32c61..f7172fce9bc 100644 --- a/config/initializers/rack_lineprof.rb +++ b/config/initializers/rack_lineprof.rb @@ -1,7 +1,7 @@ # The default colors of rack-lineprof can be very hard to look at in terminals # with darker backgrounds. This patch tweaks the colors a bit so the output is # actually readable. -if Rails.env.development? and RUBY_ENGINE == 'ruby' and ENV['ENABLE_LINEPROF'] +if Rails.env.development? && RUBY_ENGINE == 'ruby' && ENV['ENABLE_LINEPROF'] Rails.application.config.middleware.use(Rack::Lineprof) module Rack diff --git a/config/initializers/trusted_proxies.rb b/config/initializers/trusted_proxies.rb index cd869657c53..fc4f02453d7 100644 --- a/config/initializers/trusted_proxies.rb +++ b/config/initializers/trusted_proxies.rb @@ -21,4 +21,4 @@ gitlab_trusted_proxies = Array(Gitlab.config.gitlab.trusted_proxies).map do |pro end.compact Rails.application.config.action_dispatch.trusted_proxies = ( - [ '127.0.0.1', '::1' ] + gitlab_trusted_proxies) + ['127.0.0.1', '::1'] + gitlab_trusted_proxies) diff --git a/config/initializers/workhorse_multipart.rb b/config/initializers/workhorse_multipart.rb index 84d809741c4..064e5964f09 100644 --- a/config/initializers/workhorse_multipart.rb +++ b/config/initializers/workhorse_multipart.rb @@ -10,7 +10,7 @@ end # module Gitlab module StrongParameterScalars - GITLAB_PERMITTED_SCALAR_TYPES = [::UploadedFile] + GITLAB_PERMITTED_SCALAR_TYPES = [::UploadedFile].freeze def permitted_scalar?(value) super || GITLAB_PERMITTED_SCALAR_TYPES.any? { |type| value.is_a?(type) } diff --git a/config/mail_room.yml b/config/mail_room.yml index 774c5350a45..88d93d4bc6b 100644 --- a/config/mail_room.yml +++ b/config/mail_room.yml @@ -1,9 +1,6 @@ -# If you change this file in a Merge Request, please also create -# a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests -# :mailboxes: <% - require_relative "lib/gitlab/mail_room" unless defined?(Gitlab::MailRoom) + require_relative "../lib/gitlab/mail_room" unless defined?(Gitlab::MailRoom) config = Gitlab::MailRoom.config if Gitlab::MailRoom.enabled? diff --git a/config/routes/sidekiq.rb b/config/routes/sidekiq.rb index d3e6bc4c292..0fa23f2b3d0 100644 --- a/config/routes/sidekiq.rb +++ b/config/routes/sidekiq.rb @@ -1,4 +1,4 @@ -constraint = lambda { |request| request.env['warden'].authenticate? and request.env['warden'].user.admin? } +constraint = lambda { |request| request.env['warden'].authenticate? && request.env['warden'].user.admin? } constraints constraint do mount Sidekiq::Web, at: '/admin/sidekiq', as: :sidekiq end diff --git a/config/routes/wiki.rb b/config/routes/wiki.rb index dad746d59a1..a6b3f5d4693 100644 --- a/config/routes/wiki.rb +++ b/config/routes/wiki.rb @@ -1,4 +1,4 @@ -WIKI_SLUG_ID = { id: /\S+/ } unless defined? WIKI_SLUG_ID +WIKI_SLUG_ID = { id: /\S+/ }.freeze unless defined? WIKI_SLUG_ID scope(controller: :wikis) do scope(path: 'wikis', as: :wikis) do diff --git a/config/webpack.config.js b/config/webpack.config.js index 15899993874..e754f68553a 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -5,12 +5,14 @@ var path = require('path'); var webpack = require('webpack'); var StatsPlugin = require('stats-webpack-plugin'); var CompressionPlugin = require('compression-webpack-plugin'); +var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; var ROOT_PATH = path.resolve(__dirname, '..'); var IS_PRODUCTION = process.env.NODE_ENV === 'production'; var IS_DEV_SERVER = process.argv[1].indexOf('webpack-dev-server') !== -1; var DEV_SERVER_PORT = parseInt(process.env.DEV_SERVER_PORT, 10) || 3808; var DEV_SERVER_LIVERELOAD = process.env.DEV_SERVER_LIVERELOAD !== 'false'; +var WEBPACK_REPORT = process.env.WEBPACK_REPORT; var config = { context: path.join(ROOT_PATH, 'app/assets/javascripts'), @@ -120,4 +122,16 @@ if (IS_DEV_SERVER) { config.output.publicPath = '//localhost:' + DEV_SERVER_PORT + config.output.publicPath; } +if (WEBPACK_REPORT) { + config.plugins.push( + new BundleAnalyzerPlugin({ + analyzerMode: 'static', + generateStatsFile: true, + openAnalyzer: false, + reportFilename: path.join(ROOT_PATH, 'webpack-report/index.html'), + statsFilename: path.join(ROOT_PATH, 'webpack-report/stats.json'), + }) + ); +} + module.exports = config; |