diff --git a/config/env.example b/config/env.example index 9a3fc6d54..1a931103d 100644 --- a/config/env.example +++ b/config/env.example @@ -28,8 +28,16 @@ BASIC_AUTH_ENABLED="disabled" BASIC_AUTH_USERNAME="" BASIC_AUTH_PASSWORD="" -# Object Storage for attachments -FOG_ENABLED="disabled" +# ActiveStorage service to use for attached files. +# Possible values: +# - "local": store files on the local filesystem +# - "amazon": store files remotely on an S3 storage service +# - "openstack": store files remotely on an OpenStack storage service +# +# (See config/storage.yml for the configuration of each service.) +STORAGE_TYPE="local" + +# Configuration for the OpenStack storage service (if enabled) FOG_OPENSTACK_API_KEY="" FOG_OPENSTACK_USERNAME="" FOG_OPENSTACK_URL="" diff --git a/config/environments/development.rb b/config/environments/development.rb index ca4b53b87..6cd35bccc 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -40,7 +40,7 @@ Rails.application.configure do config.action_mailer.raise_delivery_errors = false # Store uploaded files on the local file system (see config/storage.yml for options). - config.active_storage.service = ENV['FOG_ENABLED'] == 'enabled' ? :openstack : :local + config.active_storage.service = ENV.fetch("STORAGE_TYPE").to_sym # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log diff --git a/config/environments/production.rb b/config/environments/production.rb index 9c541639d..3a23d77fd 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -107,7 +107,7 @@ Rails.application.configure do # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true - config.active_storage.service = :openstack + config.active_storage.service = ENV.fetch("STORAGE_TYPE").to_sym # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify