aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTagada <36127788+Tagadda@users.noreply.github.com>2025-08-24 16:35:26 +0200
committerGitHub <noreply@github.com>2025-08-24 16:35:26 +0200
commitd7490e1860fbfb9a2f05bce4f80f74d7dbe51d59 (patch)
tree9e7a683bf305052f5b19c45b3793878abbc7e223
parent5bcecf75ba756b26027b740a0ae897326f8a5b50 (diff)
parent6f3d2987174de20f1ca0847745013f85363ae324 (diff)
downloadmastodon_ynh-d7490e1860fbfb9a2f05bce4f80f74d7dbe51d59.tar.gz
mastodon_ynh-d7490e1860fbfb9a2f05bce4f80f74d7dbe51d59.tar.bz2
mastodon_ynh-d7490e1860fbfb9a2f05bce4f80f74d7dbe51d59.zip
Merge pull request #507 from YunoHost-Apps/ci-auto-update-4.4.3
Upgrade to v4.4.3
-rw-r--r--README.md6
-rw-r--r--conf/.env.production.sample1
-rw-r--r--manifest.toml13
-rw-r--r--scripts/_common.sh2
-rw-r--r--scripts/install14
-rw-r--r--scripts/restore2
-rw-r--r--scripts/upgrade15
7 files changed, 38 insertions, 15 deletions
diff --git a/README.md b/README.md
index 3fd931c..e285399 100644
--- a/README.md
+++ b/README.md
@@ -12,13 +12,17 @@ Libre and federated social network
[![🌐 Official app website](https://img.shields.io/badge/Official_app_website-darkgreen?style=for-the-badge)](https://joinmastodon.org/)
[![App Demo](https://img.shields.io/badge/App_Demo-blue?style=for-the-badge)](https://joinmastodon.org/)
-[![Version: 4.3.9~ynh1](https://img.shields.io/badge/Version-4.3.9~ynh1-rgba(0,150,0,1)?style=for-the-badge)](https://ci-apps.yunohost.org/ci/apps/mastodon/)
+[![Version: 4.4.3~ynh1](https://img.shields.io/badge/Version-4.4.3~ynh1-rgb(18,138,11)?style=for-the-badge)](https://ci-apps.yunohost.org/ci/apps/mastodon/)
<div align="center">
<a href="https://apps.yunohost.org/app/mastodon"><img height="100px" src="https://github.com/YunoHost/yunohost-artwork/raw/refs/heads/main/badges/neopossum-badges/badge_more_info_on_the_appstore.svg"/></a>
<a href="https://github.com/YunoHost-Apps/mastodon_ynh/issues"><img height="100px" src="https://github.com/YunoHost/yunohost-artwork/raw/refs/heads/main/badges/neopossum-badges/badge_report_an_issue.svg"/></a>
</div>
+
+## Screenshots
+![Screenshot of Mastodon](./doc/screenshots/mastodon.png)
+
## 📩 Developer info
[![Automatic tests level](https://apps.yunohost.org/badge/cilevel/mastodon)](https://ci-apps.yunohost.org/ci/apps/mastodon/)
diff --git a/conf/.env.production.sample b/conf/.env.production.sample
index 2abf6c5..d934fa8 100644
--- a/conf/.env.production.sample
+++ b/conf/.env.production.sample
@@ -20,7 +20,6 @@ LOCAL_DOMAIN=__DOMAIN__
# -----
REDIS_HOST=localhost
REDIS_PORT=6379
-REDIS_NAMESPACE=__REDIS_NAMESPACE__
# PostgreSQL
# ----------
diff --git a/manifest.toml b/manifest.toml
index d9f6108..4f88e38 100644
--- a/manifest.toml
+++ b/manifest.toml
@@ -5,7 +5,7 @@ name = "Mastodon"
description.en = "Libre and federated social network"
description.fr = "Réseau social libre et fédéré"
-version = "4.3.9~ynh1"
+version = "4.4.3~ynh1"
maintainers = ["Tagada"]
@@ -52,10 +52,17 @@ ram.runtime = "500M"
[resources]
[resources.sources]
[resources.sources.main]
- url = "https://github.com/mastodon/mastodon/archive/refs/tags/v4.3.9.tar.gz"
- sha256 = "c969e80032418ddcfbed974093a5b3e4d7b7407e591d34e6ba8efceed6e7c22a"
+ url = "https://github.com/mastodon/mastodon/archive/refs/tags/v4.4.3.tar.gz"
+ sha256 = "ede116b80a525462f5ea68d046a4cdd787930fc6d2f9327c140756311ee07848"
autoupdate.strategy = "latest_github_release"
+ [resources.sources.redis_migration]
+ url = "https://raw.githubusercontent.com/mastodon/redis_namespace_migration/47c6bd9757e7a40f7091b5692d78aef992ea8bf2/rename.rb"
+ sha256 = "3134a5c7e0157ee752f5cb49b942c89480951e94236b03dd1cb3cb1d3afdcdd2"
+ in_subdir = false
+ extract = false
+ rename = "rename.rb"
+
[resources.system_user]
allow_email = true
diff --git a/scripts/_common.sh b/scripts/_common.sh
index 0dbcc15..e894197 100644
--- a/scripts/_common.sh
+++ b/scripts/_common.sh
@@ -5,7 +5,7 @@
#=================================================
memory_needed="2560"
-ruby_version=3.3.5
+ruby_version=3.4.5
nodejs_version=20
case $YNH_ARCH in
diff --git a/scripts/install b/scripts/install
index dfcbb27..2d3e68d 100644
--- a/scripts/install
+++ b/scripts/install
@@ -23,6 +23,8 @@ ynh_script_progression --message="Setting up source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir/live"
+# Download redis migration script
+ynh_setup_source --source_id=redis_migration --dest_dir="$install_dir/live"
chown -R $app:www-data "$install_dir"
@@ -60,9 +62,6 @@ config="$install_dir/live/.env.production"
language="$(echo $language | head -c 2)"
-redis_namespace=${app}_production
-ynh_app_setting_set --app="$app" --key=redis_namespace --value="$redis_namespace"
-
secret_key_base=$(ynh_string_random --length=128)
ynh_app_setting_set --app="$app" --key=secret_key_base --value="$secret_key_base"
@@ -95,7 +94,7 @@ pushd "$install_dir/live"
ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle config deployment 'true'
ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle config without 'development test'
ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle config set force_ruby_platform true --quiet
- ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle install -j$(getconf _NPROCESSORS_ONLN)
+ ynh_exec_warn_less ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle install -j$(getconf _NPROCESSORS_ONLN)
ynh_use_nodejs
env $ynh_node_load_PATH corepack enable
echo Y | ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn workspaces focus --production
@@ -127,10 +126,11 @@ chown $app:$app "$config"
pushd "$install_dir/live"
ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails db:migrate --quiet
- ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:precompile --quiet
+ ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails db:seed --quiet
+ ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:precompile --quiet
# Create the first admin user
- ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=Owner > /dev/null
- ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/tootctl accounts approve "$admin" > /dev/null
+ ynh_exec_quiet ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=Owner
+ ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/tootctl accounts approve "$admin"
popd
#=================================================
diff --git a/scripts/restore b/scripts/restore
index 77e934b..48e1384 100644
--- a/scripts/restore
+++ b/scripts/restore
@@ -66,7 +66,7 @@ pushd "$install_dir/live"
ynh_use_ruby
ynh_gem update --system
ynh_gem install bundler --no-document
- ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle install --redownload -j$(getconf _NPROCESSORS_ONLN)
+ ynh_exec_warn_less ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle install --redownload -j$(getconf _NPROCESSORS_ONLN)
popd
#=================================================
diff --git a/scripts/upgrade b/scripts/upgrade
index f7a3573..746d009 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -104,6 +104,8 @@ then
# Download, check integrity, uncompress and patch the source from manifest.toml
ynh_setup_source --dest_dir="$install_dir/live" --full_replace=1 --keep="public/system .env.production"
+ # Download redis migration script
+ ynh_setup_source --source_id=redis_migration --dest_dir="$install_dir/live"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
@@ -122,7 +124,7 @@ pushd "$install_dir/live"
ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle config deployment 'true'
ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle config without 'development test'
ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle config set force_ruby_platform true --quiet
- ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle install -j$(getconf _NPROCESSORS_ONLN)
+ ynh_exec_warn_less ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle install -j$(getconf _NPROCESSORS_ONLN)
ynh_use_nodejs
env $ynh_node_load_PATH corepack enable
echo Y | ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn workspaces focus --production
@@ -194,6 +196,17 @@ pushd "$install_dir/live"
ynh_use_ruby
ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails db:migrate --quiet
ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:precompile --quiet
+
+ # Apply redis namespace migration (https://github.com/mastodon/redis_namespace_migration)
+ ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/rails runner rename.rb
+ redis_namespace="$(ynh_app_setting_get --app=$app --key=redis_namespace)"
+ if [ $redis_namespace ]; then
+ if [ ynh_app_setting_get --app=$app --key=es_enabled == "true" ] && [ ynh_app_setting_get --app=$app --key=es_prefix == "" ]; then
+ ynh_app_setting_set --app=$app --key=es_prefix --value=$redis_namespace
+ else
+ ynh_app_setting_delete --app=$app --key=redis_namespace
+ fi
+ fi
popd
#=================================================