From 8dfaf20f9f1bb73b4ce74b520dbe8b8cf41a02a2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 7 Nov 2020 19:15:46 +0100 Subject: [PATCH] Set PHP7.3 --- scripts/_common.sh | 15 +++++++++++++++ scripts/backup | 5 ----- scripts/install | 8 ++------ scripts/remove | 9 ++++----- scripts/restore | 10 +++++----- scripts/upgrade | 13 ++++++------- 6 files changed, 32 insertions(+), 28 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index e69de29..c7189cd 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +#================================================= +# COMMON VARIABLES +#================================================= + +YNH_PHP_VERSION="7.3" + +#================================================= +# PERSONAL HELPERS +#================================================= + +#================================================= +# EXPERIMENTAL HELPERS +#================================================= diff --git a/scripts/backup b/scripts/backup index 84b8f58..0e57e75 100644 --- a/scripts/backup +++ b/scripts/backup @@ -14,10 +14,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -54,4 +50,3 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." - diff --git a/scripts/install b/scripts/install index 34ed633..1c4edb5 100644 --- a/scripts/install +++ b/scripts/install @@ -54,10 +54,6 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=is_public --value=$is_public -# Check domain/path availability -sudo yunohost app checkurl "${domain}${path}" -a "$app" \ - || ynh_die "Path not available: ${domain}${path}" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -75,14 +71,14 @@ ynh_script_progression --message="Configuring nginx web server..." --time --weig ### `ynh_add_nginx_config` will use the file conf/nginx.conf # Create a dedicated nginx config -ynh_add_nginx_config +ynh_add_nginx_config --phpversion="${YNH_PHP_VERSION}" #================================================= # SECURE FILES AND DIRECTORIES #================================================= # Set permissions to app files -sudo chown -R root: $src_path +chown -R root: $src_path #================================================= # SETUP SSOWAT diff --git a/scripts/remove b/scripts/remove index c883716..af51692 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -29,14 +29,14 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) # 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 - ynh_script_progression --message="Removing $app service integration..." --time --weight=1 + ynh_script_progression --message="Removing $app service integration..." --weight=2 yunohost service remove $app fi #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --time --weight=1 +ynh_script_progression --message="Removing app main directory..." --weight=2 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -44,7 +44,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." --time --weight=1 +ynh_script_progression --message="Removing nginx web server configuration..." --weight=1 # Remove the dedicated nginx config ynh_remove_nginx_config @@ -54,4 +54,3 @@ ynh_remove_nginx_config #================================================= ynh_script_progression --message="Removal of $app completed" --last - diff --git a/scripts/restore b/scripts/restore index a401aa0..af63771 100644 --- a/scripts/restore +++ b/scripts/restore @@ -24,7 +24,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -35,7 +35,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --time --weight=1 +ynh_script_progression --message="Validating restoration parameters..." --weight=2 ynh_webpath_available --domain=$domain --path_url=$path_url \ || ynh_die --message="Path not available: ${domain}${path_url}" @@ -53,7 +53,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --time --weight=1 +ynh_script_progression --message="Restoring the app main directory..." --weight=3 ynh_restore_file --origin_path="$final_path" @@ -69,7 +69,7 @@ chown -R root: $final_path #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 +ynh_script_progression --message="Reloading nginx web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -77,4 +77,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --time --last +ynh_script_progression --message="Restoration completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade index 73768da..ceca251 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -33,7 +33,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1 +ynh_script_progression --message="Ensuring downward compatibility..." --weight=2 # Fix is_public as a boolean value if [ "$is_public" = "Yes" ]; then @@ -53,7 +53,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --time --weight=1 +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 # Backup the current version of the app ynh_backup_before_upgrade @@ -76,7 +76,7 @@ chown -R root: $final_path #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=2 # Make app public if necessary if [ $is_public -eq 1 ] @@ -88,7 +88,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 +ynh_script_progression --message="Reloading nginx web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -96,5 +96,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --time --last - +ynh_script_progression --message="Upgrade of $app completed" --last