2018-07-23 10:28:29 -04:00
|
|
|
# Set default values for object_store settings
|
|
|
|
class ObjectStoreSettings
|
2018-07-23 10:33:06 -04:00
|
|
|
def self.parse(object_store)
|
2018-07-23 10:28:29 -04:00
|
|
|
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?
|
2018-07-23 10:33:06 -04:00
|
|
|
|
2018-07-23 10:28:29 -04:00
|
|
|
# Convert upload connection settings to use string keys, to make Fog happy
|
|
|
|
object_store['connection']&.deep_stringify_keys!
|
2018-07-23 10:33:06 -04:00
|
|
|
object_store
|
2018-07-23 10:28:29 -04:00
|
|
|
end
|
|
|
|
end
|