Skip to content

Instantly share code, notes, and snippets.

@denschub
Last active December 21, 2019 08:24
Show Gist options
  • Save denschub/f016b3ffcd089fb6671fd9444656a9f1 to your computer and use it in GitHub Desktop.
Save denschub/f016b3ffcd089fb6671fd9444656a9f1 to your computer and use it in GitHub Desktop.
Closes all accounts on a diaspora* pod.
#!/usr/bin/env ruby
# WARNING: This is very destructive.
#
# Closes all accounts.
#
# Place into diaspora*'s root folder and run the script. Don't forget to set
# necessary environment variables. This will dispatch a lot of background jobs,
# so it's wise to leave the pod running for a while after running this script.
#
# Note that this also deletes your admin account, so you won't be able to check
# `/sidekiq` for the amount of deletion jobs left to run. To check when it's done,
# open a Rails console with `bin/rails console` from within your diaspora* directory
# and check the return value of `Sidekiq::Stats.new.enqueued`.
# If it's 0, it's done.
ENV["RAILS_ENV"] ||= "production"
require_relative "config/environment"
User.all.each do |user|
user.close_account!
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment