From 9c25b8f61b5515de814abf1a444f147e15bdcf4b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 17 Dec 2021 12:08:46 +0100 Subject: [PATCH] 1.2.21 --- conf/app.src | 5 ++--- conf/nginx.conf | 5 ----- manifest.json | 11 ++++------- scripts/_common.sh | 2 +- scripts/install | 9 ++++++++- scripts/remove | 8 ++++++++ scripts/restore | 15 ++++++++++----- scripts/upgrade | 37 ++++++++++++++++++++++--------------- 8 files changed, 55 insertions(+), 37 deletions(-) diff --git a/conf/app.src b/conf/app.src index df08d81..cdd8441 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,5 @@ -SOURCE_URL=https://github.com/kanboard/kanboard/archive/refs/tags/v1.2.20.tar.gz -SOURCE_SUM=e94c8b75b34a1346f2a5ef7faf8c2300fb05b37a850723d9b92b1d4f0f7d9665 +SOURCE_URL=https://github.com/kanboard/kanboard/archive/refs/tags/v1.2.21.tar.gz +SOURCE_SUM=95b542d63f7cafcc79d76493d184e4f65110fb6294816fa1550a4b34ae65da0b SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/conf/nginx.conf b/conf/nginx.conf index f1689fc..d872534 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,11 +4,6 @@ location __PATH__/ { # Path to source alias __FINALPATH__/; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - index index.php; client_max_body_size 50M; try_files $uri $uri/ /index.php?$args; diff --git a/manifest.json b/manifest.json index fa9d880..10190ff 100644 --- a/manifest.json +++ b/manifest.json @@ -6,14 +6,13 @@ "en": "Kanban project management software", "fr": "Logiciel de gestion de projet Kanban" }, - "version": "1.2.20~ynh4", + "version": "1.2.21~ynh1", "url": "https://kanboard.net", "upstream": { "license": "MIT", "website": "https://kanboard.net", "demo": "https://demo.yunohost.org/kanboard/", "admindoc": "https://docs.kanboard.org/en/latest/", - "userdoc": "https://yunohost.org/#/app_kanboard", "code": "https://github.com/kanboard/kanboard" }, "license": "MIT", @@ -22,7 +21,7 @@ "email": "" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.0" }, "previous_maintainers": [{ "name": "mbugeia", @@ -42,8 +41,7 @@ "install": [ { "name": "domain", - "type": "domain", - "example": "domain.org" + "type": "domain" }, { "name": "path", @@ -53,8 +51,7 @@ }, { "name": "admin", - "type": "user", - "example": "johndoe" + "type": "user" }, { "name": "is_public", diff --git a/scripts/_common.sh b/scripts/_common.sh index cea4e7d..6eb3532 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ YNH_PHP_VERSION="7.3" -extra_php_dependencies="php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-opcache php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-mysql" +pkg_dependencies="php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-opcache php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-mysql" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 90eb570..e306a83 100644 --- a/scripts/install +++ b/scripts/install @@ -47,6 +47,13 @@ ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=adminusername --value=$admin +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=3 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # STANDARD MODIFICATIONS #================================================= @@ -97,7 +104,7 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring PHP-FPM..." --weight=16 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/remove b/scripts/remove index 80922e1..2284ff9 100644 --- a/scripts/remove +++ b/scripts/remove @@ -62,6 +62,14 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=2 # Remove the dedicated PHP-FPM config ynh_remove_fpm_config +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index 3ca47c6..fa63911 100644 --- a/scripts/restore +++ b/scripts/restore @@ -33,10 +33,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=2 -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 " +test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS @@ -75,7 +72,7 @@ ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=6 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" # Recreate a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config #================================================= # SPECIFIC RESTORATION @@ -97,6 +94,14 @@ ynh_restore_file "/etc/fail2ban/jail.d/$app.conf" ynh_restore_file "/etc/fail2ban/filter.d/$app.conf" ynh_systemd_action --action=restart --service_name=fail2ban +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=3 + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + #================================================= # RESTORE THE CRON FILE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 815fbec..676f89d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,6 +32,20 @@ email=$(ynh_user_get_info --username=$admin --key=mail) upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up Kanboard before upgrading (may take a while)..." --weight=5 + +# 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 + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -56,20 +70,6 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up Kanboard before upgrading (may take a while)..." --weight=5 - -# 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 - #================================================= # CREATE DEDICATED USER #================================================= @@ -108,13 +108,20 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=3 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # PHP-FPM CONFIGURATION #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=5 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config #================================================= # UPGRADE KANBOARD