Last active
December 21, 2019 08:24
-
-
Save denschub/f016b3ffcd089fb6671fd9444656a9f1 to your computer and use it in GitHub Desktop.
Closes all accounts on a diaspora* pod.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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