Skip to content

Commit

Permalink
Increased expiration time on storage to prevent broken images as well…
Browse files Browse the repository at this point in the history
… as implement a fix for R2/S3 conflicts.
  • Loading branch information
Shpigford committed Jan 23, 2025
1 parent 44961f3 commit e4a3747
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = ENV.fetch("ACTIVE_STORAGE_SERVICE", "local").to_sym

# Set Active Storage URL expiration time to 7 days
config.active_storage.urls_expire_in = 7.days

# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
config.action_mailer.delivery_method = :letter_opener
Expand Down
3 changes: 3 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = ENV.fetch("ACTIVE_STORAGE_SERVICE", "local").to_sym

# Set Active Storage URL expiration time to 7 days
config.active_storage.urls_expire_in = 7.days

# Mount Action Cable outside main process or domain.
# config.action_cable.mount_path = nil
# config.action_cable.url = "wss://example.com/cable"
Expand Down
2 changes: 2 additions & 0 deletions config/storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ cloudflare:
secret_access_key: <%= ENV['CLOUDFLARE_SECRET_ACCESS_KEY'] %>
region: auto
bucket: <%= ENV['CLOUDFLARE_BUCKET'] %>
request_checksum_calculation: "when_required"
response_checksum_validation: "when_required"

# Removed in #702. Uncomment, add gems, update .env.example to enable.
#google:
Expand Down

0 comments on commit e4a3747

Please sign in to comment.