mirror of
https://github.com/YunoHost-Apps/mastodon_ynh.git
synced 2024-09-03 19:46:02 +02:00
add tootctl self-destruct
info
This commit is contained in:
parent
2b92862963
commit
7cebe3ae4f
2 changed files with 65 additions and 15 deletions
40
doc/ADMIN.md
40
doc/ADMIN.md
|
@ -7,30 +7,54 @@
|
|||
**`screen` (or `tmux`) can be used to make sure your session is not interrupted in case of connection problems.**
|
||||
See [tutorial](https://www.howtogeek.com/662422/how-to-use-linuxs-screen-command/) for more background information.
|
||||
|
||||
```
|
||||
$ screen
|
||||
$ sudo yunohost app upgrade mastodon
|
||||
```bash
|
||||
screen
|
||||
sudo yunohost app upgrade mastodon
|
||||
```
|
||||
|
||||
## Backups
|
||||
|
||||
First of all: Mastodon uses a local cache to save media (such as posted images, videos etc.). This cache can grow huge.
|
||||
First of all: Mastodon uses a local cache to save media (such as posted images, videos etc.). This cache can grow huge.
|
||||
You could consider cleaning up your local cache first as otherwise your backup will be very big and you might run out of disk space:
|
||||
|
||||
To check your space usage, on a command line run:
|
||||
|
||||
`$ sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media usage`
|
||||
```bash
|
||||
sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media usage
|
||||
```
|
||||
|
||||
If your cache is too big to backup, you can run the following command to clean up Attachments (the first line). Substitute X by the number of days you want to keep, e.g. 1 day. All older images will be deleted but will be refetched from the original server if necessary.
|
||||
|
||||
First dry-run to see how much space is freed up (without actually removing):
|
||||
|
||||
`$ sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media remove --days=X --dry-run`
|
||||
```bash
|
||||
sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media remove --days=X --dry-run`
|
||||
```
|
||||
|
||||
If all looks good commit the cleanup:
|
||||
|
||||
`$ sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media remove --days=X `
|
||||
```bash
|
||||
sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media remove --days=X`
|
||||
```
|
||||
|
||||
Check [the official documentation](https://docs.joinmastodon.org/admin/tootctl/#media-remove) for more details.
|
||||
|
||||
## Before your Mastodon instance deletion
|
||||
|
||||
Before definitively uninstalling Mastodon, you have to run `tootctl self-destruct` to broadcast your users and instance deletion to the federation.
|
||||
Otherwise your data will remain in federation cache for ever.
|
||||
|
||||
⚠️ Make sure you know exactly what you are doing before running this command.
|
||||
⚠️ This operation is NOT reversible, and it can take a long time.
|
||||
⚠️ The server will be in a BROKEN STATE after this command finishes. A running Sidekiq process is required, so do not shut down the server until the queues are fully cleared.
|
||||
|
||||
```bash
|
||||
screen
|
||||
sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl self-destruct
|
||||
```
|
||||
|
||||
Check [the official documentation](https://docs.joinmastodon.org/admin/tootctl/#self-destruct) for more details.
|
||||
|
||||
## Known Bugs
|
||||
|
||||
- Log-out from YunoHost's portal doesn't log out from Mastodon. See https://github.com/YunoHost/issues/issues/501
|
||||
- Log-out from YunoHost's portal doesn't log out from Mastodon. See <https://github.com/YunoHost/issues/issues/501>
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
**`screen` (ou `tmux`) peut être utilisé pour vous assurer que votre session n'est pas interrompue en cas de problème de connection.**
|
||||
Consultez ce [tutoriel](https://www.howtogeek.com/662422/how-to-use-linuxs-screen-command/) pour plus de détails.
|
||||
|
||||
```
|
||||
$ screen
|
||||
$ sudo yunohost app upgrade mastodon
|
||||
```bash
|
||||
screen
|
||||
sudo yunohost app upgrade mastodon
|
||||
```
|
||||
|
||||
## Sauvegardes
|
||||
|
@ -19,16 +19,42 @@ Vous devriez réfléchir à vider votre cache local avant de faire une sauvegard
|
|||
|
||||
Pour vérifier l'utilisation du stockage, en ligne de commande utilisez :
|
||||
|
||||
`$ sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media usage`
|
||||
```bash
|
||||
sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media usage
|
||||
```
|
||||
|
||||
Si le cache est trop gros pour être sauvegardé, vous pouvez lancer la commande suivante pour en supprimer les médias attachés. Changez `X` par le nombre de cache à conserver, par ex. 1 jour. Tous les médias plus anciens seront supprimés, mais ils pourront être rechargé du serveur d'origine si nécessaire.
|
||||
|
||||
En premier faite un essai à blanc pour voir combien de place sera libérée (sans rien supprimer):
|
||||
`$ sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media remove --days=X --dry-run`
|
||||
|
||||
```bash
|
||||
sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media remove --days=X --dry-run`
|
||||
```
|
||||
|
||||
Si cela semble bon, effectuez le nettoyage :
|
||||
`$ sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media remove --days=X `
|
||||
|
||||
```bash
|
||||
sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media remove --days=X
|
||||
```
|
||||
|
||||
Consulter [la documentation officielle](<https://docs.joinmastodon.org/admin/tootctl/#media-remove>) pour plus de détails.
|
||||
|
||||
## Avant la suppression de votre instance Mastodon
|
||||
|
||||
Avant de désinstaller définitivement Mastodon, vous devez lancer `tootctl self-destruct` pour annoncer à la fédération la suppression de vos utilisateurs et de votre instance.
|
||||
Sinon, vos données resteront dans le cache de la fédération pour toujours.
|
||||
|
||||
⚠️ Assurez-vous de savoir exactement ce que vous faites avant d'exécuter cette commande.
|
||||
⚠️ Cette opération n'est PAS réversible et peut prendre beaucoup de temps.
|
||||
⚠️ Le serveur sera dans un ÉTAT BRISÉ après la fin de cette commande. Un processus Sidekiq en cours d'exécution est nécessaire, donc n'arrêtez pas le serveur avant que les files d'attente ne soient complètement vidées.
|
||||
|
||||
```bash
|
||||
écran
|
||||
sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl self-destruct
|
||||
```
|
||||
|
||||
Consulter [la documentation officielle](<https://docs.joinmastodon.org/admin/tootctl/#self-destruct>) pour plus de détails.
|
||||
|
||||
## Bugs connus
|
||||
|
||||
- Se déconnecter depuis le portail YunoHost ne vous déconnecte pas de Mastodon. Voir https://github.com/YunoHost/issues/issues/501
|
||||
- Se déconnecter depuis le portail YunoHost ne vous déconnecte pas de Mastodon. Voir <https://github.com/YunoHost/issues/issues/501>
|
||||
|
|
Loading…
Add table
Reference in a new issue