Merge pull request #507 from YunoHost-Apps/ci-auto-update-4.4.3

Upgrade to v4.4.3
This commit is contained in:
Tagada 2025-08-24 16:35:26 +02:00 committed by GitHub
commit d7490e1860
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 38 additions and 15 deletions

View file

@ -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/)

View file

@ -20,7 +20,6 @@ LOCAL_DOMAIN=__DOMAIN__
# -----
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_NAMESPACE=__REDIS_NAMESPACE__
# PostgreSQL
# ----------

View file

@ -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

View file

@ -5,7 +5,7 @@
#=================================================
memory_needed="2560"
ruby_version=3.3.5
ruby_version=3.4.5
nodejs_version=20
case $YNH_ARCH in

View file

@ -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
#=================================================

View file

@ -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
#=================================================

View file

@ -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
#=================================================