Auto destruction

Je crois bien que c’est la première fois que je découvre une commande comme celle-ci dans un logiciel :

RAILS_ENV=production bin/tootctl self-destruct

Vous avez vu le dernier paramètre, self-destruct ?

C’est la commande que j’ai lancé hier après-midi, après avoir fait quelques tests, pour supprimer proprement toute trace du Café des Blogueurs dans la fédération !

Type in the domain of the server to confirm: cafe.des-blogueurs.org
This operation WILL NOT be reversible. It can also take a long time.
While the data won't be erased locally, the server will be in a BROKEN STATE afterwards.
A running Sidekiq process is required. Do not shut it down until queues clear.
Are you sure you want to proceed? yes
Do NOT interrupt this process...
Queued 113305 items into Sidekiq for 31 accounts
Wait until Sidekiq processes all items, then you can shut everything down and delete the data

Du coup ce sont 113305 items à traiter qui ont été ajoutés dans les queues Sidekiq, et ça prend du temps !

Ce matin, il en reste encore un peu plus de 33000 à traiter…

J’ai trouvé cette commande en fouillant un peu le code — c’est toujours intéressant de fouiller le code !

…
    desc 'self-destruct', 'Erase the server from the federation'
    long_desc <<~LONG_DESC
      Erase the server from the federation by broadcasting account delete
      activities to all known other servers. This allows a "clean exit" from
      running a Mastodon server, as it leaves next to no cache behind on
      other servers.

      This command is always interactive and requires confirmation twice.

      No local data is actually deleted, because emptying the
      database or removing files is much faster through other, external
      means, such as e.g. deleting the entire VPS. However, because other
      servers will delete data about local users, but no local data will be
      updated (such as e.g. followers), there will be a state mismatch
      that will lead to glitches and issues if you then continue to run and use
      the server.

      So either you know exactly what you are doing, or you are starting
      from a blank slate afterwards by manually clearing out all the local
      data!
    LONG_DESC
…

Après, je tenterai peut-être un

rm -rf /

Juste pour voir, mais j’hésite, c’est osé :-)

Ajouter un commentaire

Les champs suivis d'un * sont obligatoires

Les commentaires peuvent être formatés en utilisant la syntaxe Markdown Extra.

Ajouter un rétrolien

URL de rétrolien : https://open-time.net/trackback/14429

Haut de page