diff --git a/README.md b/README.md index 9fc177a..fe15abd 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Kanban project management software -**Shipped version:** 1.2.20~ynh2 +**Shipped version:** 1.2.20~ynh3 **Demo:** https://demo.yunohost.org/kanboard/ diff --git a/README_fr.md b/README_fr.md index fbcd0a3..d867cbe 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Logiciel de gestion de projet Kanban -**Version incluse :** 1.2.20~ynh2 +**Version incluse :** 1.2.20~ynh3 **Démo :** https://demo.yunohost.org/kanboard/ diff --git a/conf/app.src b/conf/app.src index e4223ab..df08d81 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ SOURCE_URL=https://github.com/kanboard/kanboard/archive/refs/tags/v1.2.20.tar.gz -SOURCE_SUM=ac401a9884b7c56d62faa3efda0402498dfa7ab6a60fc7cba4512a453b70c2ec +SOURCE_SUM=e94c8b75b34a1346f2a5ef7faf8c2300fb05b37a850723d9b92b1d4f0f7d9665 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 392e889..c0bba31 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Kanban project management software", "fr": "Logiciel de gestion de projet Kanban" }, - "version": "1.2.20~ynh2", + "version": "1.2.20~ynh3", "url": "https://kanboard.net", "upstream": { "license": "MIT", diff --git a/scripts/change_url b/scripts/change_url index 4a27e23..6d24ff0 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,6 +29,23 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#================================================= +# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. + ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" + + # Restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED #================================================= diff --git a/scripts/install b/scripts/install index c5fe364..90eb570 100644 --- a/scripts/install +++ b/scripts/install @@ -107,13 +107,8 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Configuring Kanboard..." -cp ../conf/config.php "$final_path/config.php" - -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config.php" -ynh_replace_string --match_string="__DB_NAME__" --replace_string=$db_name --target_file="$final_path/config.php" -ynh_replace_string --match_string="__ADMIN__" --replace_string=$admin --target_file="$final_path/config.php" -ynh_replace_string --match_string="__EMAIL__" --replace_string=$email --target_file="$final_path/config.php" -ynh_replace_string --match_string="__DOMAIN__" --replace_string=$domain --target_file="$final_path/config.php" +dir="__DIR__" +ynh_add_config --template="../conf/config.php" --destination="$final_path/config.php" chmod 400 "$final_path/config.php" chown $app "$final_path/config.php"