mirror of https://github.com/mastodon/mastodon
Fix support for special characters in various environment variables (#35314)
Co-authored-by: Matt Jankowski <matt@jankowski.online>pull/35571/head
parent
f96743fcfb
commit
1151b05c2d
@ -1,5 +1,5 @@
|
|||||||
shared:
|
shared:
|
||||||
enabled: <%= ENV.fetch('CACHE_BUSTER_ENABLED', 'false') == 'true' %>
|
enabled: <%= ENV.fetch('CACHE_BUSTER_ENABLED', 'false') == 'true' %>
|
||||||
secret_header: <%= ENV.fetch('CACHE_BUSTER_SECRET_HEADER', nil) %>
|
secret_header: <%= ENV.fetch('CACHE_BUSTER_SECRET_HEADER', nil)&.to_json %>
|
||||||
secret: <%= ENV.fetch('CACHE_BUSTER_SECRET', nil) %>
|
secret: <%= ENV.fetch('CACHE_BUSTER_SECRET', nil)&.to_json %>
|
||||||
http_method: <%= ENV.fetch('CACHE_BUSTER_HTTP_METHOD', 'GET') %>
|
http_method: <%= ENV.fetch('CACHE_BUSTER_HTTP_METHOD', 'GET') %>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
shared:
|
shared:
|
||||||
deepl:
|
deepl:
|
||||||
api_key: <%= ENV.fetch('DEEPL_API_KEY', nil) %>
|
api_key: <%= ENV.fetch('DEEPL_API_KEY', nil)&.to_json %>
|
||||||
plan: <%= ENV.fetch('DEEPL_PLAN', 'free') %>
|
plan: <%= ENV.fetch('DEEPL_PLAN', 'free') %>
|
||||||
libre_translate:
|
libre_translate:
|
||||||
api_key: <%= ENV.fetch('LIBRE_TRANSLATE_API_KEY', nil) %>
|
api_key: <%= ENV.fetch('LIBRE_TRANSLATE_API_KEY', nil)&.to_json %>
|
||||||
endpoint: <%= ENV.fetch('LIBRE_TRANSLATE_ENDPOINT', nil) %>
|
endpoint: <%= ENV.fetch('LIBRE_TRANSLATE_ENDPOINT', nil)&.to_json %>
|
||||||
|
|||||||
@ -0,0 +1,22 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe 'Configuration for email', type: :feature do
|
||||||
|
context 'with special characters in SMTP_PASSWORD env variable' do
|
||||||
|
let(:password) { ']]123456789[["!:@<>/\\=' }
|
||||||
|
|
||||||
|
around do |example|
|
||||||
|
ClimateControl.modify SMTP_PASSWORD: password do
|
||||||
|
example.run
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'parses value correctly' do
|
||||||
|
expect(Rails.application.config_for(:email, env: :production))
|
||||||
|
.to include(
|
||||||
|
smtp_settings: include(password: password)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Reference in New Issue