diff --git a/README.md b/README.md index ae921e0..036de97 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,9 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview -[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. +[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 @@ -32,9 +31,8 @@ AJAX interface to allow users to manage their own calendars and shared ones. #### Supported architectures -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/agendav%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/agendav/) +* x86-64 - [![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 @@ -47,14 +45,12 @@ AJAX interface to allow users to manage their own calendars and shared ones. ## Links * Report a bug: https://github.com/YunoHost-Apps/agendav_ynh/issues - * AgenDAV website: http://agendav.org/ * AgenDAV repository: https://github.com/agendav/agendav/ * YunoHost website: https://yunohost.org/ --- -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..791e3b9 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~ynh2", "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..affe443 100644 --- a/scripts/backup +++ b/scripts/backup @@ -14,26 +14,29 @@ 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 #================================================= -ynh_script_progression --message="Backing up the main app directory..." +ynh_script_progression --message="Backing up AgenDAV directory..." # Clean cache files before backup ynh_secure_remove --file=${final_path}/web/var/cache/profiler @@ -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 AgenDAV. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index 14c221d..6ce6d82 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -50,7 +50,7 @@ fi #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating nginx web server configuration..." --weight=2 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -81,7 +81,7 @@ fi #================================================= # 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 @@ -89,4 +89,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --last +ynh_script_progression --message="Change of URL completed for AgenDAV" --last diff --git a/scripts/install b/scripts/install index 0e575ca..e17932c 100644 --- a/scripts/install +++ b/scripts/install @@ -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 #================================================= @@ -53,7 +52,7 @@ then caldav_app=radicale caldav_baseurl=/ else - ynh_die --message="Please install Baikal or Radicale before AgenDAV." + ynh_die --message="Please install Baïkal or Radicale before AgenDAV." fi #================================================= @@ -65,16 +64,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 #================================================= @@ -96,9 +85,9 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --weight=3 +ynh_script_progression --message="Configuring NGINX web server..." --weight=3 -# Copy and set nginx configuration +# Copy and set NGINX configuration ynh_add_nginx_config #================================================= @@ -112,17 +101,18 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================ -ynh_script_progression --message="Configuring php-fpm..." +ynh_script_progression --message="Configuring PHP-FPM.." -# Copy and set php-fpm configuration -ynh_add_fpm_config +# Copy and set PHP-FPM configuration +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC SETUP #================================================= # CREATE SETTINGS.PHP #================================================= -ynh_script_progression --message="Configuring agendav..." --weight=2 +ynh_script_progression --message="Configuring AgenDAV..." --weight=2 # Generate random encryption key encryptkey=$(ynh_string_random --length=24) @@ -160,11 +150,11 @@ ynh_store_file_checksum --file="$conf_path" #================================================= # RUN DATABASE MIGRATIONS (INCLUDES INITIALIZATION) #================================================= -ynh_script_progression --message="Initialising agendav..." --weight=3 +ynh_script_progression --message="Initialising AgenDAV..." --weight=3 ( cd $final_path - php agendavcli migrations:migrate --no-interaction + php${phpversion} agendavcli migrations:migrate --no-interaction ) #================================================= @@ -197,7 +187,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 @@ -205,4 +195,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression --message="Installation of AgenDAV completed" --last diff --git a/scripts/remove b/scripts/remove index 7d6c580..609867a 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 #================================================= @@ -41,7 +31,7 @@ ynh_mysql_remove_db --db_user=$db_name --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=2 +ynh_script_progression --message="Removing AgenDAV main directory..." --weight=2 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -56,15 +46,15 @@ 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 +# Remove the dedicated NGINX config 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 @@ -91,4 +81,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression --message="Removal of AgenDAV completed" --last diff --git a/scripts/restore b/scripts/restore index ab7d41a..7dde0df 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 @@ -49,7 +49,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring AgenDAV main directory..." ynh_restore_file --origin_path="$final_path" @@ -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,13 +110,13 @@ 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 #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression --message="Restoration completed for AgenDAV" --last diff --git a/scripts/upgrade b/scripts/upgrade index 480ce6a..697a723 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 @@ -74,13 +75,13 @@ then caldav_app=radicale caldav_baseurl=/ else - ynh_die --message="Please install Baikal or Radicale before AgenDAV." + ynh_die --message="Please install Baïkal or Radicale before AgenDAV." fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=9 +ynh_script_progression --message="Backing up AgenDAV before upgrading (may take a while)..." --weight=9 # Backup the current version of the app ynh_backup_before_upgrade @@ -115,19 +116,11 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 -# Copy and set nginx 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,17 +132,17 @@ 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 +# Create a dedicated PHP-FPM config +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" #================================================= # SPECIFIC SETUP #================================================= # CREATE SETTINGS.PHP #================================================= -ynh_script_progression --message="Upgrading agendav configuration..." --weight=2 +ynh_script_progression --message="Upgrading AgenDAV configuration..." --weight=2 # Generate random encryption key encryptkey=$(ynh_app_setting_get --app=$app --key=encryptkey) @@ -189,11 +182,11 @@ ynh_store_file_checksum --file="$conf_path" #================================================= # RUN DATABASE MIGRATIONS (INCLUDES INITIALIZATION) #================================================= -ynh_script_progression --message="Upgrading agendav..." +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 @@ -234,4 +227,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression --message="Upgrade of AgenDAV completed" --last