From 64f09e4aaf7f64a0989744a5652426c42bc90b2a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 21 Oct 2020 10:23:14 +0200 Subject: [PATCH 01/19] Upgrade to PHP7.3 --- README.md | 6 ++---- conf/nginx.conf | 2 +- conf/php-fpm.conf | 2 +- manifest.json | 8 ++++---- scripts/_common.sh | 21 +++++++++++++++++++++ scripts/backup | 20 +++++++++----------- scripts/install | 15 +++------------ scripts/remove | 14 ++------------ scripts/restore | 11 +++++++---- scripts/upgrade | 17 +++++------------ 10 files changed, 55 insertions(+), 61 deletions(-) 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 From 2eba93a71e3c9064e7fee3abfbb271e0785865d8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 21 Oct 2020 10:27:39 +0200 Subject: [PATCH 02/19] Small fixes --- scripts/backup | 4 ++-- scripts/change_url | 6 +++--- scripts/install | 19 +++++++++---------- scripts/remove | 6 +++--- scripts/restore | 4 ++-- scripts/upgrade | 16 ++++++++-------- 6 files changed, 27 insertions(+), 28 deletions(-) diff --git a/scripts/backup b/scripts/backup index a5d29d0..affe443 100644 --- a/scripts/backup +++ b/scripts/backup @@ -36,7 +36,7 @@ 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 @@ -75,4 +75,4 @@ ynh_backup --src_path="/etc/logrotate.d/$app" # 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 --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 dcbfb4b..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 #================================================= @@ -86,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 #================================================= @@ -102,9 +101,9 @@ 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 +# 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) @@ -113,7 +112,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # 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) @@ -151,7 +150,7 @@ 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 @@ -188,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 @@ -196,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 622d4f0..609867a 100644 --- a/scripts/remove +++ b/scripts/remove @@ -31,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" @@ -48,7 +48,7 @@ ynh_secure_remove --file="/var/log/$app" #================================================= ynh_script_progression --message="Removing NGINX web server configuration..." -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= @@ -81,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 62406eb..7dde0df 100644 --- a/scripts/restore +++ b/scripts/restore @@ -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" @@ -119,4 +119,4 @@ 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 9adcbb7..697a723 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -75,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 @@ -116,9 +116,9 @@ 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 #================================================= @@ -134,7 +134,7 @@ ynh_system_user_create --username=$app #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." -# Create a dedicated php-fpm config +# Create a dedicated PHP-FPM config ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" #================================================= @@ -142,7 +142,7 @@ ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependenc #================================================= # 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) @@ -182,7 +182,7 @@ 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 @@ -227,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 From dbf2ebc894c095ecdf6607a60c563a41330ca598 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 21 Oct 2020 10:34:26 +0200 Subject: [PATCH 03/19] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index f5cc5e1..374e46c 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,7 @@ 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.2.0 @@ -46,7 +45,6 @@ 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/ From ca1c8cdd755888aae547294880f0547b61ed24ee Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 21 Oct 2020 11:08:01 +0200 Subject: [PATCH 04/19] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 82564ae..791e3b9 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,7 @@ }, "url": "http://agendav.org/", "license": "GPL-3.0", - "version": "2.2.0~ynh1", + "version": "2.2.0~ynh2", "maintainer": { "name": "julien", "email": "julien.malik@paraiso.me" From edfc9a3851b9db9d8e33afbc6623da69c2d5d1e9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 21 Oct 2020 11:12:11 +0200 Subject: [PATCH 05/19] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 374e46c..036de97 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to #### 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/) ## Limitations From 785b8d261f1d9ec7201346d15e690c020abdb65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 21 Jan 2021 19:13:25 +0100 Subject: [PATCH 06/19] Fix linter warnings (#48) --- README.md | 2 +- check_process | 3 --- scripts/backup | 2 +- scripts/upgrade | 7 ------- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 036de97..10d67c6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # AgenDAV for YunoHost [![Integration level](https://dash.yunohost.org/integration/agendav.svg)](https://dash.yunohost.org/appci/app/agendav) ![](https://ci-apps.yunohost.org/ci/badges/agendav.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/agendav.maintain.svg) -[![Install AgenDAV with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=agendav) +[![Install AgenDAV with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=agendav) > *This package allow you to install AgenDAV quickly and simply on a YunoHost server. If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* diff --git a/check_process b/check_process index 59d8db0..4867cbf 100644 --- a/check_process +++ b/check_process @@ -19,11 +19,8 @@ upgrade=1 from_commit=1783f57896e46ed8b117f2748340c02d37b2a014 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/scripts/backup b/scripts/backup index affe443..323928f 100644 --- a/scripts/backup +++ b/scripts/backup @@ -36,7 +36,7 @@ ynh_print_info --message="Declaring files to be backed up..." #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_script_progression --message="Backing up AgenDAV directory..." +ynh_print_info --message="Backing up AgenDAV directory..." # Clean cache files before backup ynh_secure_remove --file=${final_path}/web/var/cache/profiler diff --git a/scripts/upgrade b/scripts/upgrade index 697a723..dfe1405 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -92,13 +92,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -path_url=$(ynh_normalize_url_path --path_url=$path_url) - #================================================= # STANDARD UPGRADE STEPS #================================================= From fe56b96156e48bb67eee40f19d7c0fecb243e5b9 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 19 Feb 2021 00:04:55 +0100 Subject: [PATCH 07/19] Force baikal install during test --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index a4d6c8d..7603e15 100644 --- a/check_process +++ b/check_process @@ -7,7 +7,7 @@ ; pre-install sudo yunohost tools update --apps sudo yunohost domain add baikaldomain.tld - sudo yunohost app install baikal -a "domain=baikaldomain.tld&path=/baikal&password=admin" + sudo yunohost app install baikal --force -a "domain=baikaldomain.tld&path=/baikal&password=admin" ; Checks pkg_linter=1 setup_sub_dir=1 From 17a68ba01ed2f9d1f991c6d644186e9695b63239 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 19 Feb 2021 09:49:03 +0100 Subject: [PATCH 08/19] Update check_process --- check_process | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index 7603e15..dd81cd2 100644 --- a/check_process +++ b/check_process @@ -16,7 +16,7 @@ setup_private=1 setup_public=0 upgrade=1 - upgrade=1 from_commit=1783f57896e46ed8b117f2748340c02d37b2a014 + upgrade=1 from_commit=b1ce4c7ee4fd47a0d832eb18cfca8d6ba926ca16 backup_restore=1 multi_instance=0 port_already_use=0 @@ -25,6 +25,6 @@ Email= Notification=none ;;; Upgrade options - ; commit=1783f57896e46ed8b117f2748340c02d37b2a014 - name= Fix installation on root - Sep 10, 2018 + ; commit=b1ce4c7ee4fd47a0d832eb18cfca8d6ba926ca16 + name= Merge pull request #45 from YunoHost-Apps/testing-Buster support. Apr 28, 2020 manifest_arg=domain=DOMAIN&path=PATH&language=en& From e7f8874e815e72bdb74d1ce2fc9049a991f4d66d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 19 Feb 2021 09:52:39 +0100 Subject: [PATCH 09/19] Cleaning up --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index e17932c..f7b27a8 100644 --- a/scripts/install +++ b/scripts/install @@ -104,7 +104,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Configuring PHP-FPM.." # Copy and set PHP-FPM configuration -ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" +ynh_add_fpm_config --package="$extra_php_dependencies" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/restore b/scripts/restore index 7dde0df..d554f25 100644 --- a/scripts/restore +++ b/scripts/restore @@ -82,7 +82,7 @@ ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=6 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" +ynh_add_fpm_config --package="$extra_php_dependencies" #================================================= # SPECIFIC RESTORATION diff --git a/scripts/upgrade b/scripts/upgrade index dfe1405..3053783 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -128,7 +128,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" +ynh_add_fpm_config --package="$extra_php_dependencies" #================================================= # SPECIFIC SETUP From b91d5a0e2d73f26054893219321aca516dbe83f7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 19 Feb 2021 19:25:28 +0100 Subject: [PATCH 10/19] Update check_process --- check_process | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index dd81cd2..bb25a96 100644 --- a/check_process +++ b/check_process @@ -16,7 +16,7 @@ setup_private=1 setup_public=0 upgrade=1 - upgrade=1 from_commit=b1ce4c7ee4fd47a0d832eb18cfca8d6ba926ca16 + upgrade=1 from_commit=6fb29ddc7e32549b5587405e520d46a717e5582e backup_restore=1 multi_instance=0 port_already_use=0 @@ -25,6 +25,6 @@ Email= Notification=none ;;; Upgrade options - ; commit=b1ce4c7ee4fd47a0d832eb18cfca8d6ba926ca16 - name= Merge pull request #45 from YunoHost-Apps/testing-Buster support. Apr 28, 2020 + ; commit=6fb29ddc7e32549b5587405e520d46a717e5582e + name= --admin-password ain't needed since like 2 years or so manifest_arg=domain=DOMAIN&path=PATH&language=en& From 886fffdbb301407c2861fef92a43407fdf61c197 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 17 Apr 2021 16:06:58 +0200 Subject: [PATCH 11/19] Fix badges --- README.md | 4 ++-- pull_request_template.md | 12 ++---------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 10d67c6..4b3fe04 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to #### Supported architectures -* 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/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/agendav.svg)](https://ci-apps.yunohost.org/ci/apps/agendav/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/agendav.svg)](https://ci-apps-arm.yunohost.org/ci/apps/agendav/) ## Limitations diff --git a/pull_request_template.md b/pull_request_template.md index b7ba501..0a198cf 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -11,14 +11,6 @@ - [ ] Upgrade from last version tested. - [ ] Can be reviewed and tested. -## Validation +## Package_check results --- -*Minor decision* -- **Upgrade previous version** : -- [ ] **Code review** : -- [ ] **Approval (LGTM)** : -- [ ] **Approval (LGTM)** : -- **CI succeeded** : -[![Build Status](https://ci-apps-hq.yunohost.org/jenkins/job/agendav_ynh%20PR-NUM-/badge/icon)](https://ci-apps-hq.yunohost.org/jenkins/job/agendav_ynh%20PR-NUM-/) -*Please replace '-NUM-' in this link by the PR number.* -When the PR is marked as ready to merge, you have to wait for 3 days before really merging it. +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* From 955b380efd322836f4b6dbc1084df08eb56917ba Mon Sep 17 00:00:00 2001 From: YunoHost Bot Date: Fri, 4 Jun 2021 16:38:29 +0200 Subject: [PATCH 12/19] [autopatch] Update issue and PR templates (#51) Co-authored-by: Yunohost-Bot <> --- .github/ISSUE_TEMPLATE.md | 55 ++++++++++++++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 16 ++++++++++ pull_request_template.md | 16 ---------- 3 files changed, 71 insertions(+), 16 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 pull_request_template.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..2729a6b --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,55 @@ +--- +name: Bug report +about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently. + +--- + +**How to post a meaningful bug report** +1. *Read this whole template first.* +2. *Determine if you are on the right place:* + - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* + - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* + - *When in doubt, post here and we will figure it out together.* +3. *Delete the italic comments as you write over them below, and remove this guide.* +--- + +### Describe the bug + +*A clear and concise description of what the bug is.* + +### Context + +- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* +- YunoHost version: x.x.x +- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* +- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* + - If yes, please explain: +- Using, or trying to install package version/branch: +- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* + +### Steps to reproduce + +- *If you performed a command from the CLI, the command itself is enough. For example:* + ```sh + sudo yunohost app install the_app + ``` +- *If you used the webadmin, please perform the equivalent command from the CLI first.* +- *If the error occurs in your browser, explain what you did:* + 1. *Go to '...'* + 2. *Click on '...'* + 3. *Scroll down to '...'* + 4. *See error* + +### Expected behavior + +*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.* + +### Logs + +*When an operation fails, YunoHost provides a simple way to share the logs.* +- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* +- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* + +*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)* + +*If applicable and useful, add screenshots to help explain your problem.* diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ef70e18 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Problem + +- *Description of why you made this PR* + +## Solution + +- *And how do you fix that problem* + +## PR Status + +- [ ] Code finished and ready to be reviewed/tested +- [ ] The fix/enhancement were manually tested (if applicable) + +## Automatic tests + +Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization) diff --git a/pull_request_template.md b/pull_request_template.md deleted file mode 100644 index 0a198cf..0000000 --- a/pull_request_template.md +++ /dev/null @@ -1,16 +0,0 @@ -## Problem -- *Description of why you made this PR* - -## Solution -- *And how you fix that* - -## PR Status -- [ ] Code finished. -- [ ] Tested with Package_check. -- [ ] Fix or enhancement tested. -- [ ] Upgrade from last version tested. -- [ ] Can be reviewed and tested. - -## Package_check results ---- -* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* From 4cb48c064a5f9ea314e97a649cb292cae6693ba8 Mon Sep 17 00:00:00 2001 From: Jaxom99 <30865395+Jaxom99@users.noreply.github.com> Date: Mon, 11 Oct 2021 11:34:08 +0200 Subject: [PATCH 13/19] Update README.md Location of upstream documentation has changed. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b3fe04..b529ed2 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Documentation - * Official documentation: http://docs.agendav.org/en/2.2.0/ + * Official documentation: https://agendav.readthedocs.io/en/2.2.0/ * YunoHost documentation: If specific documentation is needed, feel free to contribute. ## YunoHost specific features From 024658e25090aaee729bda3fa71cb9475f0afff1 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 29 Jul 2022 02:51:48 +0200 Subject: [PATCH 14/19] Apply example_ynh --- .github/workflows/updater.sh | 132 ++++++++++++++++++++++++++++++++++ .github/workflows/updater.yml | 49 +++++++++++++ check_process | 4 +- conf/app.src | 1 + conf/nginx.conf | 45 ++++++------ conf/php-fpm.conf | 32 +++++---- doc/.gitkeep | 0 doc/DESCRIPTION.md | 1 + doc/DISCLAIMER.md | 0 doc/screenshots/.gitkeep | 0 manifest.json | 41 ++++++----- scripts/_common.sh | 4 +- scripts/backup | 18 ++--- scripts/change_url | 12 ++-- scripts/install | 84 ++++++++++++---------- scripts/remove | 41 +++++++---- scripts/restore | 66 +++++++++-------- scripts/upgrade | 118 ++++++++++++++---------------- 18 files changed, 426 insertions(+), 222 deletions(-) create mode 100644 .github/workflows/updater.sh create mode 100644 .github/workflows/updater.yml create mode 100644 doc/.gitkeep create mode 100644 doc/DESCRIPTION.md create mode 100644 doc/DISCLAIMER.md create mode 100644 doc/screenshots/.gitkeep diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh new file mode 100644 index 0000000..eb8e5e2 --- /dev/null +++ b/.github/workflows/updater.sh @@ -0,0 +1,132 @@ +#!/bin/bash + +#================================================= +# PACKAGE UPDATING HELPER +#================================================= + +# This script is meant to be run by GitHub Actions +# The YunoHost-Apps organisation offers a template Action to run this script periodically +# Since each app is different, maintainers can adapt its contents so as to perform +# automatic actions when a new upstream release is detected. + +#================================================= +# FETCHING LATEST RELEASE AND ITS ASSETS +#================================================= + +# Fetching information +current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') +repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') +# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) +version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) +assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'")) + +# Later down the script, we assume the version has only digits and dots +# Sometimes the release name starts with a "v", so let's filter it out. +# You may need more tweaks here if the upstream repository has different naming conventions. +if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then + version=${version:1} +fi + +# Setting up the environment variables +echo "Current version: $current_version" +echo "Latest release from upstream: $version" +echo "VERSION=$version" >> $GITHUB_ENV +echo "REPO=$repo" >> $GITHUB_ENV +# For the time being, let's assume the script will fail +echo "PROCEED=false" >> $GITHUB_ENV + +# Proceed only if the retrieved version is greater than the current one +if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then + echo "::warning ::No new version available" + exit 0 +# Proceed only if a PR for this new version does not already exist +elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then + echo "::warning ::A branch already exists for this update" + exit 0 +fi + +# Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.) +echo "${#assets[@]} available asset(s)" + +#================================================= +# UPDATE SOURCE FILES +#================================================= + +# Here we use the $assets variable to get the resources published in the upstream release. +# Here is an example for Grav, it has to be adapted in accordance with how the upstream releases look like. + +# Let's loop over the array of assets URLs +for asset_url in ${assets[@]}; do + + echo "Handling asset at $asset_url" + + # Assign the asset to a source file in conf/ directory + # Here we base the source file name upon a unique keyword in the assets url (admin vs. update) + # Leave $src empty to ignore the asset + case $asset_url in + *"agendav"*) + src="app" + ;; + *) + src="" + ;; + esac + + # If $src is not empty, let's process the asset + if [ ! -z "$src" ]; then + + # Create the temporary directory + tempdir="$(mktemp -d)" + + # Download sources and calculate checksum + filename=${asset_url##*/} + curl --silent -4 -L $asset_url -o "$tempdir/$filename" + checksum=$(sha256sum "$tempdir/$filename" | head -c 64) + + # Delete temporary directory + rm -rf $tempdir + + # Get extension + if [[ $filename == *.tar.gz ]]; then + extension=tar.gz + else + extension=${filename##*.} + fi + + # Rewrite source file + cat < conf/$src.src +SOURCE_URL=$asset_url +SOURCE_SUM=$checksum +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=$extension +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= +SOURCE_EXTRACT=true +EOT + echo "... conf/$src.src updated" + + else + echo "... asset ignored" + fi + +done + +#================================================= +# SPECIFIC UPDATE STEPS +#================================================= + +# Any action on the app's source code can be done. +# The GitHub Action workflow takes care of committing all changes after this script ends. + +#================================================= +# GENERIC FINALIZATION +#================================================= + +# Replace new version in manifest +echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json + +# No need to update the README, yunohost-bot takes care of it + +# The Action will proceed only if the PROCEED environment variable is set to true +echo "PROCEED=true" >> $GITHUB_ENV +exit 0 diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml new file mode 100644 index 0000000..fb72ba0 --- /dev/null +++ b/.github/workflows/updater.yml @@ -0,0 +1,49 @@ +# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. +# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. +# This file should be enough by itself, but feel free to tune it to your needs. +# It calls updater.sh, which is where you should put the app-specific update steps. +name: Check for new upstream releases +on: + # Allow to manually trigger the workflow + workflow_dispatch: + # Run it every day at 6:00 UTC + schedule: + - cron: '0 6 * * *' +jobs: + updater: + runs-on: ubuntu-latest + steps: + - name: Fetch the source code + uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run the updater script + id: run_updater + run: | + # Setting up Git user + git config --global user.name 'yunohost-bot' + git config --global user.email 'yunohost-bot@users.noreply.github.com' + # Run the updater script + /bin/bash .github/workflows/updater.sh + - name: Commit changes + id: commit + if: ${{ env.PROCEED == 'true' }} + run: | + git commit -am "Upgrade to v$VERSION" + - name: Create Pull Request + id: cpr + if: ${{ env.PROCEED == 'true' }} + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Update to version ${{ env.VERSION }} + committer: 'yunohost-bot ' + author: 'yunohost-bot ' + signoff: false + base: testing + branch: ci-auto-update-v${{ env.VERSION }} + delete-branch: true + title: 'Upgrade to version ${{ env.VERSION }}' + body: | + Upgrade to v${{ env.VERSION }} + draft: false diff --git a/check_process b/check_process index bb25a96..1491d01 100644 --- a/check_process +++ b/check_process @@ -1,8 +1,8 @@ ;; Test complet auto_remove=1 ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) + domain="domain.tld" + path="/path" language="en" ; pre-install sudo yunohost tools update --apps diff --git a/conf/app.src b/conf/app.src index 8db6750..7cde575 100644 --- a/conf/app.src +++ b/conf/app.src @@ -4,3 +4,4 @@ SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true SOURCE_FILENAME= +SOURCE_EXTRACT=true diff --git a/conf/nginx.conf b/conf/nginx.conf index b053a41..48f57e1 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,35 +1,30 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - # Path to source - alias __FINALPATH__/web/public/ ; + # Path to source + alias __FINALPATH__/web/public/; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } + index index.php; - index index.php; + # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file + #client_max_body_size 50M; - # The seemingly weird syntax is due to a long-standing bug in nginx, - # see: https://trac.nginx.org/nginx/ticket/97 - try_files $uri __PATH__/__PATH__/index.php$is_args$args; + try_files $uri __PATH__/__PATH__/index.php$is_args$args; + location ~ ^__PATH__/index\.php(/|$) { + fastcgi_split_path_info ^(.+?\.php)(/.*)$; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; - location ~ ^__PATH__/index\.php(/|$) { - fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param REMOTE_USER $remote_user; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param SCRIPT_FILENAME $request_filename; + } - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param REMOTE_USER $remote_user; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param SCRIPT_FILENAME $request_filename; - } + location ~ \.php$ { + return 404; + } - location ~ \.php$ { - return 404; - } - - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; } diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index ad5b935..cc8c244 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -27,15 +27,13 @@ group = __USER__ ; Valid syntaxes are: ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on ; a specific port; -; 'port' - to listen on a TCP socket to all addresses on a -; specific port; ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on ; a specific port; ; 'port' - to listen on a TCP socket to all addresses ; (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/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock +listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock ; Set listen(2) backlog. ; Default Value: 511 (-1 on FreeBSD and OpenBSD) @@ -49,7 +47,6 @@ group = __USER__ listen.owner = www-data listen.group = www-data ;listen.mode = 0660 - ; When POSIX Access Control Lists are supported you can set them using ; these options, value is a comma separated list of user/group names. ; When set, listen.owner and listen.group are ignored @@ -139,7 +136,7 @@ pm.max_spare_servers = 5 ; This can be useful to work around memory leaks in 3rd party libraries. For ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. ; Default Value: 0 -; pm.max_requests = 500 +;pm.max_requests = 500 ; The URI to view the FPM status page. If this value is not set, no URI will be ; recognized as a status page. It shows the following informations: @@ -237,9 +234,9 @@ pm.max_spare_servers = 5 ; Note: The value must start with a leading slash (/). The value can be ; anything, but it may not be a good idea to use the .php extension or it ; may conflict with a real PHP file. -; Default Value: not set +; Default Value: not set ;pm.status_path = /status - + ; The ping URI to call the monitoring page of FPM. If this value is not set, no ; URI will be recognized as a ping page. This could be used to test from outside ; that FPM is alive and responding, or to @@ -318,12 +315,12 @@ pm.max_spare_servers = 5 ; %u: remote user ; ; Default: "%R - %u %t \"%m %r\" %s" -; access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" +;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" ; The log file for slow requests ; Default Value: not set ; Note: slowlog is mandatory if request_slowlog_timeout is set -; slowlog = log/$pool.log.slow +;slowlog = log/$pool.log.slow ; The timeout for serving a single request after which a PHP backtrace will be ; dumped to the 'slowlog' file. A value of '0s' means 'off'. @@ -356,13 +353,13 @@ request_terminate_timeout = 1d ; possible. However, all PHP paths will be relative to the chroot ; (error_log, sessions.save_path, ...). ; Default Value: not set -;chroot = - +;chroot = + ; Chdir to this directory at the start. ; Note: relative path can be used. ; Default Value: current directory or / when chroot chdir = __FINALPATH__ - + ; Redirect worker stdout and stderr into main error log. If not set, stdout and ; stderr will be redirected to /dev/null according to FastCGI specs. ; Note: on highloaded environement, this can cause some delay in the page @@ -420,3 +417,14 @@ chdir = __FINALPATH__ ;php_admin_value[error_log] = /var/log/fpm-php.www.log ;php_admin_flag[log_errors] = on ;php_admin_value[memory_limit] = 32M + +; Common values to change to increase file upload limit +; php_admin_value[upload_max_filesize] = 50M +; php_admin_value[post_max_size] = 50M +; php_admin_flag[mail.add_x_header] = Off + +; Other common parameters +; php_admin_value[max_execution_time] = 600 +; php_admin_value[max_input_time] = 300 +; php_admin_value[memory_limit] = 256M +; php_admin_flag[short_open_tag] = On diff --git a/doc/.gitkeep b/doc/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..61f4a24 --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1 @@ +[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. diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..e69de29 diff --git a/doc/screenshots/.gitkeep b/doc/screenshots/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/manifest.json b/manifest.json index 791e3b9..ceccb79 100644 --- a/manifest.json +++ b/manifest.json @@ -6,40 +6,38 @@ "en": "CalDAV web client", "fr": "Client web pour CalDAV" }, - "url": "http://agendav.org/", + "version": "2.2.0~ynh3", + "url": "http://agendav.org", + "upstream": { + "license": "GPL-3.0", + "website": "http://agendav.org", + "demo": "https://demo.yunohost.org/agendav/", + "admindoc": "http://docs.agendav.org", + "code": "https://github.com/agendav/agendav" + }, "license": "GPL-3.0", - "version": "2.2.0~ynh2", "maintainer": { "name": "julien", "email": "julien.malik@paraiso.me" }, - "multi_instance": false, "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.3.0" }, + "multi_instance": false, "services": [ "nginx", - "php7.0-fpm", + "php7.3-fpm", "mysql" ], "arguments": { - "install" : [ + "install": [ { "name": "domain", - "type": "domain", - "ask": { - "en": "Choose a domain for AgenDAV", - "fr": "Choisissez un domaine pour AgenDAV" - }, - "example": "domain.org" + "type": "domain" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for AgenDAV", - "fr": "Choisissez un chemin pour AgenDAV" - }, "example": "/agendav", "default": "/agendav" }, @@ -47,11 +45,16 @@ "name": "language", "type": "string", "ask": { - "en": "Default language to be used in AgenDAV", - "fr": "Langue par défaut à utiliser dans AgenDAV" + "en": "Choose the application language", + "fr": "Choisissez la langue de l'application" }, "choices": [ - "de_DE", "en", "es_ES", "fr_FR", "it_IT", "nl_NL" + "de_DE", + "en", + "es_ES", + "fr_FR", + "it_IT", + "nl_NL" ], "default": "en" } diff --git a/scripts/_common.sh b/scripts/_common.sh index 399627f..23c6a7b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,8 @@ YNH_PHP_VERSION="7.3" -extra_php_dependencies="php${YNH_PHP_VERSION}-cli" +# dependencies used by the app +pkg_dependencies="php${YNH_PHP_VERSION}-cli" #================================================= # PERSONAL HELPERS @@ -19,4 +20,3 @@ extra_php_dependencies="php${YNH_PHP_VERSION}-cli" #================================================= # FUTURE OFFICIAL HELPERS #================================================= - diff --git a/scripts/backup b/scripts/backup index 323928f..31711d4 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,12 +1,12 @@ #!/bin/bash - #================================================= # GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= +# 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 @@ -14,6 +14,7 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= @@ -36,7 +37,6 @@ ynh_print_info --message="Declaring files to be backed up..." #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_print_info --message="Backing up AgenDAV directory..." # Clean cache files before backup ynh_secure_remove --file=${final_path}/web/var/cache/profiler @@ -58,6 +58,12 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +#================================================= +# BACKUP LOGROTATE +#================================================= + +ynh_backup --src_path="/etc/logrotate.d/$app" + #================================================= # BACKUP THE MYSQL DATABASE #================================================= @@ -65,14 +71,8 @@ ynh_print_info --message="Backing up the MySQL database..." ynh_mysql_dump_db --database="$db_name" > db.sql -#================================================= -# BACKUP LOGROTATE -#================================================= - -ynh_backup --src_path="/etc/logrotate.d/$app" - #================================================= # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for AgenDAV. (YunoHost will then actually copy those files to the archive)." +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index 6ce6d82..58c7fa5 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -54,19 +54,19 @@ ynh_script_progression --message="Updating NGINX web server configuration..." -- nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf -# Change the path in the nginx config file +# Change the path in the NGINX config file if [ $change_path -eq 1 ] then - # Make a backup of the original nginx config file if modified + # Make a backup of the original NGINX config file if modified ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for nginx helper + # Set global variables for NGINX helper domain="$old_domain" path_url="$new_path" - # Create a dedicated nginx config + # Create a dedicated NGINX config ynh_add_nginx_config fi -# Change the domain for nginx +# Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location @@ -89,4 +89,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for AgenDAV" --last +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index f7b27a8..906724e 100644 --- a/scripts/install +++ b/scripts/install @@ -13,6 +13,7 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= @@ -36,6 +37,10 @@ test ! -e "$final_path" || ynh_die --message="This path already contains a folde # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +#================================================= +# GET THE CALDAV APP +#================================================= + agendav_app_check_installation() { echo $(yunohost app list | grep "id: $1") } @@ -64,14 +69,30 @@ 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 +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." + +ynh_install_app_dependencies $pkg_dependencies + +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=2 + +# Create a system user +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # CREATE A MYSQL DATABASE #================================================= ynh_script_progression --message="Creating a MySQL database..." db_name=$(ynh_sanitize_dbid --db_name=$app) +db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name +ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -82,37 +103,28 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" +#================================================= +# PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring PHP-FPM..." + +# Create a dedicated PHP-FPM config +ynh_add_fpm_config + #================================================= # NGINX CONFIGURATION #================================================= ynh_script_progression --message="Configuring NGINX web server..." --weight=3 -# Copy and set NGINX configuration +# Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=2 - -# Create a system user -ynh_system_user_create --username=$app - -#================================================= -# PHP-FPM CONFIGURATION -#================================================ -ynh_script_progression --message="Configuring PHP-FPM.." - -# Copy and set PHP-FPM configuration -ynh_add_fpm_config --package="$extra_php_dependencies" -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) - #================================================= # SPECIFIC SETUP #================================================= -# CREATE SETTINGS.PHP +# ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Configuring AgenDAV..." --weight=2 +ynh_script_progression --message="Adding a configuration file..." --weight=2 # Generate random encryption key encryptkey=$(ynh_string_random --length=24) @@ -141,10 +153,6 @@ ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" ynh_replace_string --match_string="__CALDAV_BASEURL__" --replace_string="${caldav_url}${caldav_baseurl}" --target_file="$conf_path" ynh_replace_string --match_string="__CALDAV_DOMAIN__" --replace_string="$caldav_domain" --target_file="$conf_path" -#================================================= -# STORE THE CHECKSUM OF THE CONFIG FILE -#================================================= - ynh_store_file_checksum --file="$conf_path" #================================================= @@ -157,19 +165,6 @@ ynh_script_progression --message="Initialising AgenDAV..." --weight=3 php${phpversion} agendavcli migrations:migrate --no-interaction ) -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." - -mkdir -p $logdir -chown -R $app: $logdir - -# Use logrotate to manage application logfile(s) -ynh_use_logrotate - -#================================================= -# GENERIC FINALIZATION #================================================= # SECURE FILES AND DIRECTORIES #================================================= @@ -184,6 +179,19 @@ chown -R $app ${final_path}/web/var/cache/{profiler,twig} chown -R root:$app ${final_path}/web/config/ chmod -R 750 ${final_path}/web/config/ +#================================================= +# GENERIC FINALIZATION +#================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Configuring log rotation..." + +mkdir -p $logdir +chown -R $app: $logdir + +# Use logrotate to manage application logfile(s) +ynh_use_logrotate + #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/remove b/scripts/remove index 609867a..4d9af1e 100644 --- a/scripts/remove +++ b/scripts/remove @@ -18,31 +18,33 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#================================================= +# REMOVE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Removing logrotate configuration..." + +# Remove the app-specific logrotate config +ynh_remove_logrotate + #================================================= # REMOVE THE MYSQL DATABASE #================================================= ynh_script_progression --message="Removing the MySQL database..." # Remove a database if it exists, along with the associated user -ynh_mysql_remove_db --db_user=$db_name --db_name=$db_name +ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing AgenDAV main directory..." --weight=2 +ynh_script_progression --message="Removing app main directory..." --weight=2 # Remove the app directory securely ynh_secure_remove --file="$final_path" -#================================================= -# REMOVE LOG -#================================================= -ynh_script_progression --message="Removing logs..." - -ynh_secure_remove --file="/var/log/$app" - #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -56,16 +58,25 @@ ynh_remove_nginx_config #================================================= ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=2 -# Remove the dedicated php-fpm config +# Remove the dedicated PHP-FPM config ynh_remove_fpm_config #================================================= -# REMOVE LOGROTATE CONFIGURATION +# REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing logrotate configuration..." +ynh_script_progression --message="Removing dependencies..." -# Remove the app-specific logrotate config -ynh_remove_logrotate +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + +#================================================= +# SPECIFIC REMOVE +#================================================= +# REMOVE VARIOUS FILES +#================================================= +ynh_script_progression --message="Removing various files..." + +ynh_secure_remove --file="/var/log/$app" #================================================= # GENERIC FINALIZATION @@ -81,4 +92,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of AgenDAV completed" --last +ynh_script_progression --message="Removal of $app completed" --last diff --git a/scripts/restore b/scripts/restore index d554f25..4106230 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,6 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= +# 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,12 +14,13 @@ 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 settings..." --weight=2 +ynh_script_progression --message="Loading installation settings..." --weight=2 app=$YNH_APP_INSTANCE_NAME @@ -26,6 +28,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) +db_user=$db_name phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= @@ -33,37 +36,29 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Validating restoration parameters..." -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - -#================================================= -# RESTORE THE APP MAIN DIR -#================================================= -ynh_script_progression --message="Restoring AgenDAV main directory..." - -ynh_restore_file --origin_path="$final_path" - #================================================= # RECREATE THE DEDICATED USER #================================================= ynh_script_progression --message="Recreating the dedicated system user..." --weight=2 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= -# RESTORE USER RIGHTS +# RESTORE THE APP MAIN DIR #================================================= +ynh_script_progression --message="Restoring the app main directory..." + +ynh_restore_file --origin_path="$final_path" + +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" chown -R root: $final_path @@ -75,33 +70,46 @@ chown -R $app ${final_path}/web/var/cache/{profiler,twig} chown -R root:$app ${final_path}/web/config/ chmod -R 750 ${final_path}/web/config/ +#================================================= +# SPECIFIC RESTORATION +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=6 +ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=6 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -ynh_add_fpm_config --package="$extra_php_dependencies" - #================================================= -# SPECIFIC RESTORATION +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + #================================================= # RESTORE THE MYSQL DATABASE #================================================= ynh_script_progression --message="Restoring the MySQL database..." --weight=2 db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd -ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./db.sql +ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd +ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= # RESTORE THE LOGROTATE CONFIGURATION #================================================= +ynh_script_progression --message="Restoring the logrotate configuration..." -logdir=/var/log/$app -mkdir -p $logdir -chown -R $app: $logdir +mkdir -p /var/log/$app +chown -R $app: /var/log/$app ynh_restore_file --origin_path="/etc/logrotate.d/$app" @@ -112,11 +120,11 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=2 -ynh_systemd_action --service_name=php${phpversion}-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 AgenDAV" --last +ynh_script_progression --message="Restoration completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade index 3053783..8a8aa2e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,31 +18,39 @@ app=$YNH_APP_INSTANCE_NAME 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) language=$(ynh_app_setting_get --app=$app --key=language) +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 VERSION #================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=9 + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # Restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + +#================================================= +# STANDARD UPGRADE STEPS #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= ynh_script_progression --message="Ensuring downward compatibility..." -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi - # If db_name doesn't exist, create it if [ -z "$db_name" ]; then db_name=$(ynh_sanitize_dbid --db_name=$app) @@ -55,6 +63,14 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # GET THE CALDAV APP #================================================= @@ -78,64 +94,40 @@ else ynh_die --message="Please install Baïkal or Radicale before AgenDAV." fi -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -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 -ynh_clean_setup () { - # restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# STANDARD UPGRADE STEPS #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Upgrading source files..."0 + ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" fi -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 - -# Copy and set NGINX configuration -ynh_add_nginx_config - -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app - #================================================= # PHP-FPM CONFIGURATION #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config #================================================= -# SPECIFIC SETUP +# NGINX CONFIGURATION #================================================= -# CREATE SETTINGS.PHP +ynh_script_progression --message="Upgrading NGINX web server configuration..." + +# Create a dedicated NGINX config +ynh_add_nginx_config + #================================================= -ynh_script_progression --message="Upgrading AgenDAV configuration..." --weight=2 +# SPECIFIC UPGRADE +#================================================= +# UPDATE A CONFIG FILE +#================================================= +ynh_script_progression --message="Updating a configuration file..." --weight=2 # Generate random encryption key encryptkey=$(ynh_app_setting_get --app=$app --key=encryptkey) @@ -166,10 +158,6 @@ ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" ynh_replace_string --match_string="__CALDAV_BASEURL__" --replace_string="${caldav_url}${caldav_baseurl}" --target_file="$conf_path" ynh_replace_string --match_string="__CALDAV_DOMAIN__" --replace_string="$caldav_domain" --target_file="$conf_path" -#================================================= -# STORE THE CHECKSUM OF THE CONFIG FILE -#================================================= - ynh_store_file_checksum --file="$conf_path" #================================================= @@ -182,19 +170,6 @@ ynh_script_progression --message="Upgrading AgenDAV..." php${phpversion} agendavcli migrations:migrate --no-interaction ) -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." --weight=2 - -mkdir -p $logdir -chown -R $app: $logdir - -# Use logrotate to manage application logfile(s) -ynh_use_logrotate --non-append - -#================================================= -# GENERIC FINALIZATION #================================================= # SECURE FILES AND DIRECTORIES #================================================= @@ -209,6 +184,19 @@ chown -R $app ${final_path}/web/var/cache/{profiler,twig} chown -R root:$app ${final_path}/web/config/ chmod -R 750 ${final_path}/web/config/ +#================================================= +# GENERIC FINALIZATION +#================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Upgrading logrotate configuration..." --weight=2 + +mkdir -p $logdir +chown -R $app: $logdir + +# Use logrotate to manage application logfile(s) +ynh_use_logrotate --non-append + #================================================= # RELOAD NGINX #================================================= @@ -220,4 +208,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of AgenDAV completed" --last +ynh_script_progression --message="Upgrade of $app completed" --last From 7a3a664e33c9f64b27c8bcc778e1bc0bf3c23fb3 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 29 Jul 2022 00:51:52 +0000 Subject: [PATCH 15/19] Auto-update README --- README.md | 66 +++++++++++++++++++--------------------------------- README_fr.md | 44 +++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 42 deletions(-) create mode 100644 README_fr.md diff --git a/README.md b/README.md index b529ed2..17a9b3a 100644 --- a/README.md +++ b/README.md @@ -1,62 +1,44 @@ + + # AgenDAV for YunoHost -[![Integration level](https://dash.yunohost.org/integration/agendav.svg)](https://dash.yunohost.org/appci/app/agendav) ![](https://ci-apps.yunohost.org/ci/badges/agendav.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/agendav.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/agendav.svg)](https://dash.yunohost.org/appci/app/agendav) ![Working status](https://ci-apps.yunohost.org/ci/badges/agendav.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/agendav.maintain.svg) [![Install AgenDAV with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=agendav) -> *This package allow you to install AgenDAV quickly and simply on a YunoHost server. -If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* +*[Lire ce readme en français.](./README_fr.md)* + +> *This package allows you to install AgenDAV quickly and simply on a YunoHost server. +If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## 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. -**Shipped version:** 2.2.0 -## Screenshots +**Shipped version:** 2.2.0~ynh3 -![](http://agendav.org/img/screenshots/2.0.0-beta1/001_month_view.png) +**Demo:** https://demo.yunohost.org/agendav/ +## Documentation and resources -## Demo +* Official app website: +* Official admin documentation: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: -* [YunoHost demo](https://demo.yunohost.org/agendav/) +## Developer info -## Configuration - -## Documentation - - * Official documentation: https://agendav.readthedocs.io/en/2.2.0/ - * YunoHost documentation: If specific documentation is needed, feel free to contribute. - -## YunoHost specific features - -#### Supported architectures - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/agendav.svg)](https://ci-apps.yunohost.org/ci/apps/agendav/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/agendav.svg)](https://ci-apps-arm.yunohost.org/ci/apps/agendav/) - -## Limitations - -## Additional information - -### TODO - - * Submit HTTP auth patch for upstream integration - -## Links - - * Report a bug: https://github.com/YunoHost-Apps/agendav_ynh/issues - * AgenDAV repository: https://github.com/agendav/agendav/ - * YunoHost website: https://yunohost.org/ - ---- - -## Developers info - -Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/agendav_ynh/tree/testing). +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/agendav_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/agendav_ynh/tree/testing --debug or sudo yunohost app upgrade agendav -u https://github.com/YunoHost-Apps/agendav_ynh/tree/testing --debug ``` + +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..ab09da4 --- /dev/null +++ b/README_fr.md @@ -0,0 +1,44 @@ + + +# AgenDAV pour YunoHost + +[![Niveau d'intégration](https://dash.yunohost.org/integration/agendav.svg)](https://dash.yunohost.org/appci/app/agendav) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/agendav.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/agendav.maintain.svg) +[![Installer AgenDAV avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=agendav) + +*[Read this readme in english.](./README.md)* + +> *Ce package vous permet d'installer AgenDAV rapidement et simplement sur un serveur YunoHost. +Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* + +## Vue d'ensemble + +[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. + + +**Version incluse :** 2.2.0~ynh3 + +**Démo :** https://demo.yunohost.org/agendav/ +## Documentations et ressources + +* Site officiel de l'app : +* Documentation officielle de l'admin : +* Dépôt de code officiel de l'app : +* Documentation YunoHost pour cette app : +* Signaler un bug : + +## Informations pour les développeurs + +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/agendav_ynh/tree/testing). + +Pour essayer la branche testing, procédez comme suit. + +``` bash +sudo yunohost app install https://github.com/YunoHost-Apps/agendav_ynh/tree/testing --debug +ou +sudo yunohost app upgrade agendav -u https://github.com/YunoHost-Apps/agendav_ynh/tree/testing --debug +``` + +**Plus d'infos sur le packaging d'applications :** From d7d10fb4f8e3b0b8e8b4e1ce60d599d76cd2f8bb Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 29 Jul 2022 20:10:14 +0200 Subject: [PATCH 16/19] Fix rights --- scripts/install | 10 ++++++++-- scripts/restore | 4 ++-- scripts/upgrade | 24 +++++++++++++++++++++--- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index 906724e..4f90811 100644 --- a/scripts/install +++ b/scripts/install @@ -69,6 +69,8 @@ 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 #================================================= @@ -103,6 +105,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -169,14 +175,14 @@ ynh_script_progression --message="Initialising AgenDAV..." --weight=3 # SECURE FILES AND DIRECTORIES #================================================= -chown -R root: $final_path +chown -R $app:www-data $final_path # Only agendav user should write here chown -R $app ${final_path}/web/var/cache/{profiler,twig} # The agendav user should read here, but does not need to write # Other users should not be able to read as it stores passwords. -chown -R root:$app ${final_path}/web/config/ +chown -R $app:www-data ${final_path}/web/config/ chmod -R 750 ${final_path}/web/config/ #================================================= diff --git a/scripts/restore b/scripts/restore index 4106230..364f7a4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -60,14 +60,14 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -chown -R root: $final_path +chown -R $app:www-data $final_path # Only agendav user should write here chown -R $app ${final_path}/web/var/cache/{profiler,twig} # The agendav user should read here, but does not need to write # Other users should not be able to read as it stores passwords. -chown -R root:$app ${final_path}/web/config/ +chown -R $app:www-data ${final_path}/web/config/ chmod -R 750 ${final_path}/web/config/ #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8a8aa2e..c744aa9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -26,7 +26,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." +ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) @@ -63,6 +63,13 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # CREATE DEDICATED USER #================================================= @@ -106,6 +113,17 @@ then ynh_setup_source --dest_dir="$final_path" fi +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -174,14 +192,14 @@ ynh_script_progression --message="Upgrading AgenDAV..." # SECURE FILES AND DIRECTORIES #================================================= -chown -R root: $final_path +chown -R $app:www-data $final_path # Only agendav user should write here chown -R $app ${final_path}/web/var/cache/{profiler,twig} # The agendav user should read here, but does not need to write # Other users should not be able to read as it stores passwords. -chown -R root:$app ${final_path}/web/config/ +chown -R $app:www-data ${final_path}/web/config/ chmod -R 750 ${final_path}/web/config/ #================================================= From 859d58fa13484298c3c921df70c34b466569dfdf Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 30 Jul 2022 01:09:23 +0200 Subject: [PATCH 17/19] Fix phpversion --- scripts/install | 1 + scripts/upgrade | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 4f90811..657d863 100644 --- a/scripts/install +++ b/scripts/install @@ -124,6 +124,7 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=3 # Create a dedicated NGINX config ynh_add_nginx_config +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC SETUP diff --git a/scripts/upgrade b/scripts/upgrade index c744aa9..78c102a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -139,6 +139,7 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." # Create a dedicated NGINX config ynh_add_nginx_config +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC UPGRADE From bcee5eb30b06dcfa26eaf60bb1d5723d35a18bfc Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 30 Jul 2022 07:41:37 +0200 Subject: [PATCH 18/19] Update manifest.json --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index ceccb79..7215dfd 100644 --- a/manifest.json +++ b/manifest.json @@ -17,8 +17,8 @@ }, "license": "GPL-3.0", "maintainer": { - "name": "julien", - "email": "julien.malik@paraiso.me" + "name": "", + "email": "" }, "requirements": { "yunohost": ">= 4.3.0" From 862b89008464238b3c8731dc81b98ef33e861f07 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 15 Aug 2022 13:33:42 +0000 Subject: [PATCH 19/19] Auto-update README --- README.md | 1 + README_fr.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 17a9b3a..3bc5133 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in **Shipped version:** 2.2.0~ynh3 + **Demo:** https://demo.yunohost.org/agendav/ ## Documentation and resources diff --git a/README_fr.md b/README_fr.md index ab09da4..69d1071 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,8 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [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. -**Version incluse :** 2.2.0~ynh3 +**Version incluse :** 2.2.0~ynh3 + **Démo :** https://demo.yunohost.org/agendav/ ## Documentations et ressources