diff --git a/README.md b/README.md index 4f82d4a..7c16d56 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Archivist for YunoHost -[![Integration level](https://dash.yunohost.org/integration/archivist.svg)](https://dash.yunohost.org/appci/app/archivist) +[![Integration level](https://dash.yunohost.org/integration/archivist.svg)](https://dash.yunohost.org/appci/app/archivist) ![](https://ci-apps.yunohost.org/ci/badges/archivist.status.svg) [![](https://ci-apps.yunohost.org/ci/badges/archivist.maintain.svg)](https://github.com/YunoHost/Apps/#what-to-do-if-i-cant-maintain-my-app-anymore-) [![Install archivist with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=archivist) *[Lire ce readme en français.](./README_fr.md)* @@ -42,7 +42,7 @@ Not relevant. * x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/archivist%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/archivist/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/archivist%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/archivist/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/archivist%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/archivist/) +* Buster x86-64b - [![Build Status](https://ci-buster.nohost.me/ci/logs/archivist%20%28Apps%29.svg)](https://ci-buster.nohost.me/ci/apps/archivist/) ## Limitations diff --git a/README_fr.md b/README_fr.md index 97742a3..2689159 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,6 +1,6 @@ # Archivist pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/archivist.svg)](https://dash.yunohost.org/appci/app/archivist) +[![Niveau d'intégration](https://dash.yunohost.org/integration/archivist.svg)](https://dash.yunohost.org/appci/app/archivist) ![](https://ci-apps.yunohost.org/ci/badges/archivist.status.svg) [![](https://ci-apps.yunohost.org/ci/badges/archivist.maintain.svg)](https://github.com/YunoHost/Apps/#what-to-do-if-i-cant-maintain-my-app-anymore-) [![Installer archivist avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=archivist) *[Read this readme in english.](./README.md)* @@ -42,7 +42,7 @@ Non applicable * x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/archivist%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/archivist/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/archivist%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/archivist/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/archivist%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/archivist/) +* Buster x86-64b - [![Build Status](https://ci-buster.nohost.me/ci/logs/archivist%20%28Apps%29.svg)](https://ci-buster.nohost.me/ci/apps/archivist/) ## Limitations diff --git a/check_process b/check_process index 7b95ebb..17b7a4b 100644 --- a/check_process +++ b/check_process @@ -5,6 +5,15 @@ core_backup=1 apps_backup=1 frequency="Weekly" + ; Config_panel + main.encryption.encrypt=1|0 + main.encryption.encryption_pwd=password1|password2 + main.backup_types.core_backup=1|0 + main.backup_types.apps_backup=1|0 + main.backup_options.frequency=Daily|Each 3 days|Weekly|Biweekly|Monthly + main.backup_options.max_size=1000 + main.overwrite_files.overwrite_cron=1|0 + main.global_config.email_type=1|0 ; Checks pkg_linter=1 setup_sub_dir=0 @@ -18,11 +27,22 @@ multi_instance=1 port_already_use=0 change_url=0 + config_panel=1 +;; Test actions without encryption +# Actions can't be tested with the encryption on, because LXC does not support fuse. + ; Manifest + encrypt=0 + encryption_pwd="" + core_backup=1 + apps_backup=1 + ; Checks + setup_nourl=1 + actions=1 ;;; Levels Level 5=auto ;;; Options Email= -Notification=down +Notification=change ;;; Upgrade options ; commit=2b2793737d5e1374659cbb74838d10162a2147e6 name=03 Nov 2017 2b2793737d5e1374659cbb74838d10162a2147e6 diff --git a/manifest.json b/manifest.json index 08bb929..6272363 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Automatic backups.", "fr": "Sauvegardes automatiques." }, - "version": "1.0.1~ynh2", + "version": "1.0.1~ynh3", "url": "https://github.com/maniackcrudelis/archivist", "license": "GPL-3.0", "maintainer": { @@ -14,7 +14,7 @@ "email": "maniackc_dev@crudelis.fr" }, "requirements": { - "yunohost": ">= 3.5.0" + "yunohost": ">= 3.6.0" }, "multi_instance": true, "services": [], diff --git a/scripts/actions/clean_backups b/scripts/actions/clean_backups index d24726c..38aef75 100755 --- a/scripts/actions/clean_backups +++ b/scripts/actions/clean_backups @@ -9,6 +9,13 @@ source scripts/_common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # RETRIEVE ARGUMENTS #================================================= diff --git a/scripts/actions/force_backup b/scripts/actions/force_backup index 9780ab8..bde2993 100755 --- a/scripts/actions/force_backup +++ b/scripts/actions/force_backup @@ -9,6 +9,13 @@ source scripts/_common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # RETRIEVE ARGUMENTS #================================================= diff --git a/scripts/actions/reset_default_config b/scripts/actions/reset_default_config index 9c65c15..8a3543b 100755 --- a/scripts/actions/reset_default_config +++ b/scripts/actions/reset_default_config @@ -9,11 +9,19 @@ source scripts/_common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # RETRIEVE ARGUMENTS #================================================= app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID} + final_path=$(ynh_app_setting_get --app=$app --key=final_path) encrypt=$(ynh_app_setting_get --app=$app --key=encrypt) core_backup=$(ynh_app_setting_get --app=$app --key=core_backup) diff --git a/scripts/config b/scripts/config index 0e2252c..537858b 100644 --- a/scripts/config +++ b/scripts/config @@ -58,9 +58,9 @@ ynh_core_backup="${YNH_CONFIG_MAIN_BACKUP_TYPES_CORE_BACKUP:-$old_ynh_core_backu # ynh_app_backup if [ -n "$(get_config_value ynh_app_backup)" ] then - old_ynh_app_backup="true" + old_ynh_app_backup="1" else - old_ynh_app_backup="false" + old_ynh_app_backup="0" fi ynh_app_backup="${YNH_CONFIG_MAIN_BACKUP_TYPES_APPS_BACKUP:-$old_ynh_app_backup}" @@ -74,12 +74,10 @@ max_size="${YNH_CONFIG_MAIN_BACKUP_OPTIONS_MAX_SIZE:-$old_max_size}" # Overwrite cron file old_overwrite_cron="$(ynh_app_setting_get $app overwrite_cron)" -old_overwrite_cron=$(bool_to_true_false $old_overwrite_cron) overwrite_cron="${YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_CRON:-$old_overwrite_cron}" # Type of admin mail configuration old_admin_mail_html="$(ynh_app_setting_get $app admin_mail_html)" -old_admin_mail_html=$(bool_to_true_false $old_admin_mail_html) admin_mail_html="${YNH_CONFIG_MAIN_GLOBAL_CONFIG_EMAIL_TYPE:-$old_admin_mail_html}" #================================================= @@ -115,7 +113,7 @@ apply_config() { #================================================= # Change the password if needed - if [ "$encrypt" = "true" ] + if [ "$encrypt" = "1" ] then ynh_print_OFF test -n "$encrypt_password" || ynh_die --message="The password for encryption can't be empty if you choose to enable encryption." @@ -142,7 +140,7 @@ apply_config() { ynh_replace_string --match_string="^ynh_core_backup=.*" --replace_string="ynh_core_backup=$ynh_core_backup" --target_file="$config_file" # Change ynh_app_backup in the config file - if [ "$ynh_app_backup" = "true" ] && [ "$old_ynh_app_backup" = "false" ] + if [ "$ynh_app_backup" = "1" ] && [ "$old_ynh_app_backup" = "0" ] then # If ynh_app_backup changed from false to true. # Add all current applications to the backup @@ -151,7 +149,7 @@ apply_config() { ynh_print_info --message="Add a backup for the app $backup_app." ynh_replace_string --match_string="^ynh_app_backup=$" --replace_string="ynh_app_backup=$backup_app\n&" --target_file="$config_file" done <<< "$(yunohost app list -i | grep id: | sed 's/.*id: //')" - elif [ "$ynh_app_backup" = "false" ] && [ "$old_ynh_app_backup" = "true" ] + elif [ "$ynh_app_backup" = "0" ] && [ "$old_ynh_app_backup" = "1" ] then # Remove all app currently backup # By deleting all line starting by 'ynh_app_backup=' and having something after '=' @@ -186,7 +184,6 @@ apply_config() { #================================================= # Set overwrite_cron - overwrite_cron=$(bool_to_01 $overwrite_cron) ynh_app_setting_set --app=$app --key=overwrite_cron --value="$overwrite_cron" #================================================= @@ -194,7 +191,6 @@ apply_config() { #================================================= # Set admin_mail_html - admin_mail_html=$(bool_to_01 $admin_mail_html) ynh_app_setting_set --app=$app --key=admin_mail_html --value="$admin_mail_html" } diff --git a/scripts/install b/scripts/install index 31d8e77..654423b 100755 --- a/scripts/install +++ b/scripts/install @@ -6,11 +6,12 @@ # IMPORT GENERIC HELPERS #================================================= -source _common.sh -source /usr/share/yunohost/helpers # Load common variables for all scripts. source _variables +source _common.sh +source /usr/share/yunohost/helpers + #================================================= # MANAGE SCRIPT FAILURE #================================================= diff --git a/scripts/restore b/scripts/restore index 56a0a3a..0c2011a 100755 --- a/scripts/restore +++ b/scripts/restore @@ -6,11 +6,12 @@ # IMPORT GENERIC HELPERS #================================================= -source ../settings/scripts/_common.sh -source /usr/share/yunohost/helpers # Load common variables for all scripts. source ../settings/scripts/_variables +source ../settings/scripts/_common.sh +source /usr/share/yunohost/helpers + #================================================= # MANAGE SCRIPT FAILURE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 45931e3..f0fb2b0 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -6,11 +6,12 @@ # IMPORT GENERIC HELPERS #================================================= -source _common.sh -source /usr/share/yunohost/helpers # Load common variables for all scripts. source _variables +source _common.sh +source /usr/share/yunohost/helpers + #================================================= # LOAD SETTINGS #=================================================