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/35320/head
parent
1e2d77f2c7
commit
8bd2c87399
@ -1,5 +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) %>
|
||||
secret_header: <%= ENV.fetch('CACHE_BUSTER_SECRET_HEADER', nil)&.to_json %>
|
||||
secret: <%= ENV.fetch('CACHE_BUSTER_SECRET', nil)&.to_json %>
|
||||
http_method: <%= ENV.fetch('CACHE_BUSTER_HTTP_METHOD', 'GET') %>
|
||||
|
@ -1,7 +1,7 @@
|
||||
shared:
|
||||
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') %>
|
||||
libre_translate:
|
||||
api_key: <%= ENV.fetch('LIBRE_TRANSLATE_API_KEY', nil) %>
|
||||
endpoint: <%= ENV.fetch('LIBRE_TRANSLATE_ENDPOINT', nil) %>
|
||||
api_key: <%= ENV.fetch('LIBRE_TRANSLATE_API_KEY', nil)&.to_json %>
|
||||
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