make public storage and direct upload optional
This commit is contained in:
@@ -21,6 +21,7 @@ Rails.application.configure do
|
||||
|
||||
# Do not eager load code on boot.
|
||||
config.eager_load = false
|
||||
config.hosts = nil
|
||||
|
||||
# Show full error reports.
|
||||
config.consider_all_requests_local = true
|
||||
@@ -45,7 +46,8 @@ Rails.application.configure do
|
||||
end
|
||||
|
||||
# Store uploaded files on the local file system (see config/storage.yml for options).
|
||||
config.active_storage.service = :local
|
||||
config.active_storage.service = :disk
|
||||
config.active_storage.resolve_model_to_route = :rails_storage_proxy
|
||||
|
||||
# Don't care if the mailer can't send.
|
||||
config.action_mailer.raise_delivery_errors = true
|
||||
|
||||
@@ -46,9 +46,11 @@ Rails.application.configure do
|
||||
elsif ENV['AZURE_CONTAINER'].present?
|
||||
:azure
|
||||
else
|
||||
:local
|
||||
:disk
|
||||
end
|
||||
|
||||
config.active_storage.resolve_model_to_route = :rails_storage_proxy if ENV['ACTIVE_STORAGE_PUBLIC'] != 'true'
|
||||
|
||||
# Mount Action Cable outside main process or domain.
|
||||
# config.action_cable.mount_path = nil
|
||||
# config.action_cable.url = "wss://example.com/cable"
|
||||
|
||||
+3
-8
@@ -1,8 +1,3 @@
|
||||
local:
|
||||
service: Disk
|
||||
root: <%= ENV['WORKDIR'] || '.' %>/attachments
|
||||
public: true
|
||||
|
||||
disk:
|
||||
service: Disk
|
||||
root: <%= ENV['WORKDIR'] || '.' %>/attachments
|
||||
@@ -14,7 +9,7 @@ aws_s3:
|
||||
secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
|
||||
region: <%= ENV['AWS_REGION'] || 'us-east-1' %>
|
||||
bucket: <%= ENV['S3_ATTACHMENTS_BUCKET'] %>
|
||||
public: true
|
||||
public: <%= ENV['ACTIVE_STORAGE_PUBLIC'] == 'true' %>
|
||||
upload:
|
||||
cache_control: 'public, max-age=31536000'
|
||||
|
||||
@@ -23,7 +18,7 @@ google:
|
||||
credentials: <%= JSON.parse(ENV['GCS_CREDENTIALS'] || '{}') %>
|
||||
project: <%= ENV['GCS_PROJECT'] %>
|
||||
bucket: <%= ENV['GCS_BUCKET'] %>
|
||||
public: true
|
||||
public: <%= ENV['ACTIVE_STORAGE_PUBLIC'] == 'true' %>
|
||||
cache_control: "public, max-age=31536000"
|
||||
|
||||
azure:
|
||||
@@ -31,4 +26,4 @@ azure:
|
||||
storage_account_name: <%= ENV['AZURE_STORAGE_ACCOUNT_NAME'] %>
|
||||
storage_access_key: <%= ENV['AZURE_STORAGE_ACCESS_KEY'] %>
|
||||
container: <%= ENV['AZURE_CONTAINER'] %>
|
||||
public: true
|
||||
public: <%= ENV['ACTIVE_STORAGE_PUBLIC'] == 'true' %>
|
||||
|
||||
Reference in New Issue
Block a user