From a6fc776c6ff99f9900b88ff84ce8232372a7b2de Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 22 Jan 2025 16:34:22 +0100 Subject: [PATCH] Change `mastodon:setup` to prevent overwriting already-configured servers (#33684) --- lib/tasks/mastodon.rake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake index 0081b4a8f6..61dba4eb52 100644 --- a/lib/tasks/mastodon.rake +++ b/lib/tasks/mastodon.rake @@ -8,6 +8,12 @@ namespace :mastodon do prompt = TTY::Prompt.new env = {} + if ENV['LOCAL_DOMAIN'] + prompt.warn "It looks like you already configured Mastodon for domain '#{ENV['LOCAL_DOMAIN']}'." + prompt.warn 'Never re-run this task on an already-configured running server.' + next prompt.warn 'Nothing saved. Bye!' if prompt.no?('Continue anyway?') + end + clear_environment! begin