1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/archivist_ynh.git synced 2024-09-03 18:15:55 +02:00

Merge pull request #26 from YunoHost-Apps/testing

Testing
This commit is contained in:
Maniack Crudelis 2020-04-08 20:05:32 +02:00 committed by GitHub
commit 7d180b5e97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 63 additions and 22 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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": [],

View file

@ -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
#=================================================

View file

@ -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
#=================================================

View file

@ -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)

View file

@ -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"
}

View file

@ -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
#=================================================

View file

@ -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
#=================================================

View file

@ -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
#=================================================