From 94c7d91769145cba348093b6b9a0be1e042d4c53 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 10 May 2019 17:08:03 +0200 Subject: [PATCH 1/5] Upgrade to 2.8.2 --- README.md | 2 +- README_fr.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f50442a..641bda4 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview Mastodon is a free, open-source social network. A decentralized alternative to commercial platforms, it avoids the risks of a single company monopolizing your communication. Pick a server that you trust — whichever you choose, you can interact with everyone else. Anyone can run their own Mastodon instance and participate in the social network seamlessly. -**Shipped version:** 2.7.4 +**Shipped version:** 2.8.2 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 6ee9aba..487df40 100644 --- a/README_fr.md +++ b/README_fr.md @@ -15,7 +15,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble Mastodon est un réseau social gratuit et open source. Une alternative décentralisée aux plates-formes commerciales, elle évite les risques d'une seule société qui monopolise votre communication. Choisissez un serveur sur lequel vous faites confiance - selon votre choix, vous pouvez interagir avec tous les autres. N'importe qui peut exécuter sa propre instance de Mastodon et participer au réseau social de façon transparente. -**Version incluse:** 2.7.4 +**Version incluse:** 2.8.2 ## Captures d'écran diff --git a/conf/app.src b/conf/app.src index 9d7227b..f3c9cdd 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v2.7.4.tar.gz -SOURCE_SUM=0e542c57228d482a068b05f639d8fe53dd9d413f7e7ce93cd1a088bd4d8d8366 +SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v2.8.2.tar.gz +SOURCE_SUM=b6f4aec3f9f6ff053b548c7eb3921347904eb366636a5e417fef97f6adb3c337 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index fd70341..693d840 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Mastodon is a free, open-source social network.", "fr": "Mastodon est un réseau social gratuit et open source." }, - "version": "2.7.4~ynh1", + "version": "2.8.2~ynh1", "url": "https://github.com/tootsuite/mastodon", "license": "AGPL-3.0-or-later", "maintainer": { From cbbe9d3cc53f6b9445b592ca7949ffc2cfbc0055 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 10 May 2019 17:24:58 +0200 Subject: [PATCH 2/5] Add cache clear --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index b90dddd..0cbd88a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -229,6 +229,7 @@ pushd "$final_path/live" sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rails assets:clean sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rails assets:precompile sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rails db:migrate + sudo -u "$app" env PATH=$PATH RAILS_ENV=production bin/tootctl cache clear popd # If vapid_private_key doesn't exist, retrieve it or create it From c8a9c0321297570867c4b7404f9693b709c9889b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 10 May 2019 17:28:21 +0200 Subject: [PATCH 3/5] upgrade to ruby 2.6.1 --- conf/cron | 2 +- conf/mastodon-sidekiq.service | 2 +- conf/mastodon-web.service | 2 +- scripts/install | 14 +++++++------- scripts/restore | 4 ++-- scripts/upgrade | 18 +++++++++--------- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/conf/cron b/conf/cron index 2c319fa..6463d70 100644 --- a/conf/cron +++ b/conf/cron @@ -1,2 +1,2 @@ RAILS_ENV=production -@daily cd __FINAL__PATH__/live && /opt/rbenv/versions/2.6.0/bin/bundle exec rake __USER__:media:remove_remote +@daily cd __FINAL__PATH__/live && /opt/rbenv/versions/2.6.1/bin/bundle exec rake __USER__:media:remove_remote diff --git a/conf/mastodon-sidekiq.service b/conf/mastodon-sidekiq.service index 920fcf4..cd7db81 100644 --- a/conf/mastodon-sidekiq.service +++ b/conf/mastodon-sidekiq.service @@ -9,7 +9,7 @@ Environment="RAILS_ENV=production" Environment="DB_POOL=25" Environment="MALLOC_ARENA_MAX=2" - ExecStart=/opt/rbenv/versions/2.6.0/bin/bundle exec sidekiq -c 25 + ExecStart=/opt/rbenv/versions/2.6.1/bin/bundle exec sidekiq -c 25 TimeoutSec=15 Restart=always StandardError=syslog diff --git a/conf/mastodon-web.service b/conf/mastodon-web.service index c95ba7f..d2f5fdd 100644 --- a/conf/mastodon-web.service +++ b/conf/mastodon-web.service @@ -8,7 +8,7 @@ WorkingDirectory=__FINALPATH__/live Environment="RAILS_ENV=production" Environment="PORT=__PORT_WEB__" - ExecStart=/opt/rbenv/versions/2.6.0/bin/bundle exec puma -C config/puma.rb + ExecStart=/opt/rbenv/versions/2.6.1/bin/bundle exec puma -C config/puma.rb ExecReload=/bin/kill -SIGUSR1 $MAINPID TimeoutSec=15 Restart=always diff --git a/scripts/install b/scripts/install index 337f7be..ac619f8 100644 --- a/scripts/install +++ b/scripts/install @@ -160,9 +160,9 @@ ynh_system_user_create $app $final_path # INSTALLING RUBY AND BUNDLER #================================================= -ynh_install_ruby --ruby_version=2.6.0 -/opt/rbenv/versions/2.6.0/bin/gem update --system -#/opt/rbenv/versions/2.6.0/bin/gem install bundler --no-document +ynh_install_ruby --ruby_version=2.6.1 +/opt/rbenv/versions/2.6.1/bin/gem update --system +#/opt/rbenv/versions/2.6.1/bin/gem install bundler --no-document #================================================= # MODIFY A CONFIG FILE @@ -199,12 +199,12 @@ chown -R "$app": "$final_path" pushd "$final_path/live" ynh_use_nodejs - sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.0/bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without development test + sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.1/bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without development test sudo -u "$app" env PATH=$PATH yarn install --pure-lockfile sudo -u "$app" echo "SAFETY_ASSURED=1">> .env.production - sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rails db:migrate --quiet - sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rails assets:precompile --quiet - sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt + sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rails db:migrate --quiet + sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rails assets:precompile --quiet + sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt sudo -u "$app" env PATH=$PATH RAILS_ENV=production bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=admin > acc.txt popd diff --git a/scripts/restore b/scripts/restore index 6e39fb5..a31fa29 100644 --- a/scripts/restore +++ b/scripts/restore @@ -104,8 +104,8 @@ ynh_install_app_dependencies $pkg_dependencies # INSTALLING RUBY AND BUNDLER #================================================= -ynh_install_ruby --ruby_version=2.6.0 -/opt/rbenv/versions/2.6.0/bin/gem update --system +ynh_install_ruby --ruby_version=2.6.1 +/opt/rbenv/versions/2.6.1/bin/gem update --system #================================================= # RESTORE THE POSTGRESQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index 0cbd88a..98b923f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -187,9 +187,9 @@ ynh_system_user_create $app # INSTALLING RUBY AND BUNDLER #================================================= -ynh_install_ruby --ruby_version=2.6.0 -/opt/rbenv/versions/2.6.0/bin/gem update --system -#/opt/rbenv/versions/2.6.0/bin/gem install bundler +ynh_install_ruby --ruby_version=2.6.1 +/opt/rbenv/versions/2.6.1/bin/gem update --system +#/opt/rbenv/versions/2.6.1/bin/gem install bundler #================================================= # MODIFY A CONFIG FILE @@ -221,20 +221,20 @@ chown -R "$app": "$final_path" pushd "$final_path/live" ynh_use_nodejs if [ "$(lsb_release --codename --short)" == "jessie" ]; then - sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.0/bin/bundle install --deployment --without development test + sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.1/bin/bundle install --deployment --without development test else - sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.0/bin/bundle install --deployment --force --without development test + sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.1/bin/bundle install --deployment --force --without development test fi sudo -u "$app" env PATH=$PATH yarn install --pure-lockfile - sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rails assets:clean - sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rails assets:precompile - sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rails db:migrate + sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rails assets:clean + sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rails assets:precompile + sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rails db:migrate sudo -u "$app" env PATH=$PATH RAILS_ENV=production bin/tootctl cache clear popd # If vapid_private_key doesn't exist, retrieve it or create it if [[ -z "$vapid_private_key" ]]; then - sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt + sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt vapid_private_key=$(grep -oP "VAPID_PRIVATE_KEY=\K\w+" "$final_path/live/key.txt") vapid_public_key=$(grep -oP "VAPID_PUBLIC_KEY=\K\w+" "$final_path/live/key.txt") ynh_app_setting_set "$app" vapid_private_key "$vapid_private_key" From 80f60b149c9643917739511e4e041d02d9ecf335 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 10 May 2019 19:34:48 +0200 Subject: [PATCH 4/5] remove ruby before upgrade --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index 98b923f..55c3b07 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -187,6 +187,7 @@ ynh_system_user_create $app # INSTALLING RUBY AND BUNDLER #================================================= +ynh_remove_ruby ynh_install_ruby --ruby_version=2.6.1 /opt/rbenv/versions/2.6.1/bin/gem update --system #/opt/rbenv/versions/2.6.1/bin/gem install bundler From 7400f8e75d5a194beddb713c2d7794337c8e7eac Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 10 May 2019 20:18:24 +0200 Subject: [PATCH 5/5] Update .env.production.sample --- conf/.env.production.sample | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/.env.production.sample b/conf/.env.production.sample index d6bd0c6..c15eb4a 100644 --- a/conf/.env.production.sample +++ b/conf/.env.production.sample @@ -10,6 +10,7 @@ DB_NAME=__DB_NAME__ DB_PASS=__DB_PWD__ DB_PORT=5432 # Optional ElasticSearch configuration +# You may also set ES_PREFIX to share the same cluster between multiple Mastodon servers (falls back to REDIS_NAMESPACE if not set) # ES_ENABLED=true # ES_HOST=es # ES_PORT=9200 @@ -222,7 +223,7 @@ STREAMING_CLUSTER_NUM=1 # SAML_ATTRIBUTES_STATEMENTS_FULL_NAME="urn:oid:2.16.840.1.113730.3.1.241" # SAML_ATTRIBUTES_STATEMENTS_FIRST_NAME="urn:oid:2.5.4.42" # SAML_ATTRIBUTES_STATEMENTS_LAST_NAME="urn:oid:2.5.4.4" -# SAML_UID_ATTRIBUTE="urn:oid:0.9.2342.19200300.100.1.1" +# SAML_UID_ATTRIBUTE="urn:oid:0.9.2342.19200300.100.1.1" # SAML_ATTRIBUTES_STATEMENTS_VERIFIED= # SAML_ATTRIBUTES_STATEMENTS_VERIFIED_EMAIL=