diff --git a/manifest.toml b/manifest.toml index 2bd1c7e..d42be30 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,7 +17,7 @@ admindoc = "https://matomo.org/docs" code = "https://github.com/matomo-org/matomo" [integration] -yunohost = ">= 11.2.18" +yunohost = ">= 11.2.29" helpers_version = "2.1" architectures = "all" multi_instance = true diff --git a/scripts/backup b/scripts/backup index 1be73a8..93e6628 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,6 +1,5 @@ #!/bin/bash -# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -13,21 +12,13 @@ ynh_print_info "Declaring files to be backed up..." ynh_backup "$install_dir" #================================================= -# BACKUP THE NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP THE PHP-FPM CONFIGURATION -#================================================= - ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf" -#================================================= -# BACKUP VARIOUS FILES -#================================================= - ynh_backup "/etc/cron.d/$app" #================================================= diff --git a/scripts/change_url b/scripts/change_url index d80dfd6..2975456 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -20,12 +20,12 @@ ynh_config_change_url_nginx ynh_script_progression "Reconfiguring Matomo..." if [[ -f "$install_dir/config/config.ini.php" ]]; then - # config.ini.php is only created during the post-install process... - # it is therefore not present when the CI tests are carried out... - # This condition is only for CI test to go through the upgrade process + # config.ini.php is only created during the post-install process... + # it is therefore not present when the CI tests are carried out... + # This condition is only for CI test to go through the upgrade process - # See https://matomo.org/faq/how-to-install/faq_18/ - ynh_replace --match="$old_domain" --replace="$new_domain" --file="$install_dir/config/config.ini.php" + # See https://matomo.org/faq/how-to-install/faq_18/ + ynh_replace --match="$old_domain" --replace="$new_domain" --file="$install_dir/config/config.ini.php" fi #================================================= @@ -37,8 +37,6 @@ path=$new_path domain=$new_domain ynh_config_add --template="cron" --destination="/etc/cron.d/$app" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown root: "/etc/cron.d/$app" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 644 "/etc/cron.d/$app" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 0e45652..32450c5 100755 --- a/scripts/install +++ b/scripts/install @@ -14,11 +14,8 @@ email=$(ynh_user_get_info --username=$admin --key=mail) #================================================= ynh_script_progression "Setting up source files..." -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$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" -#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" #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -31,8 +28,6 @@ ynh_config_add_phpfpm ynh_config_add_nginx ynh_config_add --template="cron" --destination="/etc/cron.d/$app" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown root: "/etc/cron.d/$app" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 644 "/etc/cron.d/$app" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 53bdd64..e4a3496 100755 --- a/scripts/remove +++ b/scripts/remove @@ -8,13 +8,10 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression "Removing NGINX web server configuration..." -# Remove the dedicated NGINX config ynh_config_remove_nginx -# Remove the dedicated PHP-FPM config ynh_config_remove_phpfpm -# Remove a cron file ynh_safe_rm "/etc/cron.d/$app" #================================================= diff --git a/scripts/restore b/scripts/restore index fc0f0eb..d1dd4c9 100755 --- a/scripts/restore +++ b/scripts/restore @@ -1,6 +1,5 @@ #!/bin/bash -# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -11,8 +10,6 @@ ynh_script_progression "Restoring the app main directory..." ynh_restore "$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" -#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" #================================================= # RESTORE THE MYSQL DATABASE #================================================= @@ -30,8 +27,6 @@ ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf" ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore "/etc/cron.d/$app" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown root: "/etc/cron.d/$app" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 644 "/etc/cron.d/$app" #================================================= # RELOAD NGINX AND PHP-FPM diff --git a/scripts/upgrade b/scripts/upgrade index 8549499..27a0d97 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -6,42 +6,28 @@ source /usr/share/yunohost/helpers #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression "Upgrading source files..." -# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed -if ynh_app_upstream_version_changed -then - ynh_script_progression "Upgrading source files..." - - if [[ ! -f "$install_dir/config/config.ini.php" ]]; then - # config.ini.php is only created during the post-install process... - # it is therefore not present when the CI tests are carried out... - # This condition is only for CI test to go through the upgrade process - ynh_setup_source --dest_dir="$install_dir" - else - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="config/config.ini.php" --full_replace - - #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" - ynh_exec_as_app php${php_version} $install_dir/console core:update -n - fi +if [[ ! -f "$install_dir/config/config.ini.php" ]]; then + # config.ini.php is only created during the post-install process... + # it is therefore not present when the CI tests are carried out... + # This condition is only for CI test to go through the upgrade process + ynh_setup_source --dest_dir="$install_dir" +else + ynh_setup_source --dest_dir="$install_dir" --keep="config/config.ini.php" --full_replace + ynh_exec_as_app php${php_version} $install_dir/console core:update -n fi -#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" -#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" #================================================= # PHP-FPM CONFIGURATION #================================================= ynh_script_progression "Upgrading PHP-FPM configuration..." -# Create a dedicated PHP-FPM config ynh_config_add_phpfpm -# Create a dedicated NGINX config ynh_config_add_nginx ynh_config_add --template="cron" --destination="/etc/cron.d/$app" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown root: "/etc/cron.d/$app" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 644 "/etc/cron.d/$app" #================================================= # END OF SCRIPT