From 5ae284c162633af959577084c69580777b2009c7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 26 Sep 2020 12:04:19 +0200 Subject: [PATCH] Cleaning up --- check_process | 4 ++-- manifest.json | 2 +- scripts/_common.sh | 1 - scripts/change_url | 25 +++++++------------------ scripts/restore | 3 +-- 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/check_process b/check_process index 7f063a2..68d3f85 100644 --- a/check_process +++ b/check_process @@ -21,10 +21,10 @@ setup_public=1 upgrade=1 backup_restore=1 - multi_instance=0 + multi_instance=1 incorrect_path=1 port_already_use=1 - change_url=0 + change_url=1 ;;; Levels Level 1=auto Level 2=auto diff --git a/manifest.json b/manifest.json index 1ab8f2e..287b954 100644 --- a/manifest.json +++ b/manifest.json @@ -16,7 +16,7 @@ "requirements": { "yunohost": ">= 3.8.1" }, - "multi_instance": false, + "multi_instance": true, "services": [ "nginx", "php7.0-fpm", diff --git a/scripts/_common.sh b/scripts/_common.sh index ee07fd7..e2737c1 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,6 @@ # dependencies used by the app pkg_dependencies="postgresql postgresql-contrib apt-transport-https" -#composer YNH_PHP_VERSION="7.3" diff --git a/scripts/change_url b/scripts/change_url index 8d6a19d..755aa88 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -24,20 +24,15 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) -# Add settings here as needed by your application -#db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#db_user=$db_name -#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up Movim before changing its URL (may take a while)..." --time --weight=1 +ynh_script_progression --message="Backing up Movim before changing its URL (may take a while)..." --weight=2 # Backup the current version of the app ynh_backup_before_upgrade @@ -72,14 +67,14 @@ fi #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 +ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -105,25 +100,19 @@ then ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi -#================================================= -# SPECIFIC MODIFICATIONS -#================================================= -# ... -#================================================= - #================================================= # GENERIC FINALISATION #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" #================================================= # 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 @@ -131,4 +120,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for Movim" --time --last +ynh_script_progression --message="Change of URL completed for Movim" --last diff --git a/scripts/restore b/scripts/restore index 8cc5dd6..71f1eab 100644 --- a/scripts/restore +++ b/scripts/restore @@ -15,7 +15,6 @@ source /usr/share/yunohost/helpers #================================================= 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 @@ -121,7 +120,7 @@ yunohost service add $app --description "Responsive web-based XMPP client" --log #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=2 -ynh_systemd_action --service_name=$app --action="start" #--log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" #================================================= # GENERIC FINALIZATION