aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml7
-rw-r--r--README.md2
-rw-r--r--README_fr.md2
-rw-r--r--check_process3
-rw-r--r--conf/.env.production.sample3
-rw-r--r--conf/app.src4
-rw-r--r--conf/cron2
-rw-r--r--conf/mastodon-sidekiq.service2
-rw-r--r--conf/mastodon-web.service2
-rw-r--r--manifest.json2
-rw-r--r--pull_request_template.md23
-rw-r--r--scripts/install14
-rw-r--r--scripts/restore4
-rw-r--r--scripts/upgrade52
14 files changed, 84 insertions, 38 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..6133a24
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,7 @@
+language: python
+
+before_install:
+ - git clone https://github.com/YunoHost/package_linter /tmp/package_linter
+
+script:
+- /tmp/package_linter/package_linter.py ./ \ No newline at end of file
diff --git a/README.md b/README.md
index f96ab4b..0826c19 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 d2a85ff..cff9697 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/check_process b/check_process
index c0b524a..920d54f 100644
--- a/check_process
+++ b/check_process
@@ -15,7 +15,8 @@
upgrade=1 from_commit=2987ccf8b3aa393dbef79b874dfe5839a0ee10da
backup_restore=1
multi_instance=1
- incorrect_path=1
+ # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version.
+ # incorrect_path=1
port_already_use=0
change_url=0
;;; Levels
diff --git a/conf/.env.production.sample b/conf/.env.production.sample
index c2324a8..203b74b 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=
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/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/manifest.json b/manifest.json
index ed18471..2ba4b98 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": [
diff --git a/pull_request_template.md b/pull_request_template.md
new file mode 100644
index 0000000..c4fe903
--- /dev/null
+++ b/pull_request_template.md
@@ -0,0 +1,23 @@
+## Problem
+- *Description of why you made this PR*
+
+## Solution
+- *And how do you fix that problem*
+
+## PR Status
+- [ ] Code finished.
+- [ ] Tested with Package_check.
+- [ ] Fix or enhancement tested.
+- [ ] Upgrade from last version tested.
+- [ ] Can be reviewed and tested.
+
+## Validation
+---
+- [ ] **Code review**
+- [ ] **Approval (LGTM)**
+*Code review and approval have to be from a member of @YunoHost/apps group*
+- **CI succeeded** :
+[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/mastodon_ynh%20-BRANCH-/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/mastodon_ynh%20-BRANCH-/)
+*Please replace '-BRANCH-' in this link by the name of the branch used.*
+*If the PR is from a forked repository. Please provide public results from package_check.*
+When the PR is marked as ready to merge, you have to wait for 3 days before really merging it.
diff --git a/scripts/install b/scripts/install
index 29058f6..ff03433 100644
--- a/scripts/install
+++ b/scripts/install
@@ -154,9 +154,9 @@ ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
ynh_script_progression --message="Installing Ruby..." --weight=424
-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
@@ -194,12 +194,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 ce097c4..e85815c 100644
--- a/scripts/restore
+++ b/scripts/restore
@@ -108,8 +108,8 @@ ynh_install_app_dependencies $pkg_dependencies
#=================================================
ynh_script_progression --message="Installing Ruby..." --weight=393
-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 cb2c66e..7562d85 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -71,7 +71,7 @@ fi
# If paperclip_secret doesn't exist, retrieve it or create it
if [[ -z "$paperclip_secret" ]]; then
- paperclip_secret=$(grep -oP "PAPERCLIP_SECRET=\K\w+" test)
+ paperclip_secret=$(grep -oP "PAPERCLIP_SECRET=\K\w+" ${final_path}/live/.env.production)
if [[ -z "$paperclip_secret" ]]; then
paperclip_secret=$(head -n128 /dev/urandom | tail -n +1 | tr -dc -d 'a-z0-9' | head -c128)
fi
@@ -80,7 +80,7 @@ fi
# If secret_key_base doesn't exist, retrieve it or create it
if [[ -z "$secret_key_base" ]]; then
- secret_key_base=$(grep -oP "SECRET_KEY_BASE=\K\w+" test)
+ secret_key_base=$(grep -oP "SECRET_KEY_BASE=\K\w+" ${final_path}/live/.env.production)
if [[ -z "$secret_key_base" ]]; then
secret_key_base=$(head -n128 /dev/urandom | tail -n +1 | tr -dc -d 'a-z0-9' | head -c128)
fi
@@ -89,13 +89,21 @@ fi
# If otp_secret doesn't exist, retrieve it or create it
if [[ -z "$otp_secret" ]]; then
- otp_secret=$(grep -oP "OTP_SECRET=\K\w+" test)
+ otp_secret=$(grep -oP "OTP_SECRET=\K\w+" ${final_path}/live/.env.production)
if [[ -z "$otp_secret" ]]; then
otp_secret=$(head -n128 /dev/urandom | tail -n +1 | tr -dc -d 'a-z0-9' | head -c128)
fi
ynh_app_setting_set --app=$app --key=otp_secret --value="$otp_secret"
fi
+# If vapid_private_key doesn't exist, retrieve it or create it
+if [[ -z "$vapid_private_key" ]]; then
+ vapid_private_key=$(grep -oP "VAPID_PRIVATE_KEY=\K\w+" ${final_path}/live/.env.production)
+ vapid_public_key=$(grep -oP "VAPID_PUBLIC_KEY=\K\w+" ${final_path}/live/.env.production)
+ ynh_app_setting_set "$app" vapid_private_key "$vapid_private_key"
+ ynh_app_setting_set "$app" vapid_public_key "$vapid_public_key"
+fi
+
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@@ -185,9 +193,9 @@ ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
ynh_script_progression --message="Installing Ruby..." --weight=424
-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
@@ -210,6 +218,9 @@ ynh_replace_string --match_string="__SECRET_KEY_BASE__" --replace_string="$secre
ynh_replace_string --match_string="__OTP_SECRET__" --replace_string="$otp_secret" --target_file="$final_path/live/.env.production"
+ynh_replace_string "__VAPID_PRIVATE_KEY__" "$vapid_private_key" "$final_path/live/.env.production"
+ynh_replace_string "__VAPID_PUBLIC_KEY__" "$vapid_public_key" "$final_path/live/.env.production"
+
#=================================================
# UPGRADE MASTODON
#=================================================
@@ -220,25 +231,28 @@ 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
- 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="$app" --key=vapid_private_key --value="$vapid_private_key"
- ynh_app_setting_set --app="$app" --key=vapid_public_key --value="$vapid_public_key"
- ynh_secure_remove --file="$final_path/live/key.txt"
-fi
+#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
+# 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"
+# ynh_app_setting_set "$app" vapid_public_key "$vapid_public_key"
+# ynh_secure_remove "$final_path/live/key.txt"
+# ynh_replace_string "__VAPID_PRIVATE_KEY__" "$vapid_private_key" "${final_path}/live/.env.production"
+# ynh_replace_string "__VAPID_PUBLIC_KEY__" "$vapid_public_key" "${final_path}/live/.env.production"
+#fi
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="${final_path}/live/.env.production"