Repository: YunoHost-Apps/mobilizon_ynh
Pull request #216: Upgrade to 5.1.2
Author: login: rodinux
Created: 2025-03-05T03:33:46Z | Merged: 2025-03-07T23:42:55Z

version 5.1.2
helpers_version = "2.1"

## PR Status

- [ ] Code finished and ready to be reviewed/tested
- [ ] The fix/enhancement were manually tested (if applicable)

## Automatic tests

Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)



Diff:
diff --git a/README.md b/README.md
index 3ee2174..9b0fcf3 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@ A decentralized and federated platform to organize events.
 - You can also create a page for your group where the members will be able to get organized together.
 
 
-**Shipped version:** 5.1.0~ynh1
+**Shipped version:** 5.1.2~ynh1
 
 **Demo:** <https://demo.mobilizon.org>
 
diff --git a/README_es.md b/README_es.md
index 0928da0..4136cd1 100644
--- a/README_es.md
+++ b/README_es.md
@@ -24,7 +24,7 @@ A decentralized and federated platform to organize events.
 - You can also create a page for your group where the members will be able to get organized together.
 
 
-**Versión actual:** 5.1.0~ynh1
+**Versión actual:** 5.1.2~ynh1
 
 **Demo:** <https://demo.mobilizon.org>
 
diff --git a/README_eu.md b/README_eu.md
index e1d424a..3881fc2 100644
--- a/README_eu.md
+++ b/README_eu.md
@@ -24,7 +24,7 @@ A decentralized and federated platform to organize events.
 - You can also create a page for your group where the members will be able to get organized together.
 
 
-**Paketatutako bertsioa:** 5.1.0~ynh1
+**Paketatutako bertsioa:** 5.1.2~ynh1
 
 **Demoa:** <https://demo.mobilizon.org>
 
diff --git a/README_fr.md b/README_fr.md
index 730c0c1..3343ac1 100644
--- a/README_fr.md
+++ b/README_fr.md
@@ -24,7 +24,7 @@ A decentralized and federated platform to organize events.
 - You can also create a page for your group where the members will be able to get organized together.
 
 
-**Version incluse :** 5.1.0~ynh1
+**Version incluse :** 5.1.2~ynh1
 
 **Démo :** <https://demo.mobilizon.org>
 
diff --git a/README_gl.md b/README_gl.md
index c3fce97..35a7a2d 100644
--- a/README_gl.md
+++ b/README_gl.md
@@ -24,7 +24,7 @@ A decentralized and federated platform to organize events.
 - You can also create a page for your group where the members will be able to get organized together.
 
 
-**Versión proporcionada:** 5.1.0~ynh1
+**Versión proporcionada:** 5.1.2~ynh1
 
 **Demo:** <https://demo.mobilizon.org>
 
diff --git a/README_id.md b/README_id.md
index 34d6531..6ba3eb4 100644
--- a/README_id.md
+++ b/README_id.md
@@ -24,7 +24,7 @@ A decentralized and federated platform to organize events.
 - You can also create a page for your group where the members will be able to get organized together.
 
 
-**Versi terkirim:** 5.1.0~ynh1
+**Versi terkirim:** 5.1.2~ynh1
 
 **Demo:** <https://demo.mobilizon.org>
 
diff --git a/README_nl.md b/README_nl.md
index 9908ab5..05e9794 100644
--- a/README_nl.md
+++ b/README_nl.md
@@ -24,7 +24,7 @@ A decentralized and federated platform to organize events.
 - You can also create a page for your group where the members will be able to get organized together.
 
 
-**Geleverde versie:** 5.1.0~ynh1
+**Geleverde versie:** 5.1.2~ynh1
 
 **Demo:** <https://demo.mobilizon.org>
 
diff --git a/README_pl.md b/README_pl.md
index 7b79f19..6754da1 100644
--- a/README_pl.md
+++ b/README_pl.md
@@ -24,7 +24,7 @@ A decentralized and federated platform to organize events.
 - You can also create a page for your group where the members will be able to get organized together.
 
 
-**Dostarczona wersja:** 5.1.0~ynh1
+**Dostarczona wersja:** 5.1.2~ynh1
 
 **Demo:** <https://demo.mobilizon.org>
 
diff --git a/README_ru.md b/README_ru.md
index 8ed2384..c2a7368 100644
--- a/README_ru.md
+++ b/README_ru.md
@@ -24,7 +24,7 @@ A decentralized and federated platform to organize events.
 - You can also create a page for your group where the members will be able to get organized together.
 
 
-**Поставляемая версия:** 5.1.0~ynh1
+**Поставляемая версия:** 5.1.2~ynh1
 
 **Демо-версия:** <https://demo.mobilizon.org>
 
diff --git a/README_zh_Hans.md b/README_zh_Hans.md
index 017d0ca..67a0c88 100644
--- a/README_zh_Hans.md
+++ b/README_zh_Hans.md
@@ -24,7 +24,7 @@ A decentralized and federated platform to organize events.
 - You can also create a page for your group where the members will be able to get organized together.
 
 
-**分发版本：** 5.1.0~ynh1
+**分发版本：** 5.1.2~ynh1
 
 **演示：** <https://demo.mobilizon.org>
 
diff --git a/conf/nginx.conf b/conf/nginx.conf
index adb71ef..d69cd83 100644
--- a/conf/nginx.conf
+++ b/conf/nginx.conf
@@ -13,7 +13,7 @@ client_max_body_size 50M;
 proxy_http_version 1.1;
 proxy_set_header Upgrade $http_upgrade;
 proxy_set_header Connection "upgrade";
-proxy_set_header Host $http_host;
+proxy_set_header Host $host;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_set_header X-Forwarded-Proto $scheme;
diff --git a/doc/PRE_INSTALL.md b/doc/PRE_INSTALL.md
deleted file mode 100644
index 5d4b2c2..0000000
--- a/doc/PRE_INSTALL.md
+++ /dev/null
@@ -1 +0,0 @@
-On Bullseye ARM64, last version will be 4.1.0
diff --git a/doc/PRE_UPGRADE.md b/doc/PRE_UPGRADE.md
deleted file mode 100644
index 5d4b2c2..0000000
--- a/doc/PRE_UPGRADE.md
+++ /dev/null
@@ -1 +0,0 @@
-On Bullseye ARM64, last version will be 4.1.0
diff --git a/manifest.toml b/manifest.toml
index cb63f71..72a1e6c 100644
--- a/manifest.toml
+++ b/manifest.toml
@@ -7,7 +7,7 @@ name = "Mobilizon"
 description.en = "Decentralized and federated platform to organize events"
 description.fr = "Plateforme décentralisée et fédérée pour organiser des événements"
 
-version = "5.1.0~ynh1"
+version = "5.1.2~ynh1"
 
 maintainers = ["rodinux"]
 
@@ -20,11 +20,14 @@ code = "https://framagit.org/framasoft/mobilizon/"
 fund = "https://soutenir.framasoft.org/"
 
 [integration]
-yunohost = ">= 11.2"
+yunohost = ">= 12.0.9"
+helpers_version = "2.1"
 architectures = ["amd64", "arm64"]
 multi_instance = false
+
 ldap = true
 sso = true
+
 disk = "200M"
 ram.build = "700M"
 ram.runtime = "400M"
@@ -48,19 +51,12 @@ ram.runtime = "400M"
     type = "user"
 
 [resources]
-    [resources.sources.bookworm]
-    prefetch = false
-    amd64.url = "https://packages.joinmobilizon.org/5.1.0/mobilizon_5.1.0_debian-bookworm-amd64.tar.gz"
-    amd64.sha256 = "b7c74970abbe26ce54297f7f0c798c705ecd3f419e0b0b241d8a9aa787c1dae6"
-    arm64.url = "https://packages.joinmobilizon.org/5.1.0/mobilizon_5.1.0_debian-bookworm-arm64.tar.gz"
-    arm64.sha256 = "9c3c0dcfb5d0eaf37f79029fb024e6075cbaf2ecdc2b53c11770dbc6e28b2aac"
-
-    [resources.sources.bullseye]
+    [resources.sources.main]
     prefetch = false
-    amd64.url = "https://packages.joinmobilizon.org/5.1.0/mobilizon_5.1.0_debian-bullseye-amd64.tar.gz"
-    amd64.sha256 = "450b28eef72a38244a7f992b1504391cac7e951bf8159e2534a248e97405e4a0"
-    arm64.url = "https://packages.joinmobilizon.org/4.1.0/mobilizon_4.1.0_arm64-debian-bullseye.tar.gz"
-    arm64.sha256 = "8642c1ab8e598934e04cea7a4eb70b3ff14b37a6147e7cd9b38fe931a26148c9"
+    amd64.url = "https://packages.joinmobilizon.org/5.1.2/mobilizon_5.1.2_debian-bookworm_amd64.tar.gz"
+    amd64.sha256 = "69f3252c892b77aef2785cbbdfeada8f294d1674b08812e6cbcdd04b6e3ee449"
+    arm64.url = "https://packages.joinmobilizon.org/5.1.2/mobilizon_5.1.2_debian-bookworm_arm64.tar.gz"
+    arm64.sha256 = "faad20be2f5b759abb07a100b7440687628f063634ad3092baaa1db869b874d1"
 
 #    autoupdate.strategy = "latest_gitlab_release"
 #    autoupdate.asset.amd64 = "mobilizon_.*-bullseye-amd64.tar.gz"
@@ -69,6 +65,7 @@ ram.runtime = "400M"
     [resources.system_user]
 
     [resources.install_dir]
+    group = "www-data:r-x"
 
     [resources.data_dir]
     subdirs = ["uploads"]
diff --git a/scripts/_common.sh b/scripts/_common.sh
index 654697c..d5f26c0 100644
--- a/scripts/_common.sh
+++ b/scripts/_common.sh
@@ -1,23 +1,8 @@
 #!/bin/bash
 
 #=================================================
-# COMMON VARIABLES
+# COMMON VARIABLES AND CUSTOM HELPERS
 #=================================================
 
 ynh_user="${app}_notifs"
 
-MOBILIZON_CONFIG_PATH="$install_dir/config.exs"
-
-debian=$(lsb_release --codename --short)
-
-#=================================================
-# PERSONAL HELPERS
-#=================================================
-
-#=================================================
-# EXPERIMENTAL HELPERS
-#=================================================
-
-#=================================================
-# FUTURE OFFICIAL HELPERS
-#=================================================
diff --git a/scripts/backup b/scripts/backup
index 366b1a3..9fa3660 100644
--- a/scripts/backup
+++ b/scripts/backup
@@ -1,55 +1,41 @@
 #!/bin/bash
 
-#=================================================
-# GENERIC START
-#=================================================
-# IMPORT GENERIC HELPERS
-#=================================================
-
-# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
 source ../settings/scripts/_common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# DECLARE DATA AND CONF FILES TO BACKUP
-#=================================================
 ynh_print_info --message="Declaring files to be backed up..."
 
 #=================================================
 # BACKUP THE APP MAIN DIR
 #=================================================
 
-ynh_backup --src_path="$install_dir"
+ynh_backup "$install_dir"
 
 #=================================================
 # BACKUP THE DATA DIR
 #=================================================
 
-ynh_backup --src_path="$data_dir" --is_big
+ynh_backup "$data_dir"
 
 #=================================================
 # SYSTEM CONFIGURATION
 #=================================================
 
-ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
-
-ynh_backup --src_path="/etc/systemd/system/$app.service"
+ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
 
-#=================================================
-# BACKUP VARIOUS FILES
-#=================================================
+ynh_backup "/etc/systemd/system/$app.service"
 
-# ynh_backup --src_path="/var/log/$app/"
+# ynh_backup "/var/log/$app/"
 
 #=================================================
 # BACKUP THE POSTGRESQL DATABASE
 #=================================================
-ynh_print_info --message="Backing up the PostgreSQL database..."
+ynh_print_info "Backing up the PostgreSQL database..."
 
-ynh_psql_dump_db --database="$db_name" > db.sql
+ynh_psql_dump_db > db.sql
 
 #=================================================
 # END OF SCRIPT
 #=================================================
 
-ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
+ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
\ No newline at end of file
diff --git a/scripts/change_url b/scripts/change_url
index 044ddaa..fd13f72 100644
--- a/scripts/change_url
+++ b/scripts/change_url
@@ -1,60 +1,44 @@
 #!/bin/bash
 
-#=================================================
-# GENERIC STARTING
-#=================================================
-# IMPORT GENERIC HELPERS
-#=================================================
-
 source _common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# STANDARD MODIFICATIONS
 #=================================================
 # STOP SYSTEMD SERVICE
 #=================================================
-ynh_script_progression --message="Stopping a systemd service..."
+ynh_script_progression "Stopping $app's systemd service..."
 
-ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd
+ynh_systemctl --service=$app --action="stop" --log_path=systemd
 
 #=================================================
 # MODIFY URL IN NGINX CONF
 #=================================================
-ynh_script_progression --message="Updating NGINX web server configuration..."
+ynh_script_progression "Updating NGINX web server configuration..."
 
-ynh_change_url_nginx_config
+ynh_config_change_url_nginx
 
-#=================================================
-# SPECIFIC MODIFICATIONS
 #=================================================
 # MODIFY A CONFIG FILE
 #=================================================
-ynh_script_progression --message="Modifying a config file..."
+ynh_script_progression "Updating configuration..."
 
 if [ $change_domain -eq 1 ]; then
     yunohost user update "$ynh_user" --mail "$ynh_user@$domain" --add-mailalias "$app@$domain"
 fi
 
-ynh_backup_if_checksum_is_different --file="$install_dir/config.exs"
-ynh_replace_string --match_string="$old_domain" --replace_string="$new_domain" --target_file="$install_dir/config.exs"
-ynh_store_file_checksum --file="$install_dir/config.exs"
+ynh_backup_if_checksum_is_different "$install_dir/config.exs"
+ynh_replace --match="$old_domain" --replace="$new_domain" --file="$install_dir/config.exs"
+ynh_store_file_checksum "$install_dir/config.exs"
 
-chmod 400 "$install_dir/config.exs"
-chown "$app:$app" "$install_dir/config.exs"
-
-#=================================================
-# GENERIC FINALISATION
 #=================================================
 # START SYSTEMD SERVICE
 #=================================================
-ynh_script_progression --message="Starting a systemd service..."
+ynh_script_progression "Starting $app's systemd service..."
 
-# Start a systemd service
-ynh_systemd_action --service_name="$app" --action="start" --log_path=systemd --line_match="Access Mobilizon.Web.Endpoint at"
+ynh_systemctl --service="$app" --action="start" --log_path=systemd --wait_until="Access Mobilizon.Web.Endpoint at"
 
 #=================================================
 # END OF SCRIPT
 #=================================================
 
-ynh_script_progression --message="Change of URL completed for $app"
+ynh_script_progression "Change of URL completed for $app"
diff --git a/scripts/install b/scripts/install
index 1b60970..c8bae49 100644
--- a/scripts/install
+++ b/scripts/install
@@ -1,11 +1,5 @@
 #!/bin/bash
 
-#=================================================
-# GENERIC START
-#=================================================
-# IMPORT GENERIC HELPERS
-#=================================================
-
 source _common.sh
 source /usr/share/yunohost/helpers
 
@@ -14,15 +8,15 @@ source /usr/share/yunohost/helpers
 #=================================================
 
 admin_email=$(ynh_user_get_info --username="$admin" --key="mail")
-ynh_app_setting_set --app="$app" --key="admin_email" --value="$admin_email"
+ynh_app_setting_set --key="admin_email" --value="$admin_email"
 
 ynh_user_password=$(ynh_string_random --length=30)
-ynh_app_setting_set --app="$app" --key="ynh_user_password" --value="$ynh_user_password"
+ynh_app_setting_set --key="ynh_user_password" --value="$ynh_user_password"
 
 #=================================================
 # CREATE DEDICATED USER
 #=================================================
-ynh_script_progression --message="Configuring yunohost users..."
+ynh_script_progression "Configuring yunohost users..."
 
 yunohost user create "$ynh_user" -F "Mobilizon Notifications" --domain "$domain" --password "$ynh_user_password" -q 0
 yunohost user update "$ynh_user" --add-mailalias "$app@$domain" --add-mailforward "$admin_email"
@@ -30,34 +24,29 @@ yunohost user update "$ynh_user" --add-mailalias "$app@$domain" --add-mailforwar
 #=================================================
 # CREATE A POSTGRESQL DATABASE
 #=================================================
-ynh_script_progression --message="Configuring the PostgreSQL database..."
+ynh_script_progression "Configuring the PostgreSQL database..."
 
-# FIXME: Really superuser ??
-ynh_psql_execute_as_root --database="$db_name" --sql="ALTER USER $db_user WITH SUPERUSER;"
-ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS postgis;"
-ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;"
-ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS unaccent;"
+ynh_psql_db_shell <<< "ALTER USER $db_user WITH SUPERUSER;"
+ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS postgis;"
+ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
+ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS unaccent;"
 
 #=================================================
 # DOWNLOAD, CHECK AND UNPACK SOURCE
 #=================================================
-ynh_script_progression --message="Setting up source files..."
-
-# Download, check integrity, uncompress and patch the source from app.src
-ynh_setup_source --source_id=$debian --dest_dir="$install_dir/live"
+ynh_script_progression "Setting up source files..."
 
-chmod -R o-rwx "$install_dir"
-chown -R "$app:www-data" "$install_dir"
+ynh_setup_source --dest_dir="$install_dir/live"
 
 #=================================================
 # MAKE SETUP
 #=================================================
-ynh_script_progression --message="Making setup..."
+ynh_script_progression "Making setup..."
 
 pushd "$install_dir/live"
-    ynh_exec_as "$app" MOBILIZON_CONFIG_PATH="$MOBILIZON_CONFIG_PATH" MIX_ENV=prod \
+    ynh_exec_as_app MOBILIZON_CONFIG_PATH="$install_dir/config.exs" MIX_ENV=prod \
         ./bin/mobilizon_ctl instance gen --force \
-        --output "$MOBILIZON_CONFIG_PATH" \
+        --output "$install_dir/config.exs" \
         --output-psql "$install_dir/setup_db.psql" \
         --domain "$domain" \
         --instance-name "Mobilizon" \
@@ -67,60 +56,57 @@ pushd "$install_dir/live"
         --dbuser "$db_user" \
         --dbpass "$db_pwd" \
         --listen-port "$port"
-    ynh_secure_remove --file="$install_dir/setup_db.psql"
+    ynh_safe_rm "$install_dir/setup_db.psql"
 popd
 
-ynh_add_config --template="ldap.exs" --destination="$install_dir/ldap.exs"
-ynh_add_config --template="mail.exs" --destination="$install_dir/mail.exs"
-ynh_add_config --template="uploads.exs" --destination="$install_dir/uploads.exs"
+ynh_config_add --template="ldap.exs" --destination="$install_dir/ldap.exs"
+ynh_config_add --template="mail.exs" --destination="$install_dir/mail.exs"
+ynh_config_add --template="uploads.exs" --destination="$install_dir/uploads.exs"
 
-cat "$install_dir/ldap.exs" "$install_dir/mail.exs" "$install_dir/uploads.exs" >> "$MOBILIZON_CONFIG_PATH"
-ynh_store_file_checksum --file="$MOBILIZON_CONFIG_PATH"
+cat "$install_dir/ldap.exs" "$install_dir/mail.exs" "$install_dir/uploads.exs" >> "$install_dir/config.exs"
+ynh_store_file_checksum "$install_dir/config.exs"
 
-ynh_secure_remove --file="$install_dir/ldap.exs"
-ynh_secure_remove --file="$install_dir/mail.exs"
-ynh_secure_remove --file="$install_dir/uploads.exs"
+ynh_safe_rm "$install_dir/ldap.exs"
+ynh_safe_rm "$install_dir/mail.exs"
+ynh_safe_rm "$install_dir/uploads.exs"
 
-chmod 400 "$MOBILIZON_CONFIG_PATH"
-chown "$app:$app" "$MOBILIZON_CONFIG_PATH"
+chmod 400 "$install_dir/config.exs"
+chown "$app:$app" "$install_dir/config.exs"
 
-ynh_exec_as "$app" MOBILIZON_CONFIG_PATH="$MOBILIZON_CONFIG_PATH" "$install_dir/live/bin/mobilizon_ctl" migrate
+ynh_exec_as_app MOBILIZON_CONFIG_PATH="$install_dir/config.exs" "$install_dir/live/bin/mobilizon_ctl" migrate
 
 #=================================================
 # SYSTEM CONFIGURATION
 #=================================================
-ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
+ynh_script_progression "Adding system configurations related to $app..."
 
-# Create a dedicated NGINX config
-ynh_add_nginx_config
+ynh_config_add_nginx
 
-# Create a dedicated systemd config
-ynh_add_systemd_config
+ynh_config_add_systemd
 yunohost service add "$app" --description="$app daemon for Mobilizon"
 
 #=================================================
 # SETUP APPLICATION
 #=================================================
-ynh_script_progression --message="Finalizing installation..." --weight=1
+ynh_script_progression "Finalizing installation..."
 
-ynh_systemd_action --service_name="$app" --action="start" --log_path=systemd --line_match="Access Mobilizon.Web.Endpoint at"
+ynh_systemctl --service="$app" --action="start" --log_path=systemd --wait_until="Access Mobilizon.Web.Endpoint at"
 
-# We generate a dummy password ... this will actually *not* be used because the admin is supposed to connect via the ldap
-ynh_exec_as "$app" MOBILIZON_CONFIG_PATH="$MOBILIZON_CONFIG_PATH" "$install_dir/live/bin/mobilizon_ctl" \
+# We generate a dummy password... this will actually *not* be used because the admin is supposed to connect via the ldap
+ynh_exec_as_app MOBILIZON_CONFIG_PATH="$install_dir/config.exs" "$install_dir/live/bin/mobilizon_ctl" \
     users.new "$admin_email" --admin --password "$(ynh_string_random --length=30)"
 
-ynh_systemd_action --service_name="$app" --action="stop" --log_path=systemd
+ynh_systemctl --service="$app" --action="stop" --log_path=systemd
 
 #=================================================
 # START SYSTEMD SERVICE
 #=================================================
-ynh_script_progression --message="Starting a systemd service..."
+ynh_script_progression "Starting $app's systemd service..."
 
-# Start a systemd service
-ynh_systemd_action --service_name="$app" --action="start" --log_path=systemd --line_match="Access Mobilizon.Web.Endpoint at"
+ynh_systemctl --service="$app" --action="start" --log_path=systemd --wait_until="Access Mobilizon.Web.Endpoint at"
 
 #=================================================
 # END OF SCRIPT
 #=================================================
 
-ynh_script_progression --message="Installation of $app completed"
+ynh_script_progression "Installation of $app completed"
diff --git a/scripts/remove b/scripts/remove
index cfd9501..c86039c 100644
--- a/scripts/remove
+++ b/scripts/remove
@@ -1,39 +1,29 @@
 #!/bin/bash
 
-#=================================================
-# GENERIC START
-#=================================================
-# IMPORT GENERIC HELPERS
-#=================================================
-
 source _common.sh
 source /usr/share/yunohost/helpers
 
 #=================================================
 # REMOVE SYSTEM CONFIGURATIONS
 #=================================================
-ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
+ynh_script_progression "Removing system configurations related to $app..."
 
-# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
-if ynh_exec_warn_less yunohost service status "$app" >/dev/null; then
+if ynh_hide_warnings yunohost service status "$app" >/dev/null; then
     yunohost service remove "$app"
 fi
 
 # Properly kill the service processes
-ynh_systemd_action --service_name="$app" --action="stop" --log_path=systemd
+ynh_systemctl --service="$app" --action="stop" --log_path=systemd
 pkill -u "$app" || true
 
-# Remove the dedicated systemd config
-ynh_remove_systemd_config
+ynh_config_remove_systemd
 
-# Remove the dedicated NGINX config
-ynh_remove_nginx_config
+ynh_config_remove_nginx
 
-# Remove the notifications user
 yunohost user delete "$ynh_user"
 
 #=================================================
 # END OF SCRIPT
 #=================================================
 
-ynh_script_progression --message="Removal of $app completed"
+ynh_script_progression "Removal of $app completed"
diff --git a/scripts/restore b/scripts/restore
index 3e63efc..00f919a 100644
--- a/scripts/restore
+++ b/scripts/restore
@@ -1,19 +1,12 @@
 #!/bin/bash
 
-#=================================================
-# GENERIC START
-#=================================================
-# IMPORT GENERIC HELPERS
-#=================================================
-
-# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
 source ../settings/scripts/_common.sh
 source /usr/share/yunohost/helpers
 
 #=================================================
 # CREATE DEDICATED USER
 #=================================================
-ynh_script_progression --message="Configuring yunohost users..."
+ynh_script_progression "Configuring YunoHost users..."
 
 yunohost user create "$ynh_user" --firstname "Mobilizon" --lastname "Notifications" --domain "$domain" --password "$ynh_user_password" -q 0
 yunohost user update "$ynh_user" --add-mailalias "$app@$domain" --add-mailforward "$admin_email"
@@ -21,58 +14,52 @@ yunohost user update "$ynh_user" --add-mailalias "$app@$domain" --add-mailforwar
 #=================================================
 # RESTORE THE APP MAIN DIR
 #=================================================
-ynh_script_progression --message="Restoring the app main directory..."
-
-ynh_restore_file --origin_path="$install_dir"
+ynh_script_progression "Restoring the app main directory..."
 
-chmod -R o-rwx "$install_dir"
-chown -R "$app:www-data" "$install_dir"
+ynh_restore "$install_dir"
 
 #=================================================
 # RESTORE THE DATA DIRECTORY
 #=================================================
-ynh_script_progression --message="Restoring the data directory..."
-
-ynh_restore_file --origin_path="$data_dir" --not_mandatory
+ynh_script_progression "Restoring the data directory..."
 
-chmod -R o-rwx "$data_dir"
-chown -R "$app:$app" "$data_dir"
+ynh_restore "$data_dir"
 
 #=================================================
 # RESTORE THE POSTGRESQL DATABASE
 #=================================================
-ynh_script_progression --message="Restoring the PostgreSQL database..."
+ynh_script_progression "Restoring the PostgreSQL database..."
 
-ynh_psql_execute_as_root --database="$db_name" --sql="ALTER USER $db_user WITH SUPERUSER;"
-ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS postgis;"
-ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;"
-ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS unaccent;"
-ynh_psql_execute_as_root --database="$db_name" --sql="ALTER USER $db_user WITH NOSUPERUSER;"
+ynh_psql_db_shell <<< "ALTER USER $db_user WITH SUPERUSER;"
+ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS postgis;"
+ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
+ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS unaccent;"
+ynh_psql_db_shell <<< "ALTER USER $db_user WITH NOSUPERUSER;"
 
-ynh_psql_execute_file_as_root --database="$db_name" --file="./db.sql"
+ynh_psql_db_shell < ./db.sql
 
 #=================================================
 # RESTORE SYSTEM CONFIGURATIONS
 #=================================================
-ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
+ynh_script_progression "Restoring system configurations related to $app..."
 
-ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
+ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
 
-ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
+ynh_restore "/etc/systemd/system/$app.service"
 systemctl enable "$app.service" --quiet
 yunohost service add "$app" --description="$app daemon for Mobilizon"
 
 #=================================================
 # START SYSTEMD SERVICE
 #=================================================
-ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
+ynh_script_progression "Reloading NGINX web server and $app's service..."
 
-ynh_systemd_action --service_name="$app" --action="start" --log_path=systemd --line_match="Access Mobilizon.Web.Endpoint at"
+ynh_systemctl --service="$app" --action="start" --log_path=systemd --wait_until="Access Mobilizon.Web.Endpoint at"
 
-ynh_systemd_action --service_name=nginx --action=reload
+ynh_systemctl --service=nginx --action=reload
 
 #=================================================
 # END OF SCRIPT
 #=================================================
 
-ynh_script_progression --message="Restoration completed for $app"
+ynh_script_progression "Restoration completed for $app"
diff --git a/scripts/upgrade b/scripts/upgrade
index a2972e6..cd9e84e 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -1,89 +1,71 @@
 #!/bin/bash
 
-#=================================================
-# GENERIC START
-#=================================================
-# IMPORT GENERIC HELPERS
-#=================================================
-
 source _common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# STANDARD UPGRADE STEPS
 #=================================================
 # STOP SYSTEMD SERVICE
 #=================================================
-ynh_script_progression --message="Stopping a systemd service..."
+ynh_script_progression "Stopping $app's systemd service..."
 
-ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd
+ynh_systemctl --service=$app --action="stop" --log_path=systemd
 
 #=================================================
 # ENSURE DOWNWARD COMPATIBILITY
 #=================================================
-ynh_script_progression --message="Ensuring downward compatibility..."
-
-if [ "$debian" == "bookworm" ]; then
-    if ynh_compare_current_package_version --comparison le --version 4.0.2~ynh1; then
-    ynh_die --message="Please consider first upgrade Mobilizon to version 4.1.0~ynh1"
-    fi
-    if [ "$YNH_ARCH" == "arm64" ]; then
-    ynh_die --message="No more arm64 package"
-    fi
-fi
+ynh_script_progression "Ensuring downward compatibility..."
 
 # Cleanup
-ynh_secure_remove --file="$install_dir/$app/priv/data/GeoLite2-City.mmdb"
-ynh_secure_remove --file="/usr/share/GeoIP"
+ynh_safe_rm "$install_dir/$app/priv/data/GeoLite2-City.mmdb"
+ynh_safe_rm "/usr/share/GeoIP"
 
 # Move legacy configuration files
 if [ ! -f "$install_dir/config.exs" ]; then
     if [ -f "$install_dir/live/config/prod.secret.exs" ]; then
-        ynh_delete_file_checksum --file="$install_dir/live/config/prod.secret.exs"
+        ynh_delete_file_checksum "$install_dir/live/config/prod.secret.exs"
         mv -f "$install_dir/live/config/prod.secret.exs" "$install_dir/config.exs"
     fi
     if [ -f "$install_dir/live/config/runtime.exs" ]; then
-        ynh_delete_file_checksum --file="$install_dir/live/config/runtime.exs"
+        ynh_delete_file_checksum "$install_dir/live/config/runtime.exs"
         mv -f "$install_dir/live/config/runtime.exs" "$install_dir/config.exs"
     fi
     if [ -f "/etc/$app/config.exs" ]; then
-        ynh_delete_file_checksum --file="/etc/$app/config.exs"
+        ynh_delete_file_checksum "/etc/$app/config.exs"
         mv -f "/etc/$app/config.exs" "$install_dir/config.exs"
-        ynh_secure_remove --file="/etc/$app"
+        ynh_safe_rm "/etc/$app"
     fi
     chown -R "$app:$app" "$install_dir/config.exs"
-    ynh_store_file_checksum --file="$install_dir/config.exs"
+    ynh_store_file_checksum "$install_dir/config.exs"
 fi
 # Check if previous "if block" did the job
 if [ ! -f "$install_dir/config.exs" ]; then
-    ynh_die --message="Could not find a previous configuration file. Please contact maintainers on the forum."
+    ynh_die "Could not find a previous configuration file. Please contact maintainers on the forum."
 fi
 
 # Migrate data to data_dir
 # FIXME: could be old, might be nice to remove
 if [ -e "$install_dir/$app/uploads/" ] && [ -n "$(ls -A "$install_dir/$app/uploads/")" ]; then
-    ynh_script_progression --message="Moving data directory..."
+    ynh_script_progression "Moving data directory..."
     rsync -a "$install_dir/$app/uploads/" "$data_dir/uploads/"
-    ynh_secure_remove "$install_dir/$app/uploads"
+    ynh_safe_rm "$install_dir/$app/uploads"
 
-    if grep "Mobilizon.Web.Upload.Uploader.Local" "$MOBILIZON_CONFIG_PATH" >/dev/null; then
-        ynh_replace_string --target_file="$MOBILIZON_CONFIG_PATH" \
-            --match_string="uploads: \".*/uploads\"" \
-            --replace_string="$data_dir/uploads"
+    if grep "Mobilizon.Web.Upload.Uploader.Local" "$install_dir/config.exs" >/dev/null; then
+        ynh_replace --file="$install_dir/config.exs" \
+            --match="uploads: \".*/uploads\"" \
+            --replace="$data_dir/uploads"
     else
-        ynh_add_config --template="uploads.exs" --destination="$install_dir/uploads.exs"
-        cat "$install_dir/uploads.exs" >> "$MOBILIZON_CONFIG_PATH"
-        ynh_secure_remove --file="$install_dir/uploads.exs"
+        ynh_config_add --template="uploads.exs" --destination="$install_dir/uploads.exs"
+        cat "$install_dir/uploads.exs" >> "$install_dir/config.exs"
+        ynh_safe_rm "$install_dir/uploads.exs"
     fi
 fi
 
 #=================================================
 # DOWNLOAD, CHECK AND UNPACK SOURCE
 #=================================================
-ynh_script_progression --message="Upgrading source files..."
+ynh_script_progression "Upgrading source files..."
 
-# Download, check integrity, uncompress and patch the source from app.src
-ynh_setup_source --source_id=$debian --dest_dir="$install_dir/live" --full_replace=1
+ynh_setup_source --dest_dir="$install_dir/live" --full_replace
 
 chmod -R o-rwx "$install_dir"
 chown -R "$app:www-data" "$install_dir"
@@ -91,44 +73,42 @@ chown -R "$app:www-data" "$install_dir"
 #=================================================
 # UPDATE A CONFIG FILE
 #=================================================
-ynh_script_progression --message="Updating a configuration file..."
+ynh_script_progression "Updating configuration..."
 
-ynh_backup_if_checksum_is_different --file="$MOBILIZON_CONFIG_PATH"
-ynh_replace_string --match_string="adapter: Bamboo.SMTPAdapter," --replace_string="adapter: Swoosh.Adapters.SMTP," --target_file="$MOBILIZON_CONFIG_PATH"
-ynh_replace_string --match_string="server: \"127.0.0.1\"," --replace_string="relay: \"127.0.0.1\"," --target_file="$MOBILIZON_CONFIG_PATH"
-ynh_store_file_checksum --file="$MOBILIZON_CONFIG_PATH"
+ynh_backup_if_checksum_is_different "$install_dir/config.exs"
+ynh_replace --match="adapter: Bamboo.SMTPAdapter," --replace="adapter: Swoosh.Adapters.SMTP," --file="$install_dir/config.exs"
+ynh_replace --match="server: \"127.0.0.1\"," --replace="relay: \"127.0.0.1\"," --file="$install_dir/config.exs"
+ynh_store_file_checksum "$install_dir/config.exs"
 
-chmod 400 "$MOBILIZON_CONFIG_PATH"
-chown "$app:$app" "$MOBILIZON_CONFIG_PATH"
+chmod 400 "$install_dir/config.exs"
+chown "$app:$app" "$install_dir/config.exs"
 
 #=================================================
 # MAKE SETUP
 #=================================================
-ynh_script_progression --message="Migrating app..."
+ynh_script_progression "Migrating app..."
 
-ynh_exec_as "$app" MOBILIZON_CONFIG_PATH="$MOBILIZON_CONFIG_PATH" "$install_dir/live/bin/mobilizon_ctl" migrate
+ynh_exec_as_app MOBILIZON_CONFIG_PATH="$install_dir/config.exs" "$install_dir/live/bin/mobilizon_ctl" migrate
 
 #=================================================
 # REAPPLY SYSTEM CONFIGURATIONS
 #=================================================
-ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
+ynh_script_progression "Upgrading system configurations related to $app..."
 
-# Create a dedicated NGINX config
-ynh_add_nginx_config
+ynh_config_add_nginx
 
-# Create a dedicated systemd config
-ynh_add_systemd_config
+ynh_config_add_systemd
 yunohost service add "$app" --description="$app daemon for Mobilizon"
 
 #=================================================
 # START SYSTEMD SERVICE
 #=================================================
-ynh_script_progression --message="Starting a systemd service..."
+ynh_script_progression "Starting $app's systemd service..."
 
-ynh_systemd_action --service_name="$app" --action="start" --log_path=systemd --line_match="Access Mobilizon.Web.Endpoint at"
+ynh_systemctl --service="$app" --action="start" --log_path=systemd --wait_until="Access Mobilizon.Web.Endpoint at"
 
 #=================================================
 # END OF SCRIPT
 #=================================================
 
-ynh_script_progression --message="Upgrade of $app completed"
+ynh_script_progression "Upgrade of $app completed"
diff --git a/tests.toml b/tests.toml
index b76ac3b..2d6a56f 100644
--- a/tests.toml
+++ b/tests.toml
@@ -14,4 +14,5 @@ test_format = 1.0
     #test_upgrade_from.0159fc6123536cdf2929b4617d89753283f6946d.name = "2.0.2~ynh1"
     #test_upgrade_from.2dd97e495207a1b5e58b8ba5f501fe84d1db7623.name = "2.0.2~ynh2"
     #test_upgrade_from.f9c1792c86cffd17b72a48160a64ee2083d5ccf6.name = "2.1.0~ynh1"
-    test_upgrade_from.5a000a893e6fc753cf7a6f5782bf7de0e55b8154.name = "4.1.0~ynh1"
+    #test_upgrade_from.5a000a893e6fc753cf7a6f5782bf7de0e55b8154.name = "4.1.0~ynh1"
+    test_upgrade_from.d2784908e27f2e3368a876c012d4ebe987096a93.name = "5.1.0~ynh1"


Reviews:
user: login: yalh76
body: just a few quick fixes
state: CHANGES_REQUESTED
author_association: MEMBER
submitted_at: 2025-03-05T20:30:26Z
user: login: rodinux
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-07T19:36:34Z
user: login: rodinux
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-07T19:42:47Z
user: login: rodinux
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-07T19:43:45Z
user: login: rodinux
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-07T19:45:14Z
user: login: rodinux
body: LGTM
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-07T22:44:02Z
user: login: rodinux
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-07T22:45:22Z

Review comments:
diff_hunk: @@ -14,51 +8,46 @@ source /usr/share/yunohost/helpers
 #=================================================
 
 admin_email=$(ynh_user_get_info --username="$admin" --key="mail")
-ynh_app_setting_set --app="$app" --key="admin_email" --value="$admin_email"
+ynh_app_setting_set --key="admin_email" --value="$admin_email"
 
 ynh_user_password=$(ynh_string_random --length=30)
-ynh_app_setting_set --app="$app" --key="ynh_user_password" --value="$ynh_user_password"
+ynh_app_setting_set --key="ynh_user_password" --value="$ynh_user_password"
 
 #=================================================
 # CREATE DEDICATED USER
 #=================================================
-ynh_script_progression --message="Configuring yunohost users..."
+ynh_script_progression "Configuring yunohost users..."
 
 yunohost user create "$ynh_user" -F "Mobilizon Notifications" --domain "$domain" --password "$ynh_user_password" -q 0
 yunohost user update "$ynh_user" --add-mailalias "$app@$domain" --add-mailforward "$admin_email"
 
 #=================================================
 # CREATE A POSTGRESQL DATABASE
 #=================================================
-ynh_script_progression --message="Configuring the PostgreSQL database..."
+ynh_script_progression "Configuring the PostgreSQL database..."
 
-# FIXME: Really superuser ??
-ynh_psql_execute_as_root --database="$db_name" --sql="ALTER USER $db_user WITH SUPERUSER;"
-ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS postgis;"
-ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;"
-ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS unaccent;"
+ynh_psql_db_shell <<< "ALTER USER $db_user WITH SUPERUSER;"
+ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS postgis;"
+ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
+ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS unaccent;"
 
 #=================================================
 # DOWNLOAD, CHECK AND UNPACK SOURCE
 #=================================================
-ynh_script_progression --message="Setting up source files..."
-
-# Download, check integrity, uncompress and patch the source from app.src
-ynh_setup_source --source_id=$debian --dest_dir="$install_dir/live"
+ynh_script_progression "Setting up source files..."
 
-chmod -R o-rwx "$install_dir"
-chown -R "$app:www-data" "$install_dir"
+ynh_setup_source --dest_dir="$install_dir/live"
 
 #=================================================
 # MAKE SETUP
 #=================================================
-ynh_script_progression --message="Making setup..."
+ynh_script_progression "Making setup..."
 
 pushd "$install_dir/live"
-    ynh_exec_as "$app" MOBILIZON_CONFIG_PATH="$MOBILIZON_CONFIG_PATH" MIX_ENV=prod \
+    ynh_exec_as_app MOBILIZON_CONFIG_PATH="$install_dir/config.exs" MIX_ENV=prod \
         ./bin/mobilizon_ctl instance gen --force \
-        --output "$MOBILIZON_CONFIG_PATH" \
-        --output-psql "$install_dir/setup_db.psql" \
+        --output "$install_dir/config.exs" \
+        --output-psql "$install_dir/setub_db.psql" \
path: scripts/install
user: login: yalh76
body: ```suggestion
        --output-psql "$install_dir/setup_db.psql" \
```
created_at: 2025-03-05T20:25:44Z
author_association: MEMBER
diff_hunk: @@ -1,23 +1,11 @@
 #!/bin/bash
 
 #=================================================
-# COMMON VARIABLES
+# COMMON VARIABLES AND CUSTOM HELPERS
 #=================================================
 
 ynh_user="${app}_notifs"
 
 MOBILIZON_CONFIG_PATH="$install_dir/config.exs"
 
path: scripts/_common.sh
user: login: yalh76
body: ```suggestion

```
created_at: 2025-03-05T20:27:16Z
author_association: MEMBER
diff_hunk: @@ -14,51 +8,46 @@ source /usr/share/yunohost/helpers
 #=================================================
 
 admin_email=$(ynh_user_get_info --username="$admin" --key="mail")
-ynh_app_setting_set --app="$app" --key="admin_email" --value="$admin_email"
+ynh_app_setting_set --key="admin_email" --value="$admin_email"
 
 ynh_user_password=$(ynh_string_random --length=30)
-ynh_app_setting_set --app="$app" --key="ynh_user_password" --value="$ynh_user_password"
+ynh_app_setting_set --key="ynh_user_password" --value="$ynh_user_password"
 
 #=================================================
 # CREATE DEDICATED USER
 #=================================================
-ynh_script_progression --message="Configuring yunohost users..."
+ynh_script_progression "Configuring yunohost users..."
 
 yunohost user create "$ynh_user" -F "Mobilizon Notifications" --domain "$domain" --password "$ynh_user_password" -q 0
 yunohost user update "$ynh_user" --add-mailalias "$app@$domain" --add-mailforward "$admin_email"
 
 #=================================================
 # CREATE A POSTGRESQL DATABASE
 #=================================================
-ynh_script_progression --message="Configuring the PostgreSQL database..."
+ynh_script_progression "Configuring the PostgreSQL database..."
 
-# FIXME: Really superuser ??
-ynh_psql_execute_as_root --database="$db_name" --sql="ALTER USER $db_user WITH SUPERUSER;"
-ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS postgis;"
-ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;"
-ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS unaccent;"
+ynh_psql_db_shell <<< "ALTER USER $db_user WITH SUPERUSER;"
+ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS postgis;"
+ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
+ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS unaccent;"
 
 #=================================================
 # DOWNLOAD, CHECK AND UNPACK SOURCE
 #=================================================
-ynh_script_progression --message="Setting up source files..."
-
-# Download, check integrity, uncompress and patch the source from app.src
-ynh_setup_source --source_id=$debian --dest_dir="$install_dir/live"
+ynh_script_progression "Setting up source files..."
 
-chmod -R o-rwx "$install_dir"
-chown -R "$app:www-data" "$install_dir"
+ynh_setup_source --dest_dir="$install_dir/live"
 
 #=================================================
 # MAKE SETUP
 #=================================================
-ynh_script_progression --message="Making setup..."
+ynh_script_progression "Making setup..."
 
 pushd "$install_dir/live"
-    ynh_exec_as "$app" MOBILIZON_CONFIG_PATH="$MOBILIZON_CONFIG_PATH" MIX_ENV=prod \
+    ynh_exec_as_app MOBILIZON_CONFIG_PATH="$install_dir/config.exs" MIX_ENV=prod \
         ./bin/mobilizon_ctl instance gen --force \
-        --output "$MOBILIZON_CONFIG_PATH" \
-        --output-psql "$install_dir/setup_db.psql" \
+        --output "$install_dir/config.exs" \
+        --output-psql "$install_dir/setub_db.psql" \
path: scripts/install
user: login: rodinux
body: sorry I haven't seen !
created_at: 2025-03-07T19:36:34Z
author_association: COLLABORATOR
diff_hunk: @@ -1,23 +1,11 @@
 #!/bin/bash
 
 #=================================================
-# COMMON VARIABLES
+# COMMON VARIABLES AND CUSTOM HELPERS
 #=================================================
 
 ynh_user="${app}_notifs"
 
 MOBILIZON_CONFIG_PATH="$install_dir/config.exs"
 
path: scripts/_common.sh
user: login: rodinux
body: not sure... ut is used here
```
/git/github/Yunohost/mobilizon_ynh/conf/systemd.service:
    7  User=__APP__
    8  Group=__APP__
    9: Environment=MOBILIZON_CONFIG_PATH="__INSTALL_DIR__/config.exs"
   10  WorkingDirectory=__INSTALL_DIR__/live/
   11  ExecStart=__INSTALL_DIR__/live/bin/mobilizon start

~/git/github/Yunohost/mobilizon_ynh/scripts/install:
   45  
   46  pushd "$install_dir/live"
   47:     ynh_exec_as_app MOBILIZON_CONFIG_PATH="$install_dir/config.exs" MIX_ENV=prod \
   48          ./bin/mobilizon_ctl instance gen --force \
   49          --output "$install_dir/config.exs" \
   ..
   74  chown "$app:$app" "$install_dir/config.exs"
   75  
   76: ynh_exec_as_app MOBILIZON_CONFIG_PATH="$install_dir/config.exs" "$install_dir/live/bin/mobilizon_ctl" migrate
   77  
   78  #=================================================
   ..
   94  
   95  # We generate a dummy password... this will actually *not* be used because the admin is supposed to connect via the ldap
   96: ynh_exec_as_app MOBILIZON_CONFIG_PATH="$install_dir/config.exs" "$install_dir/live/bin/mobilizon_ctl" \
   97      users.new "$admin_email" --admin --password "$(ynh_string_random --length=30)"
   98  

~/git/github/Yunohost/mobilizon_ynh/scripts/upgrade:
   89  ynh_script_progression "Migrating app..."
   90  
   91: ynh_exec_as_app MOBILIZON_CONFIG_PATH="$install_dir/config.exs" "$install_dir/live/bin/mobilizon_ctl" migrate
   92  
   93  #=================================================
```
created_at: 2025-03-07T19:42:47Z
author_association: COLLABORATOR
diff_hunk: @@ -1,23 +1,11 @@
 #!/bin/bash
 
 #=================================================
-# COMMON VARIABLES
+# COMMON VARIABLES AND CUSTOM HELPERS
 #=================================================
 
 ynh_user="${app}_notifs"
 
 MOBILIZON_CONFIG_PATH="$install_dir/config.exs"
 
path: scripts/_common.sh
user: login: rodinux
body: seems a variable needed by Mobilizon ? 
created_at: 2025-03-07T19:43:45Z
author_association: COLLABORATOR
diff_hunk: @@ -14,51 +8,46 @@ source /usr/share/yunohost/helpers
 #=================================================
 
 admin_email=$(ynh_user_get_info --username="$admin" --key="mail")
-ynh_app_setting_set --app="$app" --key="admin_email" --value="$admin_email"
+ynh_app_setting_set --key="admin_email" --value="$admin_email"
 
 ynh_user_password=$(ynh_string_random --length=30)
-ynh_app_setting_set --app="$app" --key="ynh_user_password" --value="$ynh_user_password"
+ynh_app_setting_set --key="ynh_user_password" --value="$ynh_user_password"
 
 #=================================================
 # CREATE DEDICATED USER
 #=================================================
-ynh_script_progression --message="Configuring yunohost users..."
+ynh_script_progression "Configuring yunohost users..."
 
 yunohost user create "$ynh_user" -F "Mobilizon Notifications" --domain "$domain" --password "$ynh_user_password" -q 0
 yunohost user update "$ynh_user" --add-mailalias "$app@$domain" --add-mailforward "$admin_email"
 
 #=================================================
 # CREATE A POSTGRESQL DATABASE
 #=================================================
-ynh_script_progression --message="Configuring the PostgreSQL database..."
+ynh_script_progression "Configuring the PostgreSQL database..."
 
-# FIXME: Really superuser ??
-ynh_psql_execute_as_root --database="$db_name" --sql="ALTER USER $db_user WITH SUPERUSER;"
-ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS postgis;"
-ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;"
-ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS unaccent;"
+ynh_psql_db_shell <<< "ALTER USER $db_user WITH SUPERUSER;"
+ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS postgis;"
+ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
+ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS unaccent;"
 
 #=================================================
 # DOWNLOAD, CHECK AND UNPACK SOURCE
 #=================================================
-ynh_script_progression --message="Setting up source files..."
-
-# Download, check integrity, uncompress and patch the source from app.src
-ynh_setup_source --source_id=$debian --dest_dir="$install_dir/live"
+ynh_script_progression "Setting up source files..."
 
-chmod -R o-rwx "$install_dir"
-chown -R "$app:www-data" "$install_dir"
+ynh_setup_source --dest_dir="$install_dir/live"
 
 #=================================================
 # MAKE SETUP
 #=================================================
-ynh_script_progression --message="Making setup..."
+ynh_script_progression "Making setup..."
 
 pushd "$install_dir/live"
-    ynh_exec_as "$app" MOBILIZON_CONFIG_PATH="$MOBILIZON_CONFIG_PATH" MIX_ENV=prod \
+    ynh_exec_as_app MOBILIZON_CONFIG_PATH="$install_dir/config.exs" MIX_ENV=prod \
         ./bin/mobilizon_ctl instance gen --force \
-        --output "$MOBILIZON_CONFIG_PATH" \
-        --output-psql "$install_dir/setup_db.psql" \
+        --output "$install_dir/config.exs" \
+        --output-psql "$install_dir/setub_db.psql" \
path: scripts/install
user: login: rodinux
body: Ok, I changed it 
created_at: 2025-03-07T19:45:13Z
author_association: COLLABORATOR
diff_hunk: @@ -1,23 +1,11 @@
 #!/bin/bash
 
 #=================================================
-# COMMON VARIABLES
+# COMMON VARIABLES AND CUSTOM HELPERS
 #=================================================
 
 ynh_user="${app}_notifs"
 
 MOBILIZON_CONFIG_PATH="$install_dir/config.exs"
 
path: scripts/_common.sh
user: login: rodinux
body: Sorry, it's clear... redondance...
created_at: 2025-03-07T22:45:22Z
author_association: COLLABORATOR

PR comments:
user: login: yalh76
created_at: 2025-03-05T18:09:58Z
body: !testme


author_association: MEMBER
user: login: yunohost-bot
created_at: 2025-03-05T18:10:01Z
body: Living in the past, are we? :cow::eye:
[![Test Badge](https://img.shields.io/endpoint?url=https://ci-apps-bullseye-dev.yunohost.org/ci/api/job/22845/badge)](https://ci-apps-bullseye-dev.yunohost.org/ci/job/22845)
[![](https://ci-apps-bullseye-dev.yunohost.org/ci/summary/22845.png)](https://ci-apps-bullseye-dev.yunohost.org/ci/job/22845)
author_association: CONTRIBUTOR
user: login: yunohost-bot
created_at: 2025-03-05T18:10:01Z
body: Meow :cat2:
[![Test Badge](https://img.shields.io/endpoint?url=https://ci-apps-dev.yunohost.org/ci/api/job/7313/badge)](https://ci-apps-dev.yunohost.org/ci/job/7313)
[![](https://ci-apps-dev.yunohost.org/ci/summary/7313.png)](https://ci-apps-dev.yunohost.org/ci/job/7313)
author_association: CONTRIBUTOR
user: login: rodinux
created_at: 2025-03-07T19:47:39Z
body: @yalh76 sorry to see this only now... Do you accept like this ? 
author_association: COLLABORATOR