From 58e65bab09c942193a6cc7bd5cfc47e02e633dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 5 Aug 2023 08:49:13 +0200 Subject: [PATCH] cleaning --- manifest.toml | 4 ++-- scripts/_common.sh | 1 - scripts/backup | 3 +-- scripts/install | 3 --- scripts/remove | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 -- 7 files changed, 5 insertions(+), 12 deletions(-) diff --git a/manifest.toml b/manifest.toml index edf1ef5..e5f430c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -2,8 +2,8 @@ packaging_format = 2 id = "streams" name = "Streams" -description.en = "An open source fediverse server" -description.fr = "Un serveur fediverse open source" +description.en = "Open source fediverse server" +description.fr = "Serveur fediverse open source" version = "23.08.02~ynh5" diff --git a/scripts/_common.sh b/scripts/_common.sh index d16461c..3b59e88 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,6 @@ # PHP APP SPECIFIC #================================================= -YNH_PHP_VERSION="8.2" YNH_COMPOSER_VERSION="2.5.8" #================================================= diff --git a/scripts/backup b/scripts/backup index b9357d5..9d780ff 100644 --- a/scripts/backup +++ b/scripts/backup @@ -57,9 +57,8 @@ ynh_backup --src_path="/etc/cron.d/$app" #================================================= # BACKUP THE DATABASE #================================================= - -# Backup MySQL database ynh_print_info --message="Backup of the MySQL database..." + ynh_mysql_dump_db --database="$db_name" > db.sql #================================================= diff --git a/scripts/install b/scripts/install index c41233c..9d2a444 100755 --- a/scripts/install +++ b/scripts/install @@ -35,13 +35,11 @@ ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage #================================================= # CREATE A DATABASE #================================================= - ynh_script_progression --message="Creating a database..." --weight=2 ynh_mysql_connect_as --user=$db_user --password="$db_pwd" --database=$db_name \ <<< "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -73,7 +71,6 @@ ynh_add_nginx_config #================================================= # COMPOSER #================================================= - ynh_script_progression --message="Pulling in external libraries with Composer..." ynh_install_composer diff --git a/scripts/remove b/scripts/remove index 6d4e79c..8101afc 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the dedicated NGINX config ynh_remove_nginx_config diff --git a/scripts/restore b/scripts/restore index 89e70e0..0c7de08 100644 --- a/scripts/restore +++ b/scripts/restore @@ -23,8 +23,8 @@ chown -R $app:www-data "$install_dir" #================================================= # RESTORE THE DATABASE #================================================= - ynh_script_progression --message="Restoring MySQL database..." --weight=1 + ynh_mysql_connect_as --user=$db_user --password="$db_pwd" --database=$db_name \ <<< "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;" ynh_mysql_execute_file_as_root --file="./db.sql" --database=$db_name diff --git a/scripts/upgrade b/scripts/upgrade index 80a9dfc..d4d81a3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,7 +29,6 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - # If fpm_footprint doesn't exist, create it if [ -z "$fpm_footprint" ]; then fpm_footprint=low @@ -82,7 +81,6 @@ ynh_add_nginx_config #================================================= # COMPOSER #================================================= - ynh_script_progression --message="Pulling in external libraries with Composer..." ynh_install_composer