From 82eecb08423a5e69408ca2b8e4c246ce2c9a6a6f Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 25 Oct 2021 16:34:15 +0200 Subject: [PATCH] Fix mastodon:setup to take dotenv/docker-compose differences into account (#16896) In order to work around https://github.com/mastodon/mastodon/issues/16895, add a warning to .env.production.sample, and change the mastodon:setup rake task to: - output a warning if a variable will be interpreted differently by dotenv and docker-compose - ensure the printed config is compatible with docker-compose --- lib/tasks/mastodon.rake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake index a89af677807439..6ce63d3ae8f017 100644 --- a/lib/tasks/mastodon.rake +++ b/lib/tasks/mastodon.rake @@ -350,11 +350,11 @@ namespace :mastodon do end end.join("\n") - generated_header = "# Generated with mastodon:setup on #{Time.now.utc}\n\n".dup + generated_header = "# Generated with mastodon:setup on #{Time.now.utc}\n\n" if incompatible_syntax - generated_header << "# Some variables in this file will be interpreted differently whether you are\n" - generated_header << "# using docker-compose or not.\n\n" + generated_header << "Some variables in this file will be interpreted differently whether you are\n" + generated_header << "using docker-compose or not.\n\n" end File.write(Rails.root.join('.env.production'), "#{generated_header}#{env_contents}\n")