From f4e49412fc7a0364235b73aef63529c2b525106f Mon Sep 17 00:00:00 2001 From: Tobias Ollive Date: Wed, 7 Apr 2021 11:07:59 +0200 Subject: [PATCH] change backup script --- check_process | 2 +- manifest.json | 26 ++++++-------------------- scripts/backup | 6 ------ scripts/restore | 30 ++++++++++++++++++------------ 4 files changed, 25 insertions(+), 39 deletions(-) diff --git a/check_process b/check_process index 2924a40..dab3129 100644 --- a/check_process +++ b/check_process @@ -8,7 +8,7 @@ is_public=1 (PUBLIC|public=1|private=0) ; Checks pkg_linter=1 - setup_sub_dir=1 + setup_sub_dir=0 setup_root=1 setup_nourl=0 setup_private=1 diff --git a/manifest.json b/manifest.json index c276c76..041d0c1 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "tobias.ollive@oiseauroch.fr" }], "requirements": { - "yunohost": ">= 4.0.0" + "yunohost": ">= 4.1.0" }, "multi_instance": true, "services": [ @@ -25,30 +25,16 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain for Petrolette", - "fr": "Choisissez un domaine pour Petrolette" - }, "example": "domain.org" }, - { - "name": "path", - "type": "path", - "ask": { - "en": "choose a path", - "fr": "Choisissez un chemin" - }, - "example": "petrolette", - "default": "/" - }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Cette application doit-elle ĂȘtre publique ?" - }, - "default": true + "default": true, + "help" : { + "fr" : "Cette page sera accessible par n'importe qui. En revanche, la configuration reste personnelle" + "en" : "The page will be accessible by anyone." + } } ] } diff --git a/scripts/backup b/scripts/backup index 072f8e7..3fd95ee 100644 --- a/scripts/backup +++ b/scripts/backup @@ -37,12 +37,6 @@ datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= ynh_print_info --message="Declaring files to be backed up..." -#================================================= -# BACKUP THE APP MAIN DIR -#================================================= - -ynh_backup --src_path="$final_path" - #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index 9678126..466b379 100644 --- a/scripts/restore +++ b/scripts/restore @@ -52,12 +52,27 @@ test ! -d $final_path \ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= -# RESTORE MAINDIR +# SPECIFIC RESTORATION #================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=5 +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 + +ynh_install_nodejs --nodejs_version=$NODEJS_VERSION + +#================================================= +# REINSTALL PETROLLETTE +#================================================= +ynh_script_progression --message="Reinstalling the app ..." --weight=5 ynh_setup_source --dest_dir="$final_path" +pushd $final_path + ynh_use_nodejs + ynh_npm install +popd + + #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -74,15 +89,6 @@ ynh_system_user_create --username=$app chown -R $app:$app $final_path chmod -R o-rwx $final_path -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=1 - -ynh_install_nodejs --nodejs_version=$NODEJS_VERSION - #================================================= # RESTORE SYSTEMD #================================================= @@ -96,7 +102,7 @@ systemctl enable $app.service --quiet #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="The news reader that doesn't know you " --log="/home/yunohost.app/${app}/storage/logs/petrollette.log" +yunohost service add $app --description="The news reader that doesn't know you" --log="/home/yunohost.app/${app}/storage/logs/petrollette.log" #================================================= # START SYSTEMD SERVICE