diff --git a/README.md b/README.md index 103ebcd..488481d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Mastodon for YunoHost -[![Latest Version](https://img.shields.io/badge/version-2.4.0-green.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/releases) +[![Latest Version](https://img.shields.io/badge/version-2.4.1-green.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/releases) [![Status](https://img.shields.io/badge/status-testing-yellow.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/milestones) [![Dependencies](https://img.shields.io/badge/dependencies-includes-lightgrey.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh#dependencies) [![GitHub license](https://img.shields.io/badge/license-GPLv3-blue.svg?style=flat)](https://raw.githubusercontent.com/YunoHost-Apps/mastodon_ynh/master/LICENSE) -[![Yunohost version](https://img.shields.io/badge/yunohost-2.7.7_tested-orange.svg?style=flat)](https://github.com/YunoHost/yunohost) +[![Yunohost version](https://img.shields.io/badge/yunohost-2.7.12_tested-orange.svg?style=flat)](https://github.com/YunoHost/yunohost) [![GitHub issues](https://img.shields.io/github/issues/YunoHost-Apps/mastodon_ynh.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/issues) [![Install Mastodon with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=mastodon) diff --git a/conf/app-mastodon.src b/conf/app-mastodon.src index 84b72fb..61c7260 100644 --- a/conf/app-mastodon.src +++ b/conf/app-mastodon.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v2.4.0.tar.gz -SOURCE_SUM=3d4904f30c28591333b1cf4c03173849dd6983ab00685f61e50e594160c672ee +SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v2.4.1.tar.gz +SOURCE_SUM=d90b573e16359f63f7b2834f1078ecfdd7d78cd5a26acd8293a314dd2b6ff1ec SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 3e6e9b4..11c277b 100644 --- a/manifest.json +++ b/manifest.json @@ -9,7 +9,7 @@ "en": "Mastodon is a free, open-source social network.", "fr": "Mastodon est un réseau social gratuit et open source." }, - "version": "2.4.0", + "version": "2.4.1", "url": "https://github.com/tootsuite/mastodon", "license": "AGPL-3.0-or-later", "maintainer": { diff --git a/scripts/backup b/scripts/backup index 0846afe..f32dfdd 100644 --- a/scripts/backup +++ b/scripts/backup @@ -33,7 +33,11 @@ app=$YNH_APP_INSTANCE_NAME # Retrieve app settings domain=$(ynh_app_setting_get "$app" domain) final_path=$(ynh_app_setting_get "$app" final_path) -db_name=$(ynh_sanitize_dbid "$app") +db_name=$(ynh_app_setting_get "$app" db_name) +if [ -z "$db_name" ]; then + db_name="${app}_production" + ynh_app_setting_set "$app" db_name "$db_name" +fi #================================================= # STANDARD BACKUP STEPS diff --git a/scripts/install b/scripts/install index cbce4e3..90a8dfc 100644 --- a/scripts/install +++ b/scripts/install @@ -124,8 +124,10 @@ ynh_install_app_dependencies \ ynh_psql_test_if_first_run db_user=$(ynh_sanitize_dbid "$app") -db_name=$(ynh_sanitize_dbid "$app") +db_name="${app}_production" +db_name=$(ynh_sanitize_dbid "$db_name") db_pwd=$(ynh_string_random) +ynh_app_setting_set $app db_name $db_name ynh_app_setting_set $app db_pwd $db_pwd ynh_psql_setup_db "$db_user" "$db_name" "$db_pwd" @@ -220,7 +222,7 @@ sed -i "s@#SMTP_OPENSSL_VERIFY_MODE=peer@SMTP_OPENSSL_VERIFY_MODE=none@g" "${fin $final_path/live/bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without development test --quiet yarn install --production --no-progress --non-interactive --silent echo "SAFETY_ASSURED=1">> .env.production - RAILS_ENV=production $final_path/live/bin/bundle exec rails db:migrate --quiet + RAILS_ENV=production $final_path/live/bin/bundle exec rails db:setup --quiet RAILS_ENV=production $final_path/live/bin/bundle exec rails assets:precompile --quiet INSTALL ) diff --git a/scripts/remove b/scripts/remove index e939908..470455e 100644 --- a/scripts/remove +++ b/scripts/remove @@ -22,8 +22,11 @@ app=$YNH_APP_INSTANCE_NAME # Retrieve app settings domain=$(ynh_app_setting_get "$app" domain) db_name=$(ynh_app_setting_get "$app" db_name) +if [ -z "$db_name" ]; then + db_name="${app}_production" + ynh_app_setting_set "$app" db_name "$db_name" +fi db_user=$(ynh_sanitize_dbid "$app") -db_name=$(ynh_sanitize_dbid "$app") final_path=$(ynh_app_setting_get "$app" final_path) #================================================= diff --git a/scripts/restore b/scripts/restore index a800966..b41b9cd 100644 --- a/scripts/restore +++ b/scripts/restore @@ -89,10 +89,10 @@ fi # Install source.list debian package backports & yarn if [ "$(lsb_release --codename --short)" == "jessie" ]; then - cp ../conf/backports.list /etc/apt/sources.list.d/ + cp ../conf/apt_backports.list /etc/apt/sources.list.d/ fi curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - -cp ../conf/yarn.list /etc/apt/sources.list.d/ +cp ../conf/apt_yarn.list /etc/apt/sources.list.d/yarn.list ynh_package_update # Install de Node.js @@ -124,7 +124,11 @@ ynh_install_app_dependencies \ # Restore PostgreSQL database db_user=$(ynh_sanitize_dbid "$app") -db_name=$(ynh_sanitize_dbid "$app") +db_name=$(ynh_app_setting_get "$app" db_name) +if [ -z "$db_name" ]; then + db_name="${app}_production" + ynh_app_setting_set "$app" db_name "$db_name" +fi db_pwd=$(ynh_app_setting_get "$app" db_pwd) ynh_psql_test_if_first_run diff --git a/scripts/upgrade b/scripts/upgrade index 3858ee8..d50b729 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers # See comments in install script app=$YNH_APP_INSTANCE_NAME -db_name=$app +db_name=$(ynh_app_setting_get "$app" db_name) # Retrieve app settings domain=$(ynh_app_setting_get "$app" domain) @@ -31,7 +31,7 @@ path_url="/" # If db_name doesn't exist, create it if [ -z "$db_name" ]; then - db_name=$(ynh_sanitize_dbid "$app") + db_name="${app}_production" ynh_app_setting_set "$app" db_name "$db_name" fi @@ -115,7 +115,7 @@ ynh_setup_source "$final_path/.rbenv/plugins/ruby-build" "app-ruby-build" # Install ruby 2.5.1 ( - exec_as "$app" $final_path/.rbenv/bin/rbenv install 2.5.1 || true + exec_as "$app" $final_path/.rbenv/bin/rbenv install -s 2.5.1 || true exec_as "$app" $final_path/.rbenv/bin/rbenv global 2.5.1 || true exec_as "$app" $final_path/.rbenv/versions/2.5.1/bin/ruby -v )