diff --git a/README.md b/README.md index ae921e0..f5cc5e1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to [AgenDAV](http://agendav.org/) is a CalDAV web client which features an AJAX interface to allow users to manage their own calendars and shared ones. -**Shipped version:** 2.0.0 +**Shipped version:** 2.2.0 ## Screenshots @@ -34,7 +34,6 @@ AJAX interface to allow users to manage their own calendars and shared ones. * x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/agendav%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/agendav/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/agendav%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/agendav/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/agendav%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/agendav/) ## Limitations @@ -53,8 +52,7 @@ AJAX interface to allow users to manage their own calendars and shared ones. --- -Developers info ----------------- +## Developers info Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/agendav_ynh/tree/testing). diff --git a/conf/nginx.conf b/conf/nginx.conf index b2b2b39..b053a41 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -17,7 +17,7 @@ location __PATH__/ { location ~ ^__PATH__/index\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_index index.php; include fastcgi_params; diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index 1094c6c..ad5b935 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -35,7 +35,7 @@ group = __USER__ ; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. - listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock + listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock ; Set listen(2) backlog. ; Default Value: 511 (-1 on FreeBSD and OpenBSD) diff --git a/manifest.json b/manifest.json index f1e2113..82564ae 100644 --- a/manifest.json +++ b/manifest.json @@ -1,21 +1,21 @@ { - "packaging_format": 1, - "id": "agendav", "name": "AgenDAV", + "id": "agendav", + "packaging_format": 1, "description": { "en": "CalDAV web client", "fr": "Client web pour CalDAV" }, "url": "http://agendav.org/", "license": "GPL-3.0", - "version": "2.0.0~ynh1", + "version": "2.2.0~ynh1", "maintainer": { "name": "julien", "email": "julien.malik@paraiso.me" }, "multi_instance": false, "requirements": { - "yunohost": ">= 3.5.0" + "yunohost": ">= 3.8.1" }, "services": [ "nginx", diff --git a/scripts/_common.sh b/scripts/_common.sh index a9bf588..399627f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1 +1,22 @@ #!/bin/bash + +#================================================= +# COMMON VARIABLES +#================================================= + +YNH_PHP_VERSION="7.3" + +extra_php_dependencies="php${YNH_PHP_VERSION}-cli" + +#================================================= +# PERSONAL HELPERS +#================================================= + +#================================================= +# EXPERIMENTAL HELPERS +#================================================= + +#================================================= +# FUTURE OFFICIAL HELPERS +#================================================= + diff --git a/scripts/backup b/scripts/backup index c1789f5..a5d29d0 100644 --- a/scripts/backup +++ b/scripts/backup @@ -14,22 +14,25 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=2 +ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME 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) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= -# 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 #================================================= @@ -46,30 +49,25 @@ ynh_backup --src_path="$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Backing up nginx web server configuration..." ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Backing up php-fpm configuration..." -ynh_backup --src_path="/etc/php/7.0/fpm/pool.d/$app.conf" +ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # BACKUP THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Backing up the MySQL database..." +ynh_print_info --message="Backing up the MySQL database..." ynh_mysql_dump_db --database="$db_name" > db.sql -#================================================= -# SPECIFIC BACKUP #================================================= # BACKUP LOGROTATE #================================================= -ynh_script_progression --message="Backing up logrotate configuration..." ynh_backup --src_path="/etc/logrotate.d/$app" @@ -77,4 +75,4 @@ ynh_backup --src_path="/etc/logrotate.d/$app" # END OF SCRIPT #================================================= -ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last +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 0e575ca..dcbfb4b 100644 --- a/scripts/install +++ b/scripts/install @@ -65,16 +65,6 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=language --value=$language -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# INSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Installing dependencies..." --weight=8 - -# Install dependencies -ynh_install_app_dependencies php-cli - #================================================= # CREATE A MYSQL DATABASE #================================================= @@ -115,7 +105,8 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Configuring php-fpm..." # Copy and set php-fpm configuration -ynh_add_fpm_config +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC SETUP @@ -164,7 +155,7 @@ ynh_script_progression --message="Initialising agendav..." --weight=3 ( cd $final_path - php agendavcli migrations:migrate --no-interaction + php${phpversion} agendavcli migrations:migrate --no-interaction ) #================================================= diff --git a/scripts/remove b/scripts/remove index 7d6c580..622d4f0 100644 --- a/scripts/remove +++ b/scripts/remove @@ -20,16 +20,6 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -#================================================= -# STANDARD REMOVE -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=4 - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - #================================================= # REMOVE THE MYSQL DATABASE #================================================= @@ -56,7 +46,7 @@ ynh_secure_remove --file="/var/log/$app" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." +ynh_script_progression --message="Removing NGINX web server configuration..." # Remove the dedicated nginx config ynh_remove_nginx_config @@ -64,7 +54,7 @@ ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Removing php-fpm configuration..." --weight=2 +ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=2 # Remove the dedicated php-fpm config ynh_remove_fpm_config diff --git a/scripts/restore b/scripts/restore index ab7d41a..62406eb 100644 --- a/scripts/restore +++ b/scripts/restore @@ -13,7 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= @@ -27,6 +26,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -78,8 +78,11 @@ chmod -R 750 ${final_path}/web/config/ #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= +ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=6 -ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf" +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" #================================================= # SPECIFIC RESTORATION @@ -107,9 +110,9 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading nginx web server and php-fpm..." --weight=2 +ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=2 -ynh_systemd_action --service_name=php7.0-fpm --action=reload +ynh_systemd_action --service_name=php${phpversion}-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 480ce6a..9adcbb7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,6 +21,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) language=$(ynh_app_setting_get --app=$app --key=language) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION @@ -120,14 +121,6 @@ ynh_script_progression --message="Upgrading nginx web server configuration..." - # Copy and set nginx configuration ynh_add_nginx_config -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=5 - -# Install dependencies -ynh_install_app_dependencies php-cli - #================================================= # CREATE DEDICATED USER #================================================= @@ -139,10 +132,10 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading php-fpm configuration..." +ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated php-fpm config -ynh_add_fpm_config +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" #================================================= # SPECIFIC SETUP @@ -193,7 +186,7 @@ ynh_script_progression --message="Upgrading agendav..." ( cd $final_path - php agendavcli migrations:migrate --no-interaction + php${phpversion} agendavcli migrations:migrate --no-interaction ) #================================================= @@ -226,7 +219,7 @@ chmod -R 750 ${final_path}/web/config/ #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload