mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Use config_for for cache buster values (#34851)
This commit is contained in:
parent
9860046b04
commit
c025824f98
9 changed files with 13 additions and 19 deletions
|
|
@ -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
5
config/cache_buster.yml
Normal 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') %>
|
||||
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue