prompt.warn("#{pending_accounts} accounts are still pending deletion.")
say("#{pending_accounts} accounts are still pending deletion.",:yellow)
elsifsidekiq_stats.enqueued.positive?
prompt.warn('Deletion notices are still being processed')
say('Deletion notices are still being processed',:yellow)
elsifsidekiq_stats.retry_size.positive?
prompt.warn('At least one delivery attempt for each deletion notice has been made, but some have failed and are scheduled for retry')
say('At least one delivery attempt for each deletion notice has been made, but some have failed and are scheduled for retry',:yellow)
else
prompt.ok('Every deletion notice has been sent! You can safely delete all data and decomission your servers!')
say('Every deletion notice has been sent! You can safely delete all data and decomission your servers!',:green)
end
exit(0)
end
exit(1)unlessprompt.ask('Type in the domain of the server to confirm:',required:true)==Rails.configuration.x.local_domain
exit(1)unless ask('Type in the domain of the server to confirm:')==Rails.configuration.x.local_domain
prompt.warn('This operation WILL NOT be reversible.')
prompt.warn('While the data won\'t be erased locally, the server will be in a BROKEN STATE afterwards.')
prompt.warn('The deletion process itself may take a long time, and will be handled by Sidekiq, so do not shut it down until it has finished (you will be able to re-run this command to see the state of the self-destruct process).')
say('This operation WILL NOT be reversible.',:yellow)
say('While the data won\'t be erased locally, the server will be in a BROKEN STATE afterwards.',:yellow)
say('The deletion process itself may take a long time, and will be handled by Sidekiq, so do not shut it down until it has finished (you will be able to re-run this command to see the state of the self-destruct process).',:yellow)
exit(1)ifprompt.no?('Are you sure you want to proceed?')
exit(1)if no?('Are you sure you want to proceed?')
prompt.ok('To switch Mastodon to self-destruct mode, add the following variable to your evironment (e.g. by adding a line to your `.env.production`) and restart all Mastodon processes:')
prompt.ok("\nYou can re-run this command to see the state of the self-destruct process.")
rescueTTY::Reader::InputInterrupt
say('To switch Mastodon to self-destruct mode, add the following variable to your evironment (e.g. by adding a line to your `.env.production`) and restart all Mastodon processes:',:green)