diff --git a/README.md b/README.md
index 47de0ff..a0aa076 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ For user friendly details about Pleroma: [see here](https://blog.soykaf.com/post
**Mastodon web front-end for Pleroma:** Add **/web** in front of your Pleroma domain, eg. pleroma.domain.tld/web
-**Shipped version:** 2.4.5~ynh1
+**Shipped version:** 2.4.5~ynh2
**Demo:** http://distsn.org/pleroma-instances.html
diff --git a/README_fr.md b/README_fr.md
index d63eeab..439ae32 100644
--- a/README_fr.md
+++ b/README_fr.md
@@ -5,15 +5,15 @@ It shall NOT be edited by hand.
# Pleroma pour YunoHost
-[](https://dash.yunohost.org/appci/app/pleroma)  
+[](https://dash.yunohost.org/appci/app/pleroma)  
[](https://install-app.yunohost.org/?app=pleroma)
*[Read this readme in english.](./README.md)*
-> *Ce package vous permet d'installer Pleroma rapidement et simplement sur un serveur YunoHost.
-Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
+> *Ce package vous permet d’installer Pleroma rapidement et simplement sur un serveur YunoHost.
+Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.*
-## Vue d'ensemble
+## Vue d’ensemble
Pleroma is a microblogging server software that can federate (= exchange messages with) other servers that support ActivityPub. What that means is that you can host a server for yourself or your friends and stay in control of your online identity, but still exchange messages with people on larger servers. Pleroma will federate with all servers that implement ActivityPub, like Friendica, GNU Social, Hubzilla, Mastodon, Misskey, Peertube, and Pixelfed.
@@ -22,13 +22,13 @@ For user friendly details about Pleroma: [see here](https://blog.soykaf.com/post
**Mastodon web front-end for Pleroma:** Add **/web** in front of your Pleroma domain, eg. pleroma.domain.tld/web
-**Version incluse :** 2.4.5~ynh1
+**Version incluse :** 2.4.5~ynh2
**Démo :** http://distsn.org/pleroma-instances.html
-## Captures d'écran
+## Captures d’écran
-
+
## Avertissements / informations importantes
@@ -69,9 +69,9 @@ You can make users **moderators**. They will then be able to **delete any post**
## Documentations et ressources
-* Site officiel de l'app :
-* Documentation officielle de l'admin :
-* Dépôt de code officiel de l'app :
+* Site officiel de l’app :
+* Documentation officielle de l’admin :
+* Dépôt de code officiel de l’app :
* Documentation YunoHost pour cette app :
* Signaler un bug :
@@ -87,4 +87,4 @@ ou
sudo yunohost app upgrade pleroma -u https://github.com/YunoHost-Apps/pleroma_ynh/tree/testing --debug
```
-**Plus d'infos sur le packaging d'applications :**
+**Plus d’infos sur le packaging d’applications :**
\ No newline at end of file
diff --git a/manifest.json b/manifest.json
index 5034d53..a64f1fd 100644
--- a/manifest.json
+++ b/manifest.json
@@ -6,7 +6,7 @@
"en": "Federated social networking server built on open protocols",
"fr": "Serveur de réseautage social fédéré basé sur des protocoles ouverts"
},
- "version": "2.4.5~ynh1",
+ "version": "2.4.5~ynh2",
"url": "https://pleroma.social/",
"upstream": {
"license": "AGPL-3.0-only",
diff --git a/scripts/install b/scripts/install
index a1283c5..f6adcbf 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"
@@ -269,6 +271,14 @@ ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
+#=================================================
+# POST INSTALL
+#=================================================
+
+# Correct path to 'static dir' in DB
+# This must be done when Pleroma is running (i.e. after install and start)
+ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$final_path/live/bin/pleroma_ctl config migrate_to_db"
+
#=================================================
# END OF SCRIPT
#=================================================
diff --git a/scripts/upgrade b/scripts/upgrade
index 721cba4..434d3e5 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
#=================================================
@@ -285,6 +289,14 @@ ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
+#=================================================
+# POST INSTALL
+#=================================================
+
+# Correct path to 'static dir' in DB
+# This must be done when Pleroma is running (i.e. after install/upgrade and start)
+ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$final_path/live/bin/pleroma_ctl config migrate_to_db"
+
#=================================================
# END OF SCRIPT
#=================================================