From 6ad1f63a615e7e7c03a338e5c21f3ec089193491 Mon Sep 17 00:00:00 2001 From: Florent Date: Sat, 3 Dec 2022 22:46:58 +0100 Subject: [PATCH] Fix registration choice not taken into account --- manifest.json | 2 +- scripts/install | 2 ++ scripts/upgrade | 8 ++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index f25b0b8..830bed3 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "A free, federated social networking server built on open protocols.", "fr": "Un serveur de réseautage social fédéré et gratuit basé sur des protocoles ouverts." }, - "version": "2.4.4~ynh1", + "version": "2.4.4~ynh2", "url": "https://pleroma.social/", "upstream": { "license": "AGPL-3.0-only", diff --git a/scripts/install b/scripts/install index a1283c5..8fd5ea0 100755 --- a/scripts/install +++ b/scripts/install @@ -209,6 +209,8 @@ popd cat "../conf/ldap.exs" >> "$config" ynh_replace_string --match_string="config :pleroma, configurable_from_database: false" --replace_string="config :pleroma, configurable_from_database: true" --target_file="$config" +registration_bool_value=`(($registration)) && echo "true" || echo "false"` +ynh_replace_string --match_string="registrations_open: true" --replace_string="registrations_open: $registration_bool_value" --target_file="$config" pushd $final_path/live ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$final_path/live/bin/pleroma_ctl migrate" diff --git a/scripts/upgrade b/scripts/upgrade index 721cba4..d7c3df7 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -150,6 +150,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" # UPGRADE TO OTP RELEASE #================================================= +config="/etc/$app/config.exs" if ynh_version_gt "1.1.1~ynh1" "${previous_version}" ; then ynh_script_progression --message="Upgrading to OTP release..." --weight=1 @@ -175,7 +176,6 @@ if ynh_version_gt "1.1.1~ynh1" "${previous_version}" ; then mkdir -p /etc/$app chown -R $app /etc/$app - config="/etc/$app/config.exs" mv $final_path/live/config/prod.secret.exs $config ynh_replace_string --match_string="use Mix.Config" --replace_string="import Config" --target_file="$config" echo "config :pleroma, :instance, static_dir: \"/home/yunohost.app/$app/static\"" >> $config @@ -187,11 +187,15 @@ if ynh_version_gt "1.1.1~ynh1" "${previous_version}" ; then fi if ynh_version_gt "2.0.5~ynh1" "${previous_version}" ; then - config="/etc/$app/config.exs" cat "../conf/ldap.exs" >> "$config" ynh_replace_string --match_string="config :pleroma, configurable_from_database: false" --replace_string="config :pleroma, configurable_from_database: true" --target_file="$config" fi +if ynh_version_gt "2.4.4~ynh2" "${previous_version}"; then + registration_bool_value=`(($registration)) && echo "true" || echo "false"` + ynh_replace_string --match_string='registrations_open: true' --replace_string="registrations_open: $registration_bool_value" --target_file="$config" +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #=================================================