From 08bd58fd0ea378960efe4ee5193af1d1dd02a7a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 12 Mar 2023 18:14:24 +0100 Subject: [PATCH] fix --- manifest.toml | 3 +-- scripts/install | 4 +--- scripts/upgrade | 62 +------------------------------------------------ 3 files changed, 3 insertions(+), 66 deletions(-) diff --git a/manifest.toml b/manifest.toml index bcf80e3..8b64a71 100644 --- a/manifest.toml +++ b/manifest.toml @@ -40,8 +40,7 @@ ram.runtime = "50M" [resources] [resources.sources.main] url = "https://github.com/misterunknown/ifm/releases/download/v4.0.0/ifm.php" - sha256 = "sha256 checksum" - + sha256 = "59a888e454a083a420c074e303507e0efd41fb10272f52860c8e6d9cc640aea4" [resources.system_user] diff --git a/scripts/install b/scripts/install index fd22648..86cef37 100755 --- a/scripts/install +++ b/scripts/install @@ -30,10 +30,8 @@ ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage #================================================= ynh_script_progression --message="Setting up source files..." --weight=3 -mkdir -p $install_dir -mv "../sources/ifm.php" "$install_dir/ifm.php" +ynh_setup_source --dest_dir="$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 d5ff323..84a36fc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,53 +9,17 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) - -#REMOVEME? fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -#REMOVEME? fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) -#REMOVEME? fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) - #================================================= # CHECK VERSION #================================================= upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# If install_dir doesn't exist, create it -if [ -z "$install_dir" ]; then -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir -fi - # If fpm_footprint doesn't exist, create it if [ -z "$fpm_footprint" ]; then fpm_footprint=low @@ -74,14 +38,6 @@ if [ -z "$fpm_usage" ]; then ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage fi -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -90,20 +46,12 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=2 - mv -f "../sources/ifm.php" "$install_dir/ifm.php" + ynh_setup_source --dest_dir="$install_dir" fi -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=1 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -111,7 +59,6 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION @@ -121,13 +68,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #=================================================