From 3d8214f6ddf8f3b400fe5d7913c6021bd2eddc5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 29 Jan 2024 17:57:25 +0100 Subject: [PATCH] Cleanup, fixup packagingv2 --- manifest.toml | 17 ++++++++--------- scripts/_common.sh | 2 +- scripts/install | 5 +++-- scripts/restore | 1 - scripts/upgrade | 3 +-- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/manifest.toml b/manifest.toml index 8accf03..51c9161 100644 --- a/manifest.toml +++ b/manifest.toml @@ -4,8 +4,8 @@ packaging_format = 2 id = "movim" name = "Movim" -description.en = "Web-based cross-platform XMPP client" -description.fr = "Client XMPP multiplateforme basé sur le Web" +description.en = "Decentralized social platform based on XMPP" +description.fr = "Plateforme sociale décentralisée basée sur XMPP" version = "0.19~ynh5" @@ -20,14 +20,14 @@ code = "https://github.com/movim/movim" cpe = "cpe:2.3:a:movim:movim" [integration] -yunohost = ">= 11.0.9" +yunohost = ">= 11.2" architectures = "all" multi_instance = false ldap = false sso = false -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +disk = "50M" +ram.build = "100M" +ram.runtime = "50M" [install] [install.domain] @@ -54,6 +54,8 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen autoupdate.strategy = "latest_github_tag" + [resources.ports] + [resources.system_user] [resources.install_dir] @@ -61,9 +63,6 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [resources.permissions] main.url = "/" - [resources.ports] - main.default = 9537 - [resources.apt] packages = [ "php7.4-curl", diff --git a/scripts/_common.sh b/scripts/_common.sh index 6257395..ff3a014 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -composer_version="2.2.5" +YNH_COMPOSER_VERSION="2.2.5" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index c414727..9326fbb 100644 --- a/scripts/install +++ b/scripts/install @@ -39,7 +39,6 @@ ynh_setup_source --dest_dir="$install_dir" # Temporary workaround to fix movim.ERROR: Error: Call to undefined function GuzzleHttp\Psr7\uri_for() ynh_replace_string --match_string="0.3.5" --replace_string="0.4.1" --target_file="$install_dir/composer.json" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" @@ -50,7 +49,7 @@ chown -R "$app:www-data" "$install_dir" #================================================= ynh_script_progression --message="Adding a configuration file..." -ynh_add_config --template="../conf/db.example.inc.php" --destination="$install_dir/config/db.inc.php" +ynh_add_config --template="db.example.inc.php" --destination="$install_dir/config/db.inc.php" chmod 400 "$install_dir/config/db.inc.php" chown "$app:$app" "$install_dir/config/db.inc.php" @@ -60,7 +59,9 @@ chown "$app:$app" "$install_dir/config/db.inc.php" #================================================= ynh_script_progression --message="Building Movim..." +# Install composer ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$install_dir" + ynh_exec_warn_less ynh_composer_exec --phpversion="$phpversion" --workdir="$install_dir" --commands="movim:migrate" ynh_exec_as "$app" "php$phpversion" "$install_dir/daemon.php" config --username="$admin" --password="$password" --quiet diff --git a/scripts/restore b/scripts/restore index 8e401d0..7708021 100644 --- a/scripts/restore +++ b/scripts/restore @@ -17,7 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" diff --git a/scripts/upgrade b/scripts/upgrade index 290e3e9..7c13422 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -52,7 +52,6 @@ ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="config/db.in # Temporary workaround to fix movim.ERROR: Error: Call to undefined function GuzzleHttp\Psr7\uri_for() ynh_replace_string --match_string="0.3.5" --replace_string="0.4.1" --target_file="$install_dir/composer.json" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" @@ -63,7 +62,7 @@ chown -R "$app:www-data" "$install_dir" #================================================= ynh_script_progression --message="Updating a configuration file..." -ynh_add_config --template="../conf/db.example.inc.php" --destination="$install_dir/config/db.inc.php" +ynh_add_config --template="db.example.inc.php" --destination="$install_dir/config/db.inc.php" chmod 400 "$install_dir/config/db.inc.php" chown "$app:$app" "$install_dir/config/db.inc.php"