2
0

Use config_for for cache buster values (#34851)

This commit is contained in:
Matt Jankowski
2025-05-30 07:54:25 -04:00
committed by GitHub
parent 9860046b04
commit c025824f98
9 changed files with 13 additions and 19 deletions

View File

@@ -103,6 +103,7 @@ module Mastodon
end
end
config.x.cache_buster = config_for(:cache_buster)
config.x.captcha = config_for(:captcha)
config.x.mastodon = config_for(:mastodon)
config.x.translation = config_for(:translation)

5
config/cache_buster.yml Normal file
View File

@@ -0,0 +1,5 @@
shared:
enabled: <%= ENV.fetch('CACHE_BUSTER_ENABLED', 'false') == 'true' %>
secret_header: <%= ENV.fetch('CACHE_BUSTER_SECRET_HEADER', nil) %>
secret: <%= ENV.fetch('CACHE_BUSTER_SECRET', nil) %>
http_method: <%= ENV.fetch('CACHE_BUSTER_HTTP_METHOD', 'GET') %>

View File

@@ -1,11 +0,0 @@
# frozen_string_literal: true
Rails.application.configure do
config.x.cache_buster_enabled = ENV['CACHE_BUSTER_ENABLED'] == 'true'
config.x.cache_buster = {
secret_header: ENV['CACHE_BUSTER_SECRET_HEADER'],
secret: ENV['CACHE_BUSTER_SECRET'],
http_method: ENV['CACHE_BUSTER_HTTP_METHOD'] || 'GET',
}
end