diff --git a/check_process b/check_process index e2d9c94..f84104e 100644 --- a/check_process +++ b/check_process @@ -1,9 +1,9 @@ ;; Test complet auto_remove=1 ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - admin="homer" (USER) + domain="domain.tld" + path="/path" + admin="homer" language="fr" ; Checks pkg_linter=1 @@ -16,13 +16,7 @@ upgrade=1 from_commit=0b1c3be0716e4800f2ed6f5b3065f707ed67b6bf backup_restore=1 multi_instance=1 - # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. - # incorrect_path=1 - port_already_use=0 change_url=1 -;;; Levels - # If the level 5 (Package linter) is forced to 1. Please add justifications here. - Level 5=auto ;;; Upgrade options ; commit=0b1c3be0716e4800f2ed6f5b3065f707ed67b6bf name=30 août 2020. Merge pull request #103 from ericgaspar/patch-1 diff --git a/manifest.json b/manifest.json index d5842a6..602050e 100644 --- a/manifest.json +++ b/manifest.json @@ -14,12 +14,12 @@ "email": "plopoyop@gmail.com" }, "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.1.7" }, "multi_instance": true, "services": [ "nginx", - "php7.0-fpm", + "php7.3-fpm", "mysql" ], "arguments": { @@ -27,19 +27,11 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for FreshRSS", - "fr": "Choisissez un nom de domaine pour FreshRSS" - }, "example": "domain.org" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for FreshRSS", - "fr": "Choisissez un chemin pour FreshRSS" - }, "example": "/rss", "default": "/rss" }, @@ -47,10 +39,6 @@ "name": "admin", "type": "user", "optional": false, - "ask": { - "en": "Choose an admin user", - "fr": "Choisissez l’administrateur" - }, "example": "homer" }, { diff --git a/scripts/change_url b/scripts/change_url index 35caa86..c9a4230 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -45,6 +45,23 @@ if [ -z $admin ]; then ynh_app_setting_set $app admin $admin fi +#================================================= +# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." + +# 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 PATHS SYNTAX #================================================= diff --git a/scripts/install b/scripts/install index 8a0babd..07f9269 100755 --- a/scripts/install +++ b/scripts/install @@ -126,13 +126,7 @@ done #================================================= ynh_script_progression --message="Setting up cron..." -cron_path="/etc/cron.d/$app" - -ynh_replace_string --match_string="__FINALPATH__" --replace_string=$final_path --target_file="../conf/freshrss.cron" -ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file="../conf/freshrss.cron" -ynh_replace_string --match_string="__PHPVERSION__" --replace_string=$phpversion --target_file="../conf/freshrss.cron" - -cp ../conf/freshrss.cron "$cron_path" +ynh_add_config --template="../conf/freshrss.cron" --destination="/etc/cron.d/$app" chmod 644 "$cron_path" #=================================================