From b36057d95ffe72f06fa0d724547b6584896da77c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 12 Dec 2020 15:12:16 +0100 Subject: [PATCH] Fix linter warnings --- check_process | 3 --- manifest.json | 2 +- scripts/backup | 37 +++++++++++++++++++++++++++---------- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 6 files changed, 31 insertions(+), 17 deletions(-) diff --git a/check_process b/check_process index b3e6b98..dfa51b7 100644 --- a/check_process +++ b/check_process @@ -14,11 +14,8 @@ upgrade=1 backup_restore=1 multi_instance=0 - incorrect_path=1 port_already_use=0 change_url=1 -;;; Levels - Level 5=auto ;;; Options Email= Notification=none diff --git a/manifest.json b/manifest.json index 035270a..a1f650e 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "josue@tille.ch" }, "requirements": { - "yunohost": ">= 3.8.0.0" + "yunohost": ">= 3.8.1" }, "multi_instance": false, "services": [ diff --git a/scripts/backup b/scripts/backup index 52ff421..db0fca9 100644 --- a/scripts/backup +++ b/scripts/backup @@ -14,8 +14,11 @@ source /usr/share/yunohost/helpers # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= # LOAD SETTINGS -ynh_script_progression --message="Loading installation settings..." +#================================================= +ynh_print_info --message="Loading installation settings..." + final_path=$(ynh_app_setting_get --app $app --key final_path) domain=$(ynh_app_setting_get --app $app --key domain) db_name=$(ynh_app_setting_get --app $app --key db_name) @@ -24,24 +27,38 @@ app_main_version=$(echo $app_version | cut -d'-' -f1) app_sub_version=$(echo $app_version | cut -d'-' -f2) #================================================= -# STANDARD BACKUP STEPS +# DECLARE DATA AND CONF FILES TO BACKUP +#================================================= +ynh_print_info --message="Declaring files to be backed up..." + +#================================================= +# BACKUP THE APP MAIN DIR #================================================= -# BACKUP THE APP MAIN DIR -ynh_script_progression --message="Backing up the main app directory..." ynh_backup --src_path "$final_path" -# Backup config -ynh_script_progression --message="Backing configuration..." +#================================================= +# BACKUP THE NGINX CONFIGURATION +#================================================= + ynh_backup --src_path "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path "/etc/uwsgi/apps-available/$app.ini" -# Backup Data and LOG -ynh_script_progression --message="Backing up data..." +#================================================= +# BACKUP VARIOUS FILES +#================================================= + ynh_backup --src_path "/var/lib/pgadmin" -ynh_script_progression --message="Backing up log..." + +#================================================= +# BACKUP LOG FILES +#================================================= + ynh_backup --src_path "/var/log/pgadmin" ynh_backup --src_path "/var/log/uwsgi/$app" -ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last +#================================================= +# END OF SCRIPT +#================================================= +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last diff --git a/scripts/install b/scripts/install index d9f0cc8..bb35dfa 100644 --- a/scripts/install +++ b/scripts/install @@ -18,7 +18,7 @@ ynh_script_progression --message="Validating installation parameters..." # RETRIEVE ARGUMENTS FROM THE MANIFEST domain=$YNH_APP_ARG_DOMAIN -path_url=$(ynh_normalize_url_path --path_url $YNH_APP_ARG_PATH) +path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN db_user="pgadmin" admin_pwd=$YNH_APP_ARG_ADMIN_PASSWORD diff --git a/scripts/restore b/scripts/restore index d9621c6..ba2d752 100644 --- a/scripts/restore +++ b/scripts/restore @@ -56,7 +56,7 @@ ynh_psql_execute_as_root \ # Restore systemd configuration ynh_script_progression --message="Reconfiguring application..." ynh_check_global_uwsgi_config -systemctl enable "uwsgi-app@$app.service" +systemctl enable "uwsgi-app@$app.service" --quiet #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 5013c0d..1070481 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -17,7 +17,7 @@ ynh_abort_if_errors # LOAD SETTINGS ynh_script_progression --message="Loading installation settings..." domain=$(ynh_app_setting_get --app $app --key domain) -path_url=$(ynh_normalize_url_path --path_url $(ynh_app_setting_get --app $app --key path)) +path_url=$(ynh_app_setting_get --app $app --key path) admin=$(ynh_app_setting_get --app $app --key admin) app_version=$(ynh_app_upstream_version) app_main_version=$(echo $app_version | cut -d'-' -f1)