1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 require File.expand_path('../boot', __FILE__)
12 verbose_orig = $VERBOSE
17 $VERBOSE = verbose_orig
24 # If you precompile assets before deploying to production, use this line
25 Bundler.require(*Rails.groups(:assets => %w(development test)))
26 # If you want your assets lazily compiled in production, use this line
27 # Bundler.require(:default, :assets, Rails.env)
32 class Application < Rails::Application
33 # Settings in config/environments/* take precedence over those specified here.
34 # Application configuration should go into files in config/initializers
35 # -- all .rb files in that directory are automatically loaded.
37 # Custom directories with classes and modules you want to be autoloadable.
38 # config.autoload_paths += %W(#{config.root}/extras)
40 # Only load the plugins named here, in the order given (default is alphabetical).
41 # :all can be used as a placeholder for all plugins not explicitly named.
42 # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
44 # Activate observers that should always be running.
45 # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
46 config.active_record.schema_format = :sql
48 # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
49 # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
50 # config.i18n.default_locale = :de
52 # Configure sensitive parameters which will be filtered from the log file.
53 config.filter_parameters += [:password]
55 # Load entire application at startup.
56 config.eager_load = true
58 config.active_record.raise_in_transactional_callbacks = true
60 config.active_support.test_order = :sorted
62 config.action_dispatch.perform_deep_munge = false
64 I18n.enforce_available_locales = false
66 # Before using the filesystem backend for Rails.cache, check
67 # whether we own the relevant directory. If we don't, using it is
68 # likely to either fail or (if we're root) pollute it and cause
69 # other processes to fail later.
70 default_cache_path = Rails.root.join('tmp', 'cache')
71 if not File.owned?(default_cache_path)
72 if File.exist?(default_cache_path)
73 why = "owner (uid=#{File::Stat.new(default_cache_path).uid}) " +
74 "is not me (uid=#{Process.euid})"
76 why = "does not exist"
78 STDERR.puts("Defaulting to memory cache, " +
79 "because #{default_cache_path} #{why}")
80 config.cache_store = :memory_store
82 require Rails.root.join('lib/safer_file_store')
83 config.cache_store = ::SaferFileStore.new(default_cache_path)