diff options
Diffstat (limited to 'config/application.rb')
-rw-r--r-- | config/application.rb | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/config/application.rb b/config/application.rb index de386506233..2554dd8cca2 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,11 +22,6 @@ module Gitlab require_dependency Rails.root.join('lib/gitlab/middleware/read_only') require_dependency Rails.root.join('lib/gitlab/middleware/basic_health_check') - # This needs to be loaded before DB connection is made - # to make sure that all connections have NO_ZERO_DATE - # setting disabled - require_dependency Rails.root.join('lib/mysql_zero_date') - # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. @@ -46,11 +41,6 @@ module Gitlab #{config.root}/app/models/hooks #{config.root}/app/models/members #{config.root}/app/models/project_services - #{config.root}/app/workers/concerns - #{config.root}/app/policies/concerns - #{config.root}/app/services/concerns - #{config.root}/app/serializers/concerns - #{config.root}/app/finders/concerns #{config.root}/app/graphql/resolvers/concerns #{config.root}/app/graphql/mutations/concerns]) @@ -110,10 +100,23 @@ module Gitlab # - Sentry DSN (:sentry_dsn) # - File content from Web Editor (:content) # - Jira shared secret (:sharedSecret) + # - Titles, bodies, and descriptions for notes, issues, etc. # - # NOTE: It is **IMPORTANT** to also update gitlab-workhorse's filter when adding parameters here to not - # introduce another security vulnerability: https://gitlab.com/gitlab-org/gitlab-workhorse/issues/182 - config.filter_parameters += [/token$/, /password/, /secret/, /key$/, /^note$/, /^text$/] + # NOTE: It is **IMPORTANT** to also update labkit's filter when + # adding parameters here to not introduce another security + # vulnerability: + # https://gitlab.com/gitlab-org/labkit/blob/master/mask/matchers.go + config.filter_parameters += [ + /token$/, + /password/, + /secret/, + /key$/, + /^body$/, + /^description$/, + /^note$/, + /^text$/, + /^title$/ + ] config.filter_parameters += %i( certificate encrypted_key @@ -168,7 +171,6 @@ module Gitlab # Import gitlab-svgs directly from vendored directory config.assets.paths << "#{config.root}/node_modules/@gitlab/svgs/dist" - config.assets.paths << "#{config.root}/node_modules" config.assets.precompile << "icons.svg" config.assets.precompile << "icons.json" config.assets.precompile << "illustrations/*.svg" @@ -183,9 +185,19 @@ module Gitlab config.assets.precompile << "pages/jira_connect.css" end + # Import path for EE specific SCSS entry point + # In CE it will import a noop file, in EE a functioning file + # Order is important, so that the ee file takes precedence: + config.assets.paths << "#{config.root}/ee/app/assets/stylesheets/_ee" + config.assets.paths << "#{config.root}/app/assets/stylesheets/_ee" + config.assets.paths << "#{config.root}/vendor/assets/javascripts/" config.assets.precompile << "snowplow/sp.js" + # This path must come last to avoid confusing sprockets + # See https://gitlab.com/gitlab-org/gitlab-ce/issues/64091#note_194512508 + config.assets.paths << "#{config.root}/node_modules" + # Compile non-JS/CSS assets in the ee/app/assets folder by default # Mimic sprockets-rails default: https://github.com/rails/sprockets-rails/blob/v3.2.1/lib/sprockets/railtie.rb#L84-L87 LOOSE_EE_APP_ASSETS = lambda do |logical_path, filename| @@ -229,7 +241,10 @@ module Gitlab end # Use caching across all environments + # Full list of options: + # https://api.rubyonrails.org/classes/ActiveSupport/Cache/RedisCacheStore.html#method-c-new caching_config_hash = Gitlab::Redis::Cache.params + caching_config_hash[:compress] = false caching_config_hash[:namespace] = Gitlab::Redis::Cache::CACHE_NAMESPACE caching_config_hash[:expires_in] = 2.weeks # Cache should not grow forever if Sidekiq.server? # threaded context @@ -237,7 +252,7 @@ module Gitlab caching_config_hash[:pool_timeout] = 1 end - config.cache_store = :redis_store, caching_config_hash + config.cache_store = :redis_cache_store, caching_config_hash config.active_job.queue_adapter = :sidekiq @@ -273,10 +288,5 @@ module Gitlab Gitlab::Routing.add_helpers(project_url_helpers) Gitlab::Routing.add_helpers(MilestonesRoutingHelper) end - - # This makes generated cookies to be compatible with Rails 5.1 and older - # We can remove this when we're confident that there are no issues with the Rails 5.2 upgrade - # and we won't need to rollback to older versions - config.action_dispatch.use_authenticated_cookie_encryption = false end end |