Files
paperclip/config_examples/no_cached_s3/config_example.rb.example
2022-06-15 13:35:47 +03:00

31 lines
1.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# frozen_string_literal: true
PAPERCLIP_NO_CACHE_S3_CONFIG_BASE =
{
storage: :no_cache_s3,
# Не скачиваем файлы по http в тестах, чтобы не делать стабы vcr для всего подряд.
# В продакшене файлы скачиваются по url, чтобы качать через cdn и не тратить облачный трафик.
to_file_using_fog: Rails.env.test?,
url: "#{STATIC_CDN}/:key", # Умный cdn сам решает куда идти за файлом.
stores: {
yandex: {
region: 'ru-central1',
endpoint: 'https://storage.yandexcloud.net',
access_key_id: '123',
secret_access_key: '345',
bucket: 'digital-static'
},
sbercloud: {
provider: 'AWS',
region: 'ru-moscow',
endpoint: 'https://obs.ru-moscow-1.hc.sbercloud.ru',
access_key_id: '123',
secret_access_key: '345',
bucket: 'digital-static'
}
}
}.freeze
# Добавляет общий префикс ко всем ключам.
PAPERCLIP_NO_CACHE_S3_CONFIG = ->(key) { PAPERCLIP_NO_CACHE_S3_CONFIG_BASE.merge(key: "digital/#{key}") }