1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pleroma_ynh.git synced 2024-09-03 20:15:59 +02:00

Merge pull request #230 from YunoHost-Apps/testing

Config migrate to db
This commit is contained in:
yalh76 2023-01-17 22:11:39 +01:00 committed by GitHub
commit 010a2fdbfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 15 deletions

View file

@ -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 **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 **Demo:** http://distsn.org/pleroma-instances.html

View file

@ -5,15 +5,15 @@ It shall NOT be edited by hand.
# Pleroma pour YunoHost # Pleroma pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/pleroma.svg)](https://dash.yunohost.org/appci/app/pleroma) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/pleroma.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/pleroma.maintain.svg) [![Niveau dintégration](https://dash.yunohost.org/integration/pleroma.svg)](https://dash.yunohost.org/appci/app/pleroma) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/pleroma.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/pleroma.maintain.svg)
[![Installer Pleroma avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pleroma) [![Installer Pleroma avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pleroma)
*[Read this readme in english.](./README.md)* *[Read this readme in english.](./README.md)*
> *Ce package vous permet d'installer Pleroma rapidement et simplement sur un serveur YunoHost. > *Ce package vous permet dinstaller 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.* Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment linstaller et en profiter.*
## Vue d'ensemble ## Vue densemble
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. 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 **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 **Démo :** http://distsn.org/pleroma-instances.html
## Captures d'écran ## Captures décran
![Capture d'écran de Pleroma](./doc/screenshots/screenshot1.png) ![Capture décran de Pleroma](./doc/screenshots/screenshot1.png)
## Avertissements / informations importantes ## Avertissements / informations importantes
@ -69,9 +69,9 @@ You can make users **moderators**. They will then be able to **delete any post**
## Documentations et ressources ## Documentations et ressources
* Site officiel de l'app : <https://pleroma.social/> * Site officiel de lapp : <https://pleroma.social/>
* Documentation officielle de l'admin : <https://docs.pleroma.social/> * Documentation officielle de ladmin : <https://docs.pleroma.social/>
* Dépôt de code officiel de l'app : <https://git.pleroma.social/pleroma/pleroma/> * Dépôt de code officiel de lapp : <https://git.pleroma.social/pleroma/pleroma/>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_pleroma> * Documentation YunoHost pour cette app : <https://yunohost.org/app_pleroma>
* Signaler un bug : <https://github.com/YunoHost-Apps/pleroma_ynh/issues> * Signaler un bug : <https://github.com/YunoHost-Apps/pleroma_ynh/issues>
@ -87,4 +87,4 @@ ou
sudo yunohost app upgrade pleroma -u https://github.com/YunoHost-Apps/pleroma_ynh/tree/testing --debug sudo yunohost app upgrade pleroma -u https://github.com/YunoHost-Apps/pleroma_ynh/tree/testing --debug
``` ```
**Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps> **Plus dinfos sur le packaging dapplications :** <https://yunohost.org/packaging_apps>

View file

@ -6,7 +6,7 @@
"en": "Federated social networking server built on open protocols", "en": "Federated social networking server built on open protocols",
"fr": "Serveur de réseautage social fédéré basé sur des protocoles ouverts" "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/", "url": "https://pleroma.social/",
"upstream": { "upstream": {
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",

View file

@ -209,6 +209,8 @@ popd
cat "../conf/ldap.exs" >> "$config" 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" 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 pushd $final_path/live
ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$final_path/live/bin/pleroma_ctl migrate" 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 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 # END OF SCRIPT
#================================================= #=================================================

View file

@ -150,6 +150,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
# UPGRADE TO OTP RELEASE # UPGRADE TO OTP RELEASE
#================================================= #=================================================
config="/etc/$app/config.exs"
if ynh_version_gt "1.1.1~ynh1" "${previous_version}" ; then if ynh_version_gt "1.1.1~ynh1" "${previous_version}" ; then
ynh_script_progression --message="Upgrading to OTP release..." --weight=1 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 mkdir -p /etc/$app
chown -R $app /etc/$app chown -R $app /etc/$app
config="/etc/$app/config.exs"
mv $final_path/live/config/prod.secret.exs $config mv $final_path/live/config/prod.secret.exs $config
ynh_replace_string --match_string="use Mix.Config" --replace_string="import Config" --target_file="$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 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 fi
if ynh_version_gt "2.0.5~ynh1" "${previous_version}" ; then if ynh_version_gt "2.0.5~ynh1" "${previous_version}" ; then
config="/etc/$app/config.exs"
cat "../conf/ldap.exs" >> "$config" 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" ynh_replace_string --match_string="config :pleroma, configurable_from_database: false" --replace_string="config :pleroma, configurable_from_database: true" --target_file="$config"
fi 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 # 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 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 # END OF SCRIPT
#================================================= #=================================================