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 #47 from YunoHost-Apps/testing

Apply example_ynh
This commit is contained in:
yalh76 2022-07-21 19:32:28 +02:00 committed by GitHub
commit 07069e7a5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 366 additions and 347 deletions

View file

@ -1,70 +1,59 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# Archivist for YunoHost
[![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)
[![Integration level](https://dash.yunohost.org/integration/archivist.svg)](https://dash.yunohost.org/appci/app/archivist) ![Working status](https://ci-apps.yunohost.org/ci/badges/archivist.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/archivist.maintain.svg)
[![Install Archivist with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=archivist)
*[Lire ce readme en français.](./README_fr.md)*
> *This package allow you to install archivist quickly and simply on a YunoHost server.
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
> *This package allows you to install Archivist quickly and simply on a YunoHost server.
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## Overview
Archivist is an automatic backup system for your server.
It able to makes backups of your YunoHost core and your apps by using the YunoHost backup command.
It can also makes backups of specified directories.
Your backups can be send to many other places, local or distant.
Archivist is automatically launched periodicaly to update your backups and send the modifications to the other places.
**Shipped version:** 1.3.2
## Screenshots
## Demo
No demo available.
**Shipped version:** 1.3.2~ynh2
## Disclaimers / important information
## Configuration
The configuration of archivist can be changed in the file /opt/yunohost/archivist/Backup_list.conf
Please read the [documentation](https://github.com/maniackcrudelis/archivist/blob/master/Configuration.md) about the configuration of archivist for more informations.
## Documentation
* YunoHost documentation: There no specific documentations, feel free to contribute.
## YunoHost specific features
#### Multi-users support
Not relevant.
#### Supported architectures
* 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/)
* 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
* Encfs, which be used to encrypt the data, is not fully secured.
Have a look to the [security audit](https://defuse.ca/audits/encfs.htm) to have more informations.
## Links
* Report a bug: https://github.com/YunoHost-Apps/archivist_ynh/issues
* archivist website: https://github.com/maniackcrudelis/archivist
* YunoHost website: https://yunohost.org/
## Documentation and resources
---
* Official app website: <https://github.com/maniackcrudelis/archivist>
* Upstream app code repository: <https://github.com/maniackcrudelis/archivist>
* YunoHost documentation for this app: <https://yunohost.org/app_archivist>
* Report a bug: <https://github.com/YunoHost-Apps/archivist_ynh/issues>
Developers infos
----------------
## Developer info
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/archivist_ynh/tree/testing).
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/archivist_ynh/tree/testing).
To try the testing branch, please proceed like that.
```
sudo yunohost app install https://github.com/YunoHost-Apps/archivist_ynh/tree/testing --force --debug
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/archivist_ynh/tree/testing --debug
or
sudo yunohost app upgrade archivist -u https://github.com/YunoHost-Apps/archivist_ynh/tree/testing --debug
```
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>

View file

@ -1,72 +1,58 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# Archivist pour YunoHost
[![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)
[![Niveau d'intégration](https://dash.yunohost.org/integration/archivist.svg)](https://dash.yunohost.org/appci/app/archivist) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/archivist.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/archivist.maintain.svg)
[![Installer Archivist avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=archivist)
*[Read this readme in english.](./README.md)*
> *Ce package vous permet d'installer archivist rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, merci de regarder [ici](https://yunohost.org/#/install_fr) pour savoir comment l'installer et en profiter.*
> *Ce package vous permet d'installer Archivist rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
## Vue d'ensemble
## Résumé
Archivist est un système de sauvegarde automatique pour votre serveur.
Il est capable de faire des sauvegardes de votre noyau YunoHost et de vos applications en utilisant la commande de backup de YunoHost.
Il peut également faire des sauvegardes de répertoires spécifiques.
Vos sauvegardes peuvent être envoyées à de nombreux autres endroits, locaux ou distants.
Archivist est automatiquement lancé périodiquement pour mettre à jour vos sauvegardes et envoyer les modifications aux autres emplacements.
**Version embarquée:** 1.3.2
## Captures d'écran
## Démo
Aucune démo pour cette application.
**Version incluse :** 1.3.2~ynh2
## Avertissements / informations importantes
## Configuration
La configuration d'archivist peut être modifiée dans le fichier /opt/yunohost/archivist/Backup_list.conf
Veuillez lire la [documentation](https://github.com/maniackcrudelis/archivist/blob/master/Configuration_fr.md) sur la configuration d'archivist pour plus d'informations.
## Documentation
* Documentation YunoHost: Il n'y a pas d'autre documentation, n'hésitez pas à contribuer.
## Fonctionnalités spécifiques à YunoHost
#### Support multi-utilisateurs
Non applicable
#### Architectures supportées.
* 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/)
* 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
* Encfs, qui est utilisé pour chiffrer les données, n'est pas parfaitement sécurisé.
Consultez l'[audit de sécurité](https://defuse.ca/audits/encfs.htm) pour avoir plus d'informations.
## Informations additionnelles
## Liens
## Documentations et ressources
* Reporter un bug: https://github.com/YunoHost-Apps/archivist_ynh/issues
* Site de archivist: https://github.com/maniackcrudelis/archivist
* Site de YunoHost: https://yunohost.org/
* Site officiel de l'app : <https://github.com/maniackcrudelis/archivist>
* Dépôt de code officiel de l'app : <https://github.com/maniackcrudelis/archivist>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_archivist>
* Signaler un bug : <https://github.com/YunoHost-Apps/archivist_ynh/issues>
---
Informations à l'intention des développeurs
----------------
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/archivist_ynh/tree/testing).
Pour tester la branche testing, merci de procéder ainsi.
```
sudo yunohost app install https://github.com/YunoHost-Apps/archivist_ynh/tree/testing --force --debug
Pour essayer la branche testing, procédez comme suit.
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/archivist_ynh/tree/testing --debug
ou
sudo yunohost app upgrade archivist -u https://github.com/YunoHost-Apps/archivist_ynh/tree/testing --debug
```
**Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>

0
doc/.gitkeep Normal file
View file

6
doc/DESCRIPTION.md Normal file
View file

@ -0,0 +1,6 @@
Archivist is an automatic backup system for your server.
It able to makes backups of your YunoHost core and your apps by using the YunoHost backup command.
It can also makes backups of specified directories.
Your backups can be send to many other places, local or distant.
Archivist is automatically launched periodicaly to update your backups and send the modifications to the other places.

5
doc/DESCRIPTION_fr.md Normal file
View file

@ -0,0 +1,5 @@
Archivist est un système de sauvegarde automatique pour votre serveur.
Il est capable de faire des sauvegardes de votre noyau YunoHost et de vos applications en utilisant la commande de backup de YunoHost.
Il peut également faire des sauvegardes de répertoires spécifiques.
Vos sauvegardes peuvent être envoyées à de nombreux autres endroits, locaux ou distants.
Archivist est automatiquement lancé périodiquement pour mettre à jour vos sauvegardes et envoyer les modifications aux autres emplacements.

10
doc/DISCLAIMER.md Normal file
View file

@ -0,0 +1,10 @@
## Configuration
The configuration of archivist can be changed in the file /opt/yunohost/archivist/Backup_list.conf
Please read the [documentation](https://github.com/maniackcrudelis/archivist/blob/master/Configuration.md) about the configuration of archivist for more informations.
## Limitations
* Encfs, which be used to encrypt the data, is not fully secured.
Have a look to the [security audit](https://defuse.ca/audits/encfs.htm) to have more informations.

10
doc/DISCLAIMER_fr.md Normal file
View file

@ -0,0 +1,10 @@
## Configuration
La configuration d'archivist peut être modifiée dans le fichier /opt/yunohost/archivist/Backup_list.conf
Veuillez lire la [documentation](https://github.com/maniackcrudelis/archivist/blob/master/Configuration_fr.md) sur la configuration d'archivist pour plus d'informations.
## Limitations
* Encfs, qui est utilisé pour chiffrer les données, n'est pas parfaitement sécurisé.
Consultez l'[audit de sécurité](https://defuse.ca/audits/encfs.htm) pour avoir plus d'informations.

0
doc/screenshots/.gitkeep Normal file
View file

View file

@ -6,8 +6,13 @@
"en": "Automatic backups",
"fr": "Sauvegardes automatiques"
},
"version": "1.3.2~ynh1",
"version": "1.3.2~ynh2",
"url": "https://github.com/maniackcrudelis/archivist",
"upstream": {
"license": "GPL-3.0",
"website": "https://github.com/maniackcrudelis/archivist",
"code": "https://github.com/maniackcrudelis/archivist"
},
"license": "GPL-3.0",
"maintainer": {
"name": "",

View file

@ -4,8 +4,12 @@
# COMMON VARIABLES
#=================================================
# Dependencies
app_depencencies="rsync encfs sshpass ccrypt lzop zstd lzip"
# dependencies used by the app
pkg_dependencies="rsync encfs sshpass ccrypt lzop zstd lzip"
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS

View file

@ -6,6 +6,7 @@
# IMPORT GENERIC HELPERS
#=================================================
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
@ -26,7 +27,10 @@ app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# STANDARD BACKUP STEPS
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
@ -42,7 +46,7 @@ ynh_backup --src_path="$final_path"
ynh_backup --src_path="/etc/logrotate.d/$app"
#=================================================
# BACKUP THE CRON FILE
# BACKUP VARIOUS FILES
#=================================================
ynh_backup --src_path="/etc/cron.d/$app"

View file

@ -6,7 +6,6 @@
# IMPORT GENERIC HELPERS
#=================================================
# Load common variables for all scripts.
source _common.sh
source /usr/share/yunohost/helpers
@ -65,7 +64,7 @@ ynh_script_progression --message="Installing dependencies..." --weight=15
# To find this, install the package, install also debconf-utils
# Then use `debconf-get-selections | grep package`
echo "encfs encfs/security-information boolean true" | debconf-set-selections
ynh_install_app_dependencies $app_depencencies
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -160,8 +159,6 @@ ynh_replace_string --match_string="__FREQUENCY__" --replace_string="$cron_freq"
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="/etc/cron.d/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
@ -169,6 +166,8 @@ ynh_store_file_checksum --file="/etc/cron.d/$app"
# Set permissions to app files
chown -R root: $final_path
#=================================================
# GENERIC FINALIZATION
#=================================================
# SETUP LOGROTATE
#=================================================

View file

@ -21,12 +21,12 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE DEPENDENCIES
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=7
ynh_script_progression --message="Removing logrotate configuration..."
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# REMOVE APP MAIN DIR
@ -37,18 +37,19 @@ ynh_script_progression --message="Removing app main directory..."
ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE LOGROTATE CONFIGURATION
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing logrotate configuration..."
ynh_script_progression --message="Removing dependencies..." --weight=7
# Remove the app-specific logrotate config
ynh_remove_logrotate
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE THE CRON FILE
# REMOVE VARIOUS FILES
#=================================================
ynh_script_progression --message="Removing various files..."
# Remove a cron file
ynh_secure_remove --file="/etc/cron.d/$app"

View file

@ -6,7 +6,7 @@
# IMPORT GENERIC HELPERS
#=================================================
# Load common variables for all scripts.
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
@ -20,7 +20,7 @@ ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading settings..."
ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
@ -31,7 +31,8 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
ynh_script_progression --message="Validating restoration parameters..."
test ! -d $final_path || ynh_die --message="There is already a directory: $final_path "
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
#=================================================
# STANDARD RESTORATION STEPS
@ -53,27 +54,25 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=17
# To find this, install the package, install also debconf-utils
# Then use `debconf-get-selections | grep package`
echo "encfs encfs/security-information boolean true" | debconf-set-selections
ynh_install_app_dependencies $app_depencencies
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RESTORE VARIOUS FILES
#=================================================
ynh_script_progression --message="Restoring various files..."
ynh_restore_file --origin_path="/etc/cron.d/$app"
mkdir -p "/home/yunohost.app/${app}/backup"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..."
mkdir -p /var/log/$app
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# RESTORE THE CRON FILE
#=================================================
ynh_restore_file --origin_path="/etc/cron.d/$app"
#=================================================
# RECREATE DIRECTORIES
#=================================================
mkdir -p "/home/yunohost.app/${app}/backup"
#=================================================
# SEND A README FOR THE ADMIN
#=================================================

View file

@ -6,7 +6,6 @@
# IMPORT GENERIC HELPERS
#=================================================
# Load common variables for all scripts.
source _common.sh
source /usr/share/yunohost/helpers
@ -27,6 +26,7 @@ overwrite_cron=$(ynh_app_setting_get --app=$app --key=overwrite_cron)
#=================================================
# CHECK VERSION
#=================================================
ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed)
@ -38,12 +38,14 @@ ynh_script_progression --message="Backing up the app before upgrading (may take
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# restore it if the upgrade fails
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
@ -85,8 +87,6 @@ if [ -z "$admin_mail_html" ]; then
ynh_app_setting_set --app=$app --key=admin_mail_html --value=$admin_mail_html
fi
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -94,6 +94,7 @@ fi
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=2
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
fi
@ -103,7 +104,7 @@ fi
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=8
ynh_install_app_dependencies $app_depencencies
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# SPECIFIC UPGRADE
@ -143,6 +144,15 @@ then
ynh_store_file_checksum --file="/etc/cron.d/$app"
fi
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
# Set permissions on app files
chown -R root: $final_path
#=================================================
# GENERIC FINALIZATION
#=================================================
# SETUP LOGROTATE
#=================================================
@ -151,15 +161,6 @@ ynh_script_progression --message="Upgrading logrotate configuration..."
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
# Set permissions on app files
chown -R root: $final_path
#=================================================
# SEND A README FOR THE ADMIN
#=================================================