From 5ae7e3848a2b5c09fa3657099f64167c38d1dc72 Mon Sep 17 00:00:00 2001 From: panomaki Date: Tue, 4 Apr 2023 19:55:17 +0200 Subject: [PATCH 01/13] Delete app-blurhash-bugfix.patch Fix superfluous. --- sources/patches/app-blurhash-bugfix.patch | 60 ----------------------- 1 file changed, 60 deletions(-) delete mode 100644 sources/patches/app-blurhash-bugfix.patch diff --git a/sources/patches/app-blurhash-bugfix.patch b/sources/patches/app-blurhash-bugfix.patch deleted file mode 100644 index e75702b..0000000 --- a/sources/patches/app-blurhash-bugfix.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/Gemfile b/Gemfile -index 7c36bc6b8..3f691d102 100644 ---- a/Gemfile -+++ b/Gemfile -@@ -22,7 +22,8 @@ - gem 'fog-core', '<= 2.1.0' - gem 'fog-openstack', '~> 0.3', require: false - gem 'kt-paperclip', '~> 7.1' --gem 'blurhash', '~> 0.1' -+gem 'blurhash', github: 'Gargron/blurhash', ref: '870a34e01ce7d09a7bd4d700435e1764ca823246' -+ - - gem 'active_model_serializers', '~> 0.10' - gem 'addressable', '~> 2.8' - -diff --git a/Gemfile.lock b/Gemfile.lock -index 7c36bc6b8..3f691d102 100644 ---- a/Gemfile.lock -+++ b/Gemfile.lock -@@ -7,6 +7,13 @@ - hkdf (~> 0.2) - jwt (~> 2.0) - -+GIT -+ remote: https://github.com/Gargron/blurhash.git -+ revision: 870a34e01ce7d09a7bd4d700435e1764ca823246 -+ ref: 870a34e01ce7d09a7bd4d700435e1764ca823246 -+ specs: -+ blurhash (0.1.6) -+ - GEM - remote: https://rubygems.org/ - specs: -@@ -120,8 +127,6 @@ - bindata (2.4.10) - binding_of_caller (1.0.0) - debug_inspector (>= 0.0.1) -- blurhash (0.1.6) -- ffi (~> 1.14) - bootsnap (1.13.0) - msgpack (~> 1.2) - brakeman (5.3.1) -@@ -448,7 +453,7 @@ - openssl-signature_algorithm (1.2.1) - openssl (> 2.0, < 3.1) - orm_adapter (0.5.0) -- ox (2.14.11) -+ ox (2.14.13) - parallel (1.22.1) - parser (3.1.2.1) - ast (~> 2.4.1) -@@ -738,7 +743,7 @@ - aws-sdk-s3 (~> 1.114) - better_errors (~> 2.9) - binding_of_caller (~> 1.0) -- blurhash (~> 0.1) -+ blurhash! - bootsnap (~> 1.13.0) - brakeman (~> 5.3) - browser From 41cd265505e67caa7bf7da5bdeeab06ea60c1f32 Mon Sep 17 00:00:00 2001 From: panomaki Date: Tue, 4 Apr 2023 19:57:21 +0200 Subject: [PATCH 02/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 795d8e5..d9832d6 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Mastodon is a free, open-source microblogging social network. It is a decentralized alternative to commercial platforms like Twitter and avoids the risks of a single company monopolizing your communication for commercial purposes. -**Shipped version:** 4.0.2~ynh2 +**Shipped version:** 4.1.2~ynh1 **Demo:** https://joinmastodon.org/ From 68a543146c739fd31d200b52b2f92dc92c57060a Mon Sep 17 00:00:00 2001 From: panomaki Date: Tue, 4 Apr 2023 19:57:46 +0200 Subject: [PATCH 03/13] Update README_fr.md --- README_fr.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_fr.md b/README_fr.md index 9db805c..30de3c7 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Mastodon est un réseau social de microblog auto-hébergé et open source. C'est une alternative décentralisée aux plates-formes commerciales comme Twitter. Mastodon évite ainsi les risques qu'une seule société monopolise votre communication à des fins commerciales. -**Version incluse :** 4.0.2~ynh2 +**Version incluse :** 4.1.2~ynh1 **Démo :** https://joinmastodon.org/ @@ -95,4 +95,4 @@ ou sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh/tree/testing --debug ``` -**Plus d’infos sur le packaging d’applications :** \ No newline at end of file +**Plus d’infos sur le packaging d’applications :** From dad53a85fdd4e9303a870d3d0ad738ab9769e225 Mon Sep 17 00:00:00 2001 From: panomaki Date: Tue, 4 Apr 2023 19:58:33 +0200 Subject: [PATCH 04/13] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 871809b..8abc517 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Libre and federated social network", "fr": "Réseau social libre et fédéré" }, - "version": "4.0.2~ynh2", + "version": "4.1.2~ynh1", "url": "https://github.com/mastodon/mastodon", "upstream": { "license": "AGPL-3.0-or-later", From a0fc18466a33387ec29c568b840d43f00c0942d5 Mon Sep 17 00:00:00 2001 From: panomaki Date: Tue, 4 Apr 2023 20:00:49 +0200 Subject: [PATCH 05/13] Update app.src --- conf/app.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.src b/conf/app.src index dbf6513..7df3b2a 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/tootsuite/mastodon/archive/refs/tags/v4.0.2.tar.gz -SOURCE_SUM=70a4d9dcd9b746f6e9ced9b567ee5ad81e530cfaccb7f471259b917c20166309 +SOURCE_URL=https://github.com/tootsuite/mastodon/archive/refs/tags/v4.1.2.tar.gz +SOURCE_SUM=12837c7b57acc11ebd24b23a270500c8917459ecdc2a841ba452296b02bcaf29 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true From f54bf9ea0112362d65fa1803d954aebf4890d08a Mon Sep 17 00:00:00 2001 From: panomaki Date: Tue, 4 Apr 2023 20:10:16 +0200 Subject: [PATCH 06/13] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 1b9fd22..8fb5cec 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,7 +9,7 @@ pkg_dependencies="imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file git build_pkg_dependencies="" memory_needed="2560" -ruby_version=3.0.3 +ruby_version=3.0.6 nodejs_version=16 # Workaround for Mastodon on Bullseye From 60394c8c0044cbbed5273dd462fbf0b38820d474 Mon Sep 17 00:00:00 2001 From: panomaki Date: Wed, 12 Apr 2023 07:52:27 +0200 Subject: [PATCH 07/13] Update checked upgrade paths Changed version upgrades to latest 3.5.3 and 4.0.2 versions. --- check_process | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/check_process b/check_process index eda9f29..488396a 100644 --- a/check_process +++ b/check_process @@ -12,16 +12,10 @@ setup_private=1 setup_public=1 upgrade=1 - # 3.4.1~ynh1 - #upgrade=1 from_commit=efbdbb05350b820c6e59a7bbbf70f57cf679fff8 - # 3.4.1~ynh4 - #upgrade=1 from_commit=adec07db890dec787416e1b7c4493d24391d3500 - # 3.4.4~ynh1 - #upgrade=1 from_commit=4d413848bf444586e28f3658de0ebe36d6ebf059 - # 3.5.3~ynh1 - upgrade=1 from_commit=acdc124f76fb9724cb22acb18c45cf0c3c2e62b5 # 3.5.3~ynh3 upgrade=1 from_commit=efa2d628920edce255ff406b28a97b1dd20e3d74 + # 4.02~ynh2 + upgrade=1 from_commit=94381183ca2d14da72234b53c9a83972ffb16e54 backup_restore=1 multi_instance=0 change_url=0 From 6f94c6315a85fb3a0d304d02e55f8bedb89c6fd5 Mon Sep 17 00:00:00 2001 From: panomaki Date: Wed, 12 Apr 2023 11:13:14 +0200 Subject: [PATCH 08/13] Update check_process --- check_process | 2 -- 1 file changed, 2 deletions(-) diff --git a/check_process b/check_process index 488396a..8714241 100644 --- a/check_process +++ b/check_process @@ -12,8 +12,6 @@ setup_private=1 setup_public=1 upgrade=1 - # 3.5.3~ynh3 - upgrade=1 from_commit=efa2d628920edce255ff406b28a97b1dd20e3d74 # 4.02~ynh2 upgrade=1 from_commit=94381183ca2d14da72234b53c9a83972ffb16e54 backup_restore=1 From 21a9f171b83de4bc8cace4f41c81b28f7661deac Mon Sep 17 00:00:00 2001 From: panomaki Date: Wed, 12 Apr 2023 11:29:34 +0200 Subject: [PATCH 09/13] Update README.md --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index d9832d6..138b62e 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,22 @@ $ screen -r `$ sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh --debug ` +Upgrading from 3.5.3 to 4.1.2 directly has not been integration-tested. It is recommended to do a two-step upgrade: + +Mastodon can grow huge. You could consider cleaning up your local cache first as otherwise your backup will be very big: +'sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media remove --days=0 --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=0' + +First upgrade to 4.0.2~ynh2: + +`$ sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh/tree/94381183ca2d14da72234b53c9a83972ffb16e54 --debug ` + +Check your installation. If all looks well, upgrade to 4.1.2~ynh1: + +`$ sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh --debug ` + + ### Administrate with tooctl `$ (cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl --help)` From 30f48695dae1594af4ad43a081fe5387378e70ce Mon Sep 17 00:00:00 2001 From: panomaki Date: Wed, 12 Apr 2023 11:30:43 +0200 Subject: [PATCH 10/13] Update README.md --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 138b62e..fc27836 100644 --- a/README.md +++ b/README.md @@ -60,9 +60,12 @@ $ screen -r Upgrading from 3.5.3 to 4.1.2 directly has not been integration-tested. It is recommended to do a two-step upgrade: Mastodon can grow huge. You could consider cleaning up your local cache first as otherwise your backup will be very big: -'sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media remove --days=0 --dry-run' + +`$ sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media remove --days=0 --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=0' + +`$ sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media remove --days=0 ` First upgrade to 4.0.2~ynh2: From 736ca816d7e4778e2510bce0eb74892a857df6c4 Mon Sep 17 00:00:00 2001 From: panomaki Date: Thu, 13 Apr 2023 13:23:46 +0200 Subject: [PATCH 11/13] Update README.md Added extra explanations. --- README.md | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fc27836..0773938 100644 --- a/README.md +++ b/README.md @@ -53,19 +53,35 @@ $ screen -r ### Update -#### Using *screen* highly recommended +##### Please use screen as the upgrade process can take a long time! -`$ sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh --debug ` +#### A note about backups -Upgrading from 3.5.3 to 4.1.2 directly has not been integration-tested. It is recommended to do a two-step upgrade: +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: -Mastodon can grow huge. You could consider cleaning up your local cache first as otherwise your backup will be very big: +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 remove --days=0 --dry-run` +`$ 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` 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=0 ` +`$ sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media remove --days=X ` + +##### Upgrade + +The actual upgrade can be done using the following command: + +`$ sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh --debug ` + + +Upgrading from 3.5.3 to 4.1.2 directly has not been integration-tested. It is recommended to do a two-step upgrade: First upgrade to 4.0.2~ynh2: From 28593d50084cd9b865df7648cb23d5bc636373f8 Mon Sep 17 00:00:00 2001 From: panomaki Date: Thu, 13 Apr 2023 16:45:56 +0200 Subject: [PATCH 12/13] Update README.md Extra sentence and link to screen tutorial. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0773938..40e405e 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,10 @@ Mastodon is a free, open-source microblogging social network. It is a decentrali ### Install #### Using *screen* in case of disconnect + +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. + ``` $ sudo apt-get install screen $ screen From c78db950cfa0cfbccf63bba6357d401f99db7e13 Mon Sep 17 00:00:00 2001 From: lapineige Date: Thu, 13 Apr 2023 23:19:06 +0200 Subject: [PATCH 13/13] Cleaning + v4.1 --- README_fr.md | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/README_fr.md b/README_fr.md index 30de3c7..3d52153 100644 --- a/README_fr.md +++ b/README_fr.md @@ -36,15 +36,15 @@ Mastodon est un réseau social de microblog auto-hébergé et open source. C'est 1. À la fin de l'installation, un mail est envoyé à cet utilisateur avec un mot de passe généré automatiquement. 1. Pour que votre instance Mastodon reste privée, il est important de fermer les inscriptions. Nous vous invitons à bloquer les instances distantes indésirables depuis l'interface d'administration. Vous pouvez également ajouter un texte sur votre page d'accueil dans l'administration. -## Captures d'écran - -![](https://framalibre.org/sites/default/files/mastodon.png) - ## Configuration ### Installation #### Utilisation de *screen* en cas de déconnection + +Screen (or 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. + ``` $ sudo apt-get install screen $ screen @@ -55,11 +55,42 @@ Récupérer l'installation après une deconnection : $ screen -d $ screen -r ``` -L'utilisateur admin est créé automatiquement comme : user@domain.tld ### Mise à jour -#### Utilisation de *screen* fortement recommandée +**Utilisation de *screen* fortement recommandée** + +### Note à propos des sauvegardes + +Tout d'abord : Mastodon utilise un cache local pour sauvegarder les médias (comme les images, vidéos, etc). Ce cache peut devenir énorme. +Vous devriez réfléchir à vider votre cache local avant de faire une sauvegarde, qui pourrait être énorme et vous pourriez manquer d'espace de stockage. + +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` + +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` + +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 ` + +##### Upgrade + +La mise à niveau proprement dite peut être effectuée à l'aide de la commande suivante : + +`$ sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh --debug ` + + +Mettre à niveau de 3.5.3 en 4.1.2 directement n'a pas été testé automatiquement. Il est donc recommandé de la réaliser en 2 étapes : + +Mettez d'abord à niveau en 4.0.2~ynh2: + +`$ sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh/tree/94381183ca2d14da72234b53c9a83972ffb16e54 --debug ` + +Vérifiez votre installation. Si cela semble bon, mettez à niveau en 4.1.2~ynh1: `$ sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh --debug `