From ff2ca7a566b8eb16dcf0e38f6131c29e154eb4ef Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Fri, 30 Aug 2024 23:31:20 +0200 Subject: [PATCH] [autopatch] Automatic patch attempt for helpers 2.1 --- manifest.toml | 4 +++- scripts/backup | 17 ++++------------- scripts/install | 9 ++++----- scripts/remove | 4 ++-- scripts/restore | 25 +++++++++---------------- scripts/upgrade | 9 ++++----- 6 files changed, 26 insertions(+), 42 deletions(-) diff --git a/manifest.toml b/manifest.toml index 4c39956..a328f52 100644 --- a/manifest.toml +++ b/manifest.toml @@ -13,7 +13,8 @@ maintainers = ["alexAubin"] license = "WTFPL" [integration] -yunohost = ">= 11.1" +yunohost = ">= 11.2.18" +helpers_version = "2.1" architectures = "all" multi_instance = false ldap = "not_relevant" @@ -40,6 +41,7 @@ ram.runtime = "1M" [resources.system_user] [resources.install_dir] + group = "www-data:r-x" [resources.permissions] main.url = "/" diff --git a/scripts/backup b/scripts/backup index a6b113b..24cbaff 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,32 +1,23 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source /usr/share/yunohost/helpers -#================================================= -# DECLARE DATA AND CONF FILES TO BACKUP -#================================================= -ynh_print_info --message="Declaring files to be backed up..." +ynh_print_info "Declaring files to be backed up..." #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$install_dir" +ynh_backup "$install_dir" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." +ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/install b/scripts/install index 9fe6be7..f39a24c 100644 --- a/scripts/install +++ b/scripts/install @@ -5,15 +5,14 @@ source /usr/share/yunohost/helpers #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --weight=1 +ynh_script_progression "Setting up source files..." echo "Hello world!" > $install_dir/index.html -chown -R www-data: "$install_dir" - +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R www-data: "$install_dir" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --weight=1 +ynh_script_progression "Configuring nginx web server..." # Create a dedicated nginx config -ynh_add_nginx_config +ynh_config_add_nginx diff --git a/scripts/remove b/scripts/remove index 295a003..16da22f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -5,6 +5,6 @@ source /usr/share/yunohost/helpers #================================================= # REMOVE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." --weight=1 +ynh_script_progression "Removing nginx web server configuration..." -ynh_remove_nginx_config +ynh_config_remove_nginx diff --git a/scripts/restore b/scripts/restore index 83a0b59..458a7a6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,40 +1,33 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source /usr/share/yunohost/helpers #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=1 +ynh_script_progression "Restoring the app main directory..." -ynh_restore_file --origin_path="$install_dir" +ynh_restore "$install_dir" # Restore permissions on app files -chown -R $app:www-data $install_dir -chmod -R o-rwx $install_dir - +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data $install_dir +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx $install_dir #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1 +ynh_script_progression "Restoring the NGINX configuration..." -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=2 +ynh_script_progression "Reloading NGINX web server..." -ynh_systemd_action --service_name=nginx --action=reload +ynh_systemctl --service=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression "Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index 9fe6be7..f39a24c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -5,15 +5,14 @@ source /usr/share/yunohost/helpers #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --weight=1 +ynh_script_progression "Setting up source files..." echo "Hello world!" > $install_dir/index.html -chown -R www-data: "$install_dir" - +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R www-data: "$install_dir" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --weight=1 +ynh_script_progression "Configuring nginx web server..." # Create a dedicated nginx config -ynh_add_nginx_config +ynh_config_add_nginx