diaspora/diaspora — pull request #5288 by jaywink (2014-10-05 20:12:20+00:00)
Title: Maintenance feature to remove old users, scheduled in settings

Submitting for initial review even though tests are not finished yet.

This is a maintenance feature, hopefully one of future many, to remove old user accounts. See discussion here: https://www.loomio.org/d/IgihNCe4/expiring-old-accounts . The aim is to help podmins maintain their pod size and thus guarantee resources for users who actually are active.

Basically:
* Podmin enables feature and changes possible defaults (how many days inactivity, how many days of warning to user, how many to process max per day)
* Cron job runs every day to check for any inactive users and sends warning emails to them + tags them with a timestamp when it is ok to remove said account + triggers a future job to Sidekiq for the actual removal (+1 day after remove_after timestamp)
* User login will remove any "remove_after" timestamp
* Sidekiq processes job in the future, and if user still has a remove_after timestamp, will close the account (I'm counting this means remove too, please correct if wrong)

Any jobs will not do any removals if podmin decides to turn the feature off after generating lots of removal warnings - the setting is checked before removal.

I'll add more tests tomorrow for the few methods used, just ran out of time today.