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

Testing - packagingv2
This commit is contained in:
eric_G 2024-05-12 19:34:40 +02:00 committed by GitHub
commit bb543da774
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 472 additions and 1543 deletions

7
ALL_README.md Normal file
View file

@ -0,0 +1,7 @@
# All available README files by language
- [Read the README in English](README.md)
- [Irakurri README euskaraz](README_eu.md)
- [Lire le README en français](README_fr.md)
- [Le o README en galego](README_gl.md)
- [阅读中文(简体)的 README](README_zh_Hans.md)

View file

@ -1,111 +0,0 @@
Changelog
=========
## Unreleased
- Nothing for now...
## [1.3.3~ynh1]() - 2022-07-31
#### Fixed
- [ Fix encrypted exclusion - archivist 1.3.3]()
## [1.3.2~ynh1]() - 2022-01-25
#### Fixed
- [Fix tar symlink for apps - archivist 1.3.2](https://github.com/YunoHost-Apps/archivist_ynh/commit/ec15b96d819fc9c263b3d7769acde108d3c7ad83)
## [1.3.1~ynh1](https://github.com/YunoHost-Apps/archivist_ynh/commit/a9070b11e13d37908cf246804c0d331a57fea115) - 2021-11-07
#### Fixed
- [Fix multimedia hook killing hard drives - archivist 1.3.1](https://github.com/YunoHost-Apps/archivist_ynh/commit/a9070b11e13d37908cf246804c0d331a57fea115)
## [1.3~ynh1](https://github.com/YunoHost-Apps/archivist_ynh/pull/40) - 2021-05-27
#### Fixed
- [Fix backup hooks - archivist 1.3](https://github.com/YunoHost-Apps/archivist_ynh/pull/40)
## [1.2~ynh1](https://github.com/YunoHost-Apps/archivist_ynh/pull/33) - 2021-02-26
#### Added
- [Allow symlink for no compression - archivist 1.2](https://github.com/YunoHost-Apps/archivist_ynh/pull/33)
## [1.1~ynh1](https://github.com/YunoHost-Apps/archivist_ynh/pull/29) - 2021-01-12
#### Added
- [Allow to choose compression algorithms](https://github.com/YunoHost-Apps/archivist_ynh/pull/29)
#### Fixed
- [Fix YunoHost 4.1 support](https://github.com/YunoHost-Apps/archivist_ynh/pull/29)
#### Changed
- [Force compression for YunoHost backups](https://github.com/YunoHost-Apps/archivist_ynh/pull/29)
## [1.0.1~ynh2](https://github.com/YunoHost-Apps/archivist_ynh/pull/25) - 2020-01-04
#### Fixed
- [Fix config-panel](https://github.com/YunoHost-Apps/archivist_ynh/pull/25/commits/f79549b5e0ca755fcda13ed8ea6d88b4ef623352)
## [1.0.1~ynh1](https://github.com/YunoHost-Apps/archivist_ynh/pull/24) - 2019-12-27
#### Changed
* [Update to v1.0.1 (b2 and encfs fixes)](https://github.com/YunoHost-Apps/archivist_ynh/pull/24/commits/9e9c22141c5f0ac7ff23581d3a3feed7ee3b3ea9)
## [1.0~ynh2](https://github.com/YunoHost-Apps/archivist_ynh/pull/22) - 2019-12-05
#### Fixed
- [Add ccrypt to dependencies](https://github.com/YunoHost-Apps/archivist_ynh/pull/22/commits/b630fc838954169554d8153feb1c52b01d6ddf2a)
## [1.0~ynh1](https://github.com/YunoHost-Apps/archivist_ynh/pull/21) - 2019-12-03
#### Changed
- [Use toml for config-panel and actions](https://github.com/YunoHost-Apps/archivist_ynh/pull/21/commits/21b7e746095a9dccf9dda9a58cc8ec5afdd87736)
* [Update to v1.0 (Add support of BACKUP_CORE_ONLY)](https://github.com/YunoHost-Apps/archivist_ynh/pull/21/commits/9b3cfeab5b1260ce0d277f81bfd32e5326a2118d)
## [0.9~ynh1](https://github.com/YunoHost-Apps/archivist_ynh/pull/18) - 2019-08-12
#### Changed
* [Update to v0.9 (Recreate enc_backup_dir)](https://github.com/YunoHost-Apps/archivist_ynh/pull/19/commits/536e472adac15e9b6064cac5df5bf7656bc82437)
## [0.8~ynh1](https://github.com/YunoHost-Apps/archivist_ynh/pull/18) - 2019-06-30
#### Changed
* [Update to v0.8 (Add b2 sender)](https://github.com/YunoHost-Apps/archivist_ynh/pull/18/commits/3a52c10afeb129fb62779e9370bb27a052375d02)
## [0.7~ynh3](https://github.com/YunoHost-Apps/archivist_ynh/pull/16) - 2019-02-03
#### Added
- [Add progression bar](https://github.com/YunoHost-Apps/archivist_ynh/pull/16/commits/c626cb05d0f28d570f0eabbf6dbd13ca42ba58e4)
* [Changelog & html email](https://github.com/YunoHost-Apps/archivist_ynh/pull/16/commits/0b5345ba355c0ea0ebd86a1c5f076097d83c9118)
## [0.7~ynh2](https://github.com/YunoHost-Apps/archivist_ynh/pull/15) - 2019-01-21
#### Changed
- [Update to last standart](https://github.com/YunoHost-Apps/archivist_ynh/pull/15/commits/1c783c7376ed5a1013e4a88b3a4056bddb679b8c)
## [0.7~ynh1](https://github.com/YunoHost-Apps/archivist_ynh/pull/14) - 2018-11-24
#### Changed
* [Update to v0.7 (Fix backup --ignore arguments)](https://github.com/YunoHost-Apps/archivist_ynh/pull/14/commits/8c23cb555883676e80f1110b197ce821f5c66e1c)
## [0.6~ynh2](https://github.com/YunoHost-Apps/archivist_ynh/pull/13) - 2018-09-30
#### Added
* [Add actions and config-panel](https://github.com/YunoHost-Apps/archivist_ynh/pull/13/commits/ee8fd678273ca38df12b826f765544b8a00e1e39)
## [0.6~ynh2](https://github.com/YunoHost-Apps/archivist_ynh/pull/11) - 2018-07-16
#### Changed
- [Upgrade helpers](https://github.com/YunoHost-Apps/archivist_ynh/pull/11/commits/d3b202985184d475725cff72d75d79dc922926cb)
## [0.6~ynh1](https://github.com/YunoHost-Apps/archivist_ynh/pull/5) - 2018-01-04
#### Changed
* [Update to 0.6 (Pre and post backup)](https://github.com/YunoHost-Apps/archivist_ynh/pull/5/commits/11a5747a450745801acd6a47e609c054759d1224)

View file

@ -1,5 +1,5 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
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.
-->
@ -9,10 +9,10 @@ It shall NOT be edited by hand.
[![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)*
*[Read this README in other languages.](./ALL_README.md)*
> *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.*
> *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
@ -24,33 +24,20 @@ Archivist is automatically launched periodicaly to update your backups and send
**Shipped version:** 1.3.4~ynh1
## 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.
## 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.
**Shipped version:** 1.3.4~ynh2
## Documentation and resources
* Upstream app code repository: <https://github.com/maniackcrudelis/archivist>
* YunoHost Store: <https://apps.yunohost.org/app/archivist>
* Report a bug: <https://github.com/YunoHost-Apps/archivist_ynh/issues>
- Upstream app code repository: <https://github.com/maniackcrudelis/archivist>
- YunoHost Store: <https://apps.yunohost.org/app/archivist>
- Report a bug: <https://github.com/YunoHost-Apps/archivist_ynh/issues>
## Developer info
Please send 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.
To try the `testing` branch, please proceed like that:
``` bash
```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

46
README_eu.md Normal file
View file

@ -0,0 +1,46 @@
<!--
Ohart ongi: README hau automatikoki sortu da <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>ri esker
EZ editatu eskuz.
-->
# Archivist YunoHost-erako
[![Integrazio maila](https://dash.yunohost.org/integration/archivist.svg)](https://dash.yunohost.org/appci/app/archivist) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/archivist.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/archivist.maintain.svg)
[![Instalatu Archivist YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=archivist)
*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)*
> *Pakete honek Archivist YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.*
> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.*
## Aurreikuspena
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.
**Paketatutako bertsioa:** 1.3.4~ynh2
## Dokumentazioa eta baliabideak
- Jatorrizko aplikazioaren kode-gordailua: <https://github.com/maniackcrudelis/archivist>
- YunoHost Denda: <https://apps.yunohost.org/app/archivist>
- Eman errore baten berri: <https://github.com/YunoHost-Apps/archivist_ynh/issues>
## Garatzaileentzako informazioa
Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/archivist_ynh/tree/testing).
`testing` abarra probatzeko, ondorengoa egin:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/archivist_ynh/tree/testing --debug
edo
sudo yunohost app upgrade archivist -u https://github.com/YunoHost-Apps/archivist_ynh/tree/testing --debug
```
**Informazio gehiago aplikazioaren paketatzeari buruz:** <https://yunohost.org/packaging_apps>

View file

@ -1,6 +1,6 @@
<!--
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.
Nota bene: ce README est automatiquement généré par <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
Il NE doit PAS être modifié à la main.
-->
# Archivist pour YunoHost
@ -9,10 +9,10 @@ It shall NOT be edited by hand.
[![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)*
*[Lire le README dans d'autres langues.](./ALL_README.md)*
> *Ce package vous permet dinstaller Archivist rapidement et simplement sur un serveur YunoHost.
Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment linstaller et en profiter.*
> *Ce package vous permet dinstaller Archivist rapidement et simplement sur un serveur YunoHost.*
> *Si vous navez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment linstaller et en profiter.*
## Vue densemble
@ -23,36 +23,23 @@ Vos sauvegardes peuvent être envoyées à de nombreux autres endroits, locaux o
Archivist est automatiquement lancé périodiquement pour mettre à jour vos sauvegardes et envoyer les modifications aux autres emplacements.
**Version incluse :** 1.3.4~ynh1
## 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.
## 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.
**Version incluse:** 1.3.4~ynh2
## Documentations et ressources
* Dépôt de code officiel de lapp : <https://github.com/maniackcrudelis/archivist>
* YunoHost Store: <https://apps.yunohost.org/app/archivist>
* Signaler un bug : <https://github.com/YunoHost-Apps/archivist_ynh/issues>
- Dépôt de code officiel de lapp: <https://github.com/maniackcrudelis/archivist>
- YunoHost Store: <https://apps.yunohost.org/app/archivist>
- Signaler un bug: <https://github.com/YunoHost-Apps/archivist_ynh/issues>
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/archivist_ynh/tree/testing).
Merci de faire vos pull request sur la [branche `testing`](https://github.com/YunoHost-Apps/archivist_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
Pour essayer la branche `testing`, procédez comme suit:
``` bash
```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 dinfos sur le packaging dapplications :** <https://yunohost.org/packaging_apps>
**Plus dinfos sur le packaging dapplications:** <https://yunohost.org/packaging_apps>

46
README_gl.md Normal file
View file

@ -0,0 +1,46 @@
<!--
NOTA: Este README foi creado automáticamente por <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
NON debe editarse manualmente.
-->
# Archivist para YunoHost
[![Nivel de integración](https://dash.yunohost.org/integration/archivist.svg)](https://dash.yunohost.org/appci/app/archivist) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/archivist.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/archivist.maintain.svg)
[![Instalar Archivist con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=archivist)
*[Le este README en outros idiomas.](./ALL_README.md)*
> *Este paquete permíteche instalar Archivist de xeito rápido e doado nun servidor YunoHost.*
> *Se non usas YunoHost, le a [documentación](https://yunohost.org/install) para saber como instalalo.*
## Vista xeral
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.
**Versión proporcionada:** 1.3.4~ynh2
## Documentación e recursos
- Repositorio de orixe do código: <https://github.com/maniackcrudelis/archivist>
- Tenda YunoHost: <https://apps.yunohost.org/app/archivist>
- Informar dun problema: <https://github.com/YunoHost-Apps/archivist_ynh/issues>
## Info de desenvolvemento
Envía a túa colaboración á [rama `testing`](https://github.com/YunoHost-Apps/archivist_ynh/tree/testing).
Para probar a rama `testing`, procede deste xeito:
```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
```
**Máis info sobre o empaquetado da app:** <https://yunohost.org/packaging_apps>

46
README_it.md Normal file
View file

@ -0,0 +1,46 @@
<!--
N.B.: Questo README è stato automaticamente generato da <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
NON DEVE essere modificato manualmente.
-->
# Archivist per YunoHost
[![Livello di integrazione](https://dash.yunohost.org/integration/archivist.svg)](https://dash.yunohost.org/appci/app/archivist) ![Stato di funzionamento](https://ci-apps.yunohost.org/ci/badges/archivist.status.svg) ![Stato di manutenzione](https://ci-apps.yunohost.org/ci/badges/archivist.maintain.svg)
[![Installa Archivist con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=archivist)
*[Leggi questo README in altre lingue.](./ALL_README.md)*
> *Questo pacchetto ti permette di installare Archivist su un server YunoHost in modo semplice e veloce.*
> *Se non hai YunoHost, consulta [la guida](https://yunohost.org/install) per imparare a installarlo.*
## Panoramica
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.
**Versione pubblicata:** 1.3.4~ynh2
## Documentazione e risorse
- Repository upstream del codice dellapp: <https://github.com/maniackcrudelis/archivist>
- Store di YunoHost: <https://apps.yunohost.org/app/archivist>
- Segnala un problema: <https://github.com/YunoHost-Apps/archivist_ynh/issues>
## Informazioni per sviluppatori
Si prega di inviare la tua pull request alla [branch di `testing`](https://github.com/YunoHost-Apps/archivist_ynh/tree/testing).
Per provare la branch di `testing`, si prega di procedere in questo modo:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/archivist_ynh/tree/testing --debug
o
sudo yunohost app upgrade archivist -u https://github.com/YunoHost-Apps/archivist_ynh/tree/testing --debug
```
**Maggiori informazioni riguardo il pacchetto di questapp:** <https://yunohost.org/packaging_apps>

46
README_zh_Hans.md Normal file
View file

@ -0,0 +1,46 @@
<!--
注意:此 README 由 <https://github.com/YunoHost/apps/tree/master/tools/readme_generator> 自动生成
请勿手动编辑。
-->
# YunoHost 的 Archivist
[![集成程度](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)
[![使用 YunoHost 安装 Archivist](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=archivist)
*[阅读此 README 的其它语言版本。](./ALL_README.md)*
> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 Archivist。*
> *如果您还没有 YunoHost请参阅[指南](https://yunohost.org/install)了解如何安装它。*
## 概况
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.
**分发版本:** 1.3.4~ynh2
## 文档与资源
- 上游应用代码库: <https://github.com/maniackcrudelis/archivist>
- YunoHost 商店: <https://apps.yunohost.org/app/archivist>
- 报告 bug <https://github.com/YunoHost-Apps/archivist_ynh/issues>
## 开发者信息
请向 [`testing` 分支](https://github.com/YunoHost-Apps/archivist_ynh/tree/testing) 发送拉取请求。
如要尝试 `testing` 分支,请这样操作:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/archivist_ynh/tree/testing --debug
sudo yunohost app upgrade archivist -u https://github.com/YunoHost-Apps/archivist_ynh/tree/testing --debug
```
**有关应用打包的更多信息:** <https://yunohost.org/packaging_apps>

117
YEP.md
View file

@ -1,117 +0,0 @@
#### [Level 0](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-0)
[YEP 1.1 - Nommer son app et son dépot](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11)
`Validated`
[YEP 1.2 - Inscrire l'app sur un "répertoire" connu](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-12)
`Validated`
#### [Level 1](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-1)
[YEP 2.2 - Utiliser bash pour les scripts principaux](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-22)
`Validated`
[YEP 2.5 - Copier correctement des fichiers](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-25)
`Don't know`
[YEP 2.7 - Donner des permissions suffisantes aux instructions bash](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-27)
`Validated`
[YEP 2.15 - Suivre les instructions d'installation de l'application](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-215)
`Validated`
#### [Level 2](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-2)
[YEP 1.5 - Mettre à jour régulièrement le statut de l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11)
`Validated`
[YEP 2.18.2 - Gérer l'installation à la racine dun nom de domaine](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2182)
`Not applicable`
[YEP 2.18.3 - Gérer l'installation sur un sous-domaine](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2183)
`Not applicable`
[YEP 2.18.4 - Gérer l'installation sur un chemin /path](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2184)
`Not applicable`
[YEP 4.6 - Gère le multi-instance](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11)
`Validated` - *Automatically verified.*
#### [Level 3](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-3)
[YEP 2.3 - Sauvegarder les réponses lors de l'installation](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-23)
`Validated`
#### [Level 4](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-4)
[YEP 4.1 - Lier au ldap](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-41)
`Not applicable`
[YEP 4.2 - Lier l'authentification au sso](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-42)
`Not applicable`
#### [Level 5](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-5)
[YEP 1.3 - Indiquer la licence associée au paquet](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-13)
`Validated`
[YEP 2.1 - Respecter le format du manifeste](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-21)
`Validated` - *Automatically verified.*
[YEP 2.12 - Utiliser les commandes pratiques (helpers)](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-212)
`Validated`
[YEP 2.18.1 - Lancer le script d'installation d'une webapp correctement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2181)
`Not applicable`
#### [Level 6](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-6)
[YEP 1.4 - Informer sur l'intention de maintenir un paquet](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-14)
`Validated`
[YEP 1.6 - Se tenir informé sur l'évolution du packaging d'apps](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-16)
`Validated`
[YEP 1.7 - Ajouter l'app à l'organisation YunoHost-Apps](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-17)
`Validated` - *Automatically verified.*
[YEP 1.8 - Publier des demandes de test](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-18)
`Validated`
[YEP 1.9 - Documenter l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-19)
`Validated`
[YEP 1.10 - Garder un historique de version propre](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-110)
`Don't know`
[YEP 2.9 - Enlever toutes traces de l'app lors de la suppression](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-29)
`Validated`
[YEP 3.3 - Faciliter le contrôle de l'intégrité des sources](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-33)
`Validated`
[YEP 3.5 - Suivre les recommendations de la documentation de l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-35)
`Validated`
[YEP 3.6 - Mettre à jour les versions contenant des CVE](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-36)
`Validated`
[YEP 4.3 - Fournir un script de sauvegarde YunoHost fonctionnel](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-43)
`Validated` - *Automatically verified.*
[YEP 4.4 - Fournir un script de restauration YunoHost fonctionnel](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-44)
`Validated` - *Automatically verified.*
#### [Level 7](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-7)
[YEP 2.6 - Annuler l'action si les valeurs d'entrées sont incorrectes](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-26)
`Validated`
[YEP 3.2 - Ouvrir un port correctement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-32)
`Not applicable`
#### [Level 8](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-8)
[YEP 2.4 - Détecter et gérer les erreurs](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-24)
`Validated`
[YEP 2.8 - Modifier correctement une configuration système](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-28)
`Validated`
[YEP 2.16 - Vérifier la disponibilité des dépendances sur ARM, x86 et x64](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-216)
`Not yet validated` - *Automatically verified.*
[YEP 2.18.5 - Gérer la tuile YunoHost pour faciliter la navigation entre les applications](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2185)
`Not applicable`
[YEP 3.4 - Isoler l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-34)
`Validated`
[YEP 4.5 - Utiliser les hooks](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-45)
`Not applicable`
#### [Level 9](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-9)
[YEP 2.10 - Configurer les logs de l'application](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-210)
`Validated`
[YEP 2.11 - Utiliser une variable plutôt que l'app id directement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-211)
`Validated`
[YEP 2.13 - Traduire le paquet en anglais](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-213)
`Not yet validated`
[YEP 2.14 - Remplir correctement un fichier de conf](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-214)
`Not yet validated`
[YEP 2.17 - Prendre en compte la version d'origine lors des mises à jour](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-217)
`Validated`
[YEP 4.2.1 - Déconnexion](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-421)
`Not applicable`
#### Other YEP
[YEP 3.1 - Ne pas demander ou stocker de mot de passe LDAP](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-31)
`Validated`
[YEP 4.7 - Ajouter un module à la CLI](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-47)
`Not applicable`
[YEP 4.8 - Ajouter un module à l'admin web](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-48)
`Not applicable`
State of each YEP can be one of these: `Validated`, `Partially validated`, `Not yet validated`, `Not applicable`, `Don't know`.

View file

@ -1,35 +0,0 @@
[force_backup]
name = "Create a new backup"
command = "/bin/bash scripts/actions/force_backup"
# user = "root" # optional
# cwd = "/" # optional
# accepted_return_codes = [0, 1, 2, 3] # optional
accepted_return_codes = [0]
description = "Run Archivist to create a new backup."
[clean_backups]
name = "Clean all previous backup files"
command = "/bin/bash scripts/actions/clean_backups"
# user = "root" # optional
# cwd = "/" # optional
# accepted_return_codes = [0, 1, 2, 3] # optional
accepted_return_codes = [0]
description = "Remove all previous backup files made by Archivist."
[reset_default_config]
name = "Reset the config file and restore a default one."
command = "/bin/bash scripts/actions/reset_default_config \"Backup_list.conf\""
# user = "root" # optional
# cwd = "/" # optional
# accepted_return_codes = [0, 1, 2, 3] # optional
accepted_return_codes = [0]
description = "Reset the config file Backup_list.conf."
[reset_default_app]
name = "Reset the app with a default configuration."
command = "/bin/bash scripts/actions/reset_default_app"
# user = "root" # optional
# cwd = "/" # optional
# accepted_return_codes = [0, 1, 2, 3] # optional
accepted_return_codes = [0]
description = "Reset the app to its default configuration to try to fix potential issues.<br>This action won't remove any data added to the app.<br>However, if you have modified any configuration, it will be overwritten."

View file

@ -1,28 +0,0 @@
;; Test complet
; Manifest
encrypt=true
encryption_pwd="password"
core_backup=true
apps_backup=true
frequency="Weekly"
; Checks
pkg_linter=1
setup_sub_dir=0
setup_root=0
setup_nourl=1
setup_private=0
setup_public=0
upgrade=1
#upgrade=1 from_commit=2b2793737d5e1374659cbb74838d10162a2147e6
backup_restore=1
multi_instance=1
port_already_use=0
change_url=0
config_panel=0
;;; Options
Email=
Notification=change
;;; Upgrade options
; #commit=2b2793737d5e1374659cbb74838d10162a2147e6
#name=03 Nov 2017 2b2793737d5e1374659cbb74838d10162a2147e6
manifest_arg=encrypt=1&encryption_pwd="password"&core_backup=1&apps_backup=1&frequency="Weekly"&

View file

@ -1,5 +0,0 @@
SOURCE_URL=https://github.com/maniackcrudelis/archivist/archive/refs/tags/v1.3.4.tar.gz
SOURCE_SUM=97df967d79ee2acd0bfae929a9feccea4df0f5943f14101a20a066470142fe89
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true

1
conf/archivist.cron Normal file
View file

@ -0,0 +1 @@
__FREQUENCY_CRON__ root nice -n10 __INSTALL_DIR__/archivist.sh | tee -a /var/log/__APP__/__APP__.log 2>&1

View file

@ -1 +0,0 @@
__FREQUENCY__ root nice -n10 __FINALPATH__/archivist.sh | tee -a /var/log/__APP__/__APP__.log 2>&1

View file

@ -7,4 +7,3 @@ Please read the [documentation](https://github.com/maniackcrudelis/archivist/blo
* 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/POST_INSTALL.md Normal file
View file

@ -0,0 +1,10 @@
If encryption is enabled, your password for encryption is '__ENCRYPTION_PWD__'
Archivist is going to run __FREQUENCY_HUMAN__.
If you want to change the frequency, have a look to the file `/etc/cron.d/__APP__`.
To add recipients or to modify the files or apps to backup,please have a look to the config file `__INSTALL_DIR__/Backup_list.conf`.
Please read the [documentation](https://github.com/maniackcrudelis/archivist/blob/master/Configuration.md) about the configuration of archivist for more information.

View file

@ -1,83 +0,0 @@
{
"name": "Archivist",
"id": "archivist",
"packaging_format": 1,
"description": {
"en": "Automatic backups",
"fr": "Sauvegardes automatiques"
},
"version": "1.3.4~ynh1",
"url": "https://github.com/maniackcrudelis/archivist",
"upstream": {
"license": "GPL-3.0",
"code": "https://github.com/maniackcrudelis/archivist"
},
"license": "GPL-3.0",
"maintainer": {
"name": "",
"email": ""
},
"previous_maintainers": [{
"name": "Maniack Crudelis",
"email": "maniackc_dev@crudelis.fr"
}],
"requirements": {
"yunohost": ">= 11.2.9"
},
"multi_instance": true,
"services": [],
"arguments": {
"install": [
{
"name": "encrypt",
"type": "boolean",
"ask": {
"en": "Do you want to encrypt your backups?",
"fr": "Voulez-vous chiffrer vos sauvegardes ?"
},
"default": true
},
{
"name": "encryption_pwd",
"type": "password",
"ask": {
"en": "Set the password for encryption.",
"fr": "Définissez le mot de passe de chiffrement."
},
"help": {
"en": "It's needed if you use backup encryption.",
"fr": "C'est nécessaire si vous utilisez le chiffrement."
},
"optional": true
},
{
"name": "core_backup",
"type": "boolean",
"ask": {
"en": "Would you like to backup your YunoHost core?",
"fr": "Souhaitez-vous effectuer des sauvegardes du système YunoHost ?"
},
"default": true
},
{
"name": "apps_backup",
"type": "boolean",
"ask": {
"en": "Would you like to backup your apps?",
"fr": "Souhaitez-vous effectuer des sauvegardes de vos applications ?"
},
"default": true
},
{
"name": "frequency",
"type": "select",
"ask": {
"en": "Choose the frequency of your backups?",
"fr": "Choississez la fréquence de votre backup ?"
},
"choices" : ["Daily", "Each 3 days", "Weekly", "Biweekly", "Monthly"],
"default" : "Weekly"
}
]
}
}

91
manifest.toml Normal file
View file

@ -0,0 +1,91 @@
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json
packaging_format = 2
id = "archivist"
name = "Archivist"
description.en = "Automatic backups"
description.fr = "Sauvegardes automatiques"
version = "1.3.4~ynh2"
maintainers = []
[upstream]
license = "GPL-3.0"
code = "https://github.com/maniackcrudelis/archivist"
[integration]
yunohost = ">= 11.2.9"
architectures = "all"
multi_instance = true
ldap = "not_relevant"
sso = "not_relevant"
disk = "50M"
ram.build = "100M"
ram.runtime = "100M"
[install]
[install.encrypt]
ask.en = "Do you want to encrypt your backups?"
ask.fr = "Voulez-vous chiffrer vos sauvegardes ?"
type = "boolean"
default = true
[install.encryption_pwd]
ask.en = "Set the password for encryption."
ask.fr = "Définissez le mot de passe de chiffrement."
help.en = "It's needed if you use backup encryption."
help.fr = "C'est nécessaire si vous utilisez le chiffrement."
type = "password"
optional = true
[install.core_backup]
ask.en = "Would you like to backup your YunoHost core?"
ask.fr = "Souhaitez-vous effectuer des sauvegardes du système YunoHost ?"
type = "boolean"
default = true
[install.apps_backup]
ask.en = "Would you like to backup your apps?"
ask.fr = "Souhaitez-vous effectuer des sauvegardes de vos applications ?"
type = "boolean"
default = true
[install.frequency]
ask.en = "Choose the frequency of your backups?"
ask.fr = "Choississez la fréquence de votre backup ?"
type = "select"
choices.daily = "Daily"
choices.days_3 = "Each 3 days"
choices.weekly = "Weekly"
choices.weeks_2 = "Biweekly"
choices.monthly = "Monthly"
default = "weekly"
[resources]
[resources.sources.main]
url = "https://github.com/maniackcrudelis/archivist/archive/refs/tags/v1.3.4.tar.gz"
sha256 = "97df967d79ee2acd0bfae929a9feccea4df0f5943f14101a20a066470142fe89"
autoupdate.strategy = "latest_github_tag"
[resources.system_user]
[resources.install_dir]
[resources.data_dir]
subdirs = ["backup", "encrypted_backup"]
[resources.permissions]
[resources.apt]
packages = [
"rsync",
"encfs",
"sshpass",
"ccrypt",
"lzop",
"zstd",
"lzip",
]

View file

@ -4,371 +4,54 @@
# COMMON VARIABLES
#=================================================
# dependencies used by the app
pkg_dependencies="rsync encfs sshpass ccrypt lzop zstd lzip"
#=================================================
# PERSONAL HELPERS
#=================================================
_set_frequencies() {
case "$frequency" in
daily)
frequency_cron="0 2 * * *"
frequency_human="every day"
;;
days_3)
frequency_cron="0 2 */3 * *"
frequency_human="each 3 days"
;;
weekly)
frequency_cron="0 2 * * 0"
frequency_human="once a week on sunday"
;;
weeks_2)
frequency_cron="0 2 * * 0/2"
frequency_human="one sunday out of two"
;;
monthly)
frequency_cron="0 2 1 * *"
frequency_human="once a month on the first sunday"
;;
*)
ynh_die --message="Unsupported frequency $frequency" ;;
esac
# For POST_INSTALL.md
ynh_app_setting_set --app="$app" --key=frequency_human --value="$frequency_human"
}
_fix_frequencies() {
case "$frequency" in
Daily) frequency="daily" ; ynh_app_setting_set --app="$app" --key="frequency" --value="$frequency" ;;
"Each 3 days") frequency="days_3" ; ynh_app_setting_set --app="$app" --key="frequency" --value="$frequency" ;;
"Weekly") frequency="weekly" ; ynh_app_setting_set --app="$app" --key="frequency" --value="$frequency" ;;
"Biweekly") frequency="weeks_2" ; ynh_app_setting_set --app="$app" --key="frequency" --value="$frequency" ;;
"Monthly") frequency="monthly" ; ynh_app_setting_set --app="$app" --key="frequency" --value="$frequency" ;;
esac
}
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
# Send an email to inform the administrator
#
# usage: ynh_send_readme_to_admin --app_message=app_message [--recipients=recipients] [--type=type]
# | arg: -m --app_message= - The file with the content to send to the administrator.
# | arg: -r, --recipients= - The recipients of this email. Use spaces to separate multiples recipients. - default: root
# example: "root admin@domain"
# If you give the name of a YunoHost user, ynh_send_readme_to_admin will find its email adress for you
# example: "root admin@domain user1 user2"
# | arg: -t, --type= - Type of mail, could be 'backup', 'change_url', 'install', 'remove', 'restore', 'upgrade'
ynh_send_readme_to_admin() {
# Declare an array to define the options of this helper.
declare -Ar args_array=( [m]=app_message= [r]=recipients= [t]=type= )
local app_message
local recipients
local type
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
app_message="${app_message:-}"
recipients="${recipients:-root}"
type="${type:-install}"
# Get the value of admin_mail_html
admin_mail_html=$(ynh_app_setting_get $app admin_mail_html)
admin_mail_html="${admin_mail_html:-0}"
# Retrieve the email of users
find_mails () {
local list_mails="$1"
local mail
local recipients=" "
# Read each mail in argument
for mail in $list_mails
do
# Keep root or a real email address as it is
if [ "$mail" = "root" ] || echo "$mail" | grep --quiet "@"
then
recipients="$recipients $mail"
else
# But replace an user name without a domain after by its email
if mail=$(ynh_user_get_info "$mail" "mail" 2> /dev/null)
then
recipients="$recipients $mail"
fi
fi
done
echo "$recipients"
}
recipients=$(find_mails "$recipients")
# Subject base
local mail_subject="☁️🆈🅽🅷☁️: \`$app\`"
# Adapt the subject according to the type of mail required.
if [ "$type" = "backup" ]; then
mail_subject="$mail_subject has just been backup."
elif [ "$type" = "change_url" ]; then
mail_subject="$mail_subject has just been moved to a new URL!"
elif [ "$type" = "remove" ]; then
mail_subject="$mail_subject has just been removed!"
elif [ "$type" = "restore" ]; then
mail_subject="$mail_subject has just been restored!"
elif [ "$type" = "upgrade" ]; then
mail_subject="$mail_subject has just been upgraded!"
else # install
mail_subject="$mail_subject has just been installed!"
fi
local mail_message="This is an automated message from your beloved YunoHost server.
Specific information for the application $app.
$(if [ -n "$app_message" ]
then
cat "$app_message"
else
echo "...No specific information..."
fi)
---
Automatic diagnosis data from YunoHost
__PRE_TAG1__$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')__PRE_TAG2__"
# Store the message into a file for further modifications.
echo "$mail_message" > mail_to_send
# If a html email is required. Apply html tags to the message.
if [ "$admin_mail_html" -eq 1 ]
then
# Insert 'br' tags at each ending of lines.
ynh_replace_string "$" "<br>" mail_to_send
# Insert starting HTML tags
sed --in-place '1s@^@<!DOCTYPE html>\n<html>\n<head></head>\n<body>\n@' mail_to_send
# Keep tabulations
ynh_replace_string " " "\&#160;\&#160;" mail_to_send
ynh_replace_string "\t" "\&#160;\&#160;" mail_to_send
# Insert url links tags
ynh_replace_string "__URL_TAG1__\(.*\)__URL_TAG2__\(.*\)__URL_TAG3__" "<a href=\"\2\">\1</a>" mail_to_send
# Insert pre tags
ynh_replace_string "__PRE_TAG1__" "<pre>" mail_to_send
ynh_replace_string "__PRE_TAG2__" "<\pre>" mail_to_send
# Insert finishing HTML tags
echo -e "\n</body>\n</html>" >> mail_to_send
# Otherwise, remove tags to keep a plain text.
else
# Remove URL tags
ynh_replace_string "__URL_TAG[1,3]__" "" mail_to_send
ynh_replace_string "__URL_TAG2__" ": " mail_to_send
# Remove PRE tags
ynh_replace_string "__PRE_TAG[1-2]__" "" mail_to_send
fi
# Define binary to use for mail command
if [ -e /usr/bin/bsd-mailx ]
then
local mail_bin=/usr/bin/bsd-mailx
else
local mail_bin=/usr/bin/mail.mailutils
fi
if [ "$admin_mail_html" -eq 1 ]
then
content_type="text/html"
else
content_type="text/plain"
fi
# Send the email to the recipients
cat mail_to_send | $mail_bin -a "Content-Type: $content_type; charset=UTF-8" -s "$mail_subject" "$recipients"
}
#=================================================
ynh_maintenance_mode_ON () {
# Load value of $path_url and $domain from the config if their not set
if [ -z $path_url ]; then
path_url=$(ynh_app_setting_get $app path)
fi
if [ -z $domain ]; then
domain=$(ynh_app_setting_get $app domain)
fi
mkdir -p /var/www/html/
# Create an html to serve as maintenance notice
echo "<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="3">
<title>Your app $app is currently under maintenance!</title>
<style>
body {
width: 70em;
margin: 0 auto;
}
</style>
</head>
<body>
<h1>Your app $app is currently under maintenance!</h1>
<p>This app has been put under maintenance by your administrator at $(date)</p>
<p>Please wait until the maintenance operation is done. This page will be reloaded as soon as your app will be back.</p>
</body>
</html>" > "/var/www/html/maintenance.$app.html"
# Create a new nginx config file to redirect all access to the app to the maintenance notice instead.
echo "# All request to the app will be redirected to ${path_url}_maintenance and fall on the maintenance notice
rewrite ^${path_url}/(.*)$ ${path_url}_maintenance/? redirect;
# Use another location, to not be in conflict with the original config file
location ${path_url}_maintenance/ {
alias /var/www/html/ ;
try_files maintenance.$app.html =503;
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
}" > "/etc/nginx/conf.d/$domain.d/maintenance.$app.conf"
# The current config file will redirect all requests to the root of the app.
# To keep the full path, we can use the following rewrite rule:
# rewrite ^${path_url}/(.*)$ ${path_url}_maintenance/\$1? redirect;
# The difference will be in the $1 at the end, which keep the following queries.
# But, if it works perfectly for a html request, there's an issue with any php files.
# This files are treated as simple files, and will be downloaded by the browser.
# Would be really be nice to be able to fix that issue. So that, when the page is reloaded after the maintenance, the user will be redirected to the real page he was.
systemctl reload nginx
}
ynh_maintenance_mode_OFF () {
# Load value of $path_url and $domain from the config if their not set
if [ -z $path_url ]; then
path_url=$(ynh_app_setting_get $app path)
fi
if [ -z $domain ]; then
domain=$(ynh_app_setting_get $app domain)
fi
# Rewrite the nginx config file to redirect from ${path_url}_maintenance to the real url of the app.
echo "rewrite ^${path_url}_maintenance/(.*)$ ${path_url}/\$1 redirect;" > "/etc/nginx/conf.d/$domain.d/maintenance.$app.conf"
systemctl reload nginx
# Sleep 4 seconds to let the browser reload the pages and redirect the user to the app.
sleep 4
# Then remove the temporary files used for the maintenance.
rm "/var/www/html/maintenance.$app.html"
rm "/etc/nginx/conf.d/$domain.d/maintenance.$app.conf"
systemctl reload nginx
}
# FUTURE OFFICIAL HELPERS
#=================================================
# Create a changelog for an app after an upgrade from the file CHANGELOG.md.
#
# usage: ynh_app_changelog [--format=markdown/html/plain] [--output=changelog_file] --changelog=changelog_source]
# | arg: -f --format= - Format in which the changelog will be printed
# markdown: Default format.
# html: Turn urls into html format.
# plain: Plain text changelog
# | arg: -o --output= - Output file for the changelog file (Default ./changelog)
# | arg: -c --changelog= - CHANGELOG.md source (Default ../CHANGELOG.md)
#
# The changelog is printed into the file ./changelog and ./changelog_lite
ynh_app_changelog () {
# Declare an array to define the options of this helper.
local legacy_args=foc
declare -Ar args_array=( [f]=format= [o]=output= [c]=changelog= )
local format
local output
local changelog
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
format=${format:-markdown}
output=${output:-changelog}
changelog=${changelog:-../CHANGELOG.md}
local original_changelog="$changelog"
local temp_changelog="changelog_temp"
local final_changelog="$output"
if [ ! -n "$original_changelog" ]
then
echo "No changelog available..." > "$final_changelog"
echo "No changelog available..." > "${final_changelog}_lite"
return 0
fi
local current_version=$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version")
local update_version=$(ynh_read_manifest --manifest="../manifest.json" --manifest_key="version")
# Get the line of the version to update to into the changelog
local update_version_line=$(grep --max-count=1 --line-number "^## \[$update_version" "$original_changelog" | cut -d':' -f1)
# If there's no entry for this version yet into the changelog
# Get the first available version
if [ -z "$update_version_line" ]
then
update_version_line=$(grep --max-count=1 --line-number "^##" "$original_changelog" | cut -d':' -f1)
fi
# Get the length of the complete changelog.
local changelog_length=$(wc --lines "$original_changelog" | awk '{print $1}')
# Cut the file before the version to update to.
tail --lines=$(( $changelog_length - $update_version_line + 1 )) "$original_changelog" > "$temp_changelog"
# Get the length of the troncated changelog.
changelog_length=$(wc --lines "$temp_changelog" | awk '{print $1}')
# Get the line of the current version into the changelog
# Keep only the last line found
local current_version_line=$(grep --line-number "^## \[$current_version" "$temp_changelog" | cut -d':' -f1 | tail --lines=1)
# If there's no entry for this version into the changelog
# Get the last available version
if [ -z "$current_version_line" ]
then
current_version_line=$(grep --line-number "^##" "$original_changelog" | cut -d':' -f1 | tail --lines=1)
fi
# Cut the file before the current version.
# Then grep the previous version into the changelog to get the line number of the previous version
local previous_version_line=$(tail --lines=$(( $changelog_length - $current_version_line )) \
"$temp_changelog" | grep --max-count=1 --line-number "^## " | cut -d':' -f1)
# If there's no previous version into the changelog
# Go until the end of the changelog
if [ -z "$previous_version_line" ]
then
previous_version_line=$changelog_length
fi
# Cut the file after the previous version to keep only the changelog between the current version and the version to update to.
head --lines=$(( $current_version_line + $previous_version_line - 1 )) "$temp_changelog" | tee "$final_changelog"
if [ "$format" = "html" ]
then
# Replace markdown links by html links
ynh_replace_string --match_string="\[\(.*\)\](\(.*\)))" --replace_string="<a href=\"\2\">\1</a>)" --target_file="$final_changelog"
ynh_replace_string --match_string="\[\(.*\)\](\(.*\))" --replace_string="<a href=\"\2\">\1</a>" --target_file="$final_changelog"
elif [ "$format" = "plain" ]
then
# Change title format.
ynh_replace_string --match_string="^##.*\[\(.*\)\](\(.*\)) - \(.*\)$" --replace_string="## \1 (\3) - \2" --target_file="$final_changelog"
# Change modifications lines format.
ynh_replace_string --match_string="^\([-*]\).*\[\(.*\)\]\(.*\)" --replace_string="\1 \2 \3" --target_file="$final_changelog"
fi
# else markdown. As the file is already in markdown, nothing to do.
# Keep only important changes into the changelog
# Remove all minor changes
sed '/^-/d' "$final_changelog" > "${final_changelog}_lite"
# Remove all blank lines (to keep a clear workspace)
sed --in-place '/^$/d' "${final_changelog}_lite"
# Add a blank line at the end
echo "" >> "${final_changelog}_lite"
# Clean titles if there's no significative changes
local line
local previous_line=""
while read line <&3
do
if [ -n "$previous_line" ]
then
# Remove the line if it's a title or a blank line, and the previous one was a title as well.
if ( [ "${line:0:1}" = "#" ] || [ ${#line} -eq 0 ] ) && [ "${previous_line:0:1}" = "#" ]
then
ynh_replace_special_string --match_string="${previous_line//[/.}" --replace_string="" --target_file="${final_changelog}_lite"
fi
fi
previous_line="$line"
done 3< "${final_changelog}_lite"
# Remove all blank lines again
sed --in-place '/^$/d' "${final_changelog}_lite"
# Restore changelog format with blank lines
ynh_replace_string --match_string="^##.*" --replace_string="\n\n&\n" --target_file="${final_changelog}_lite"
# Remove the 2 first blank lines
sed --in-place '1,2d' "${final_changelog}_lite"
# Add a blank line at the end
echo "" >> "${final_changelog}_lite"
# If changelog are empty, add an info
if [ $(wc --words "$final_changelog" | awk '{print $1}') -eq 0 ]
then
echo "No changes from the changelog..." > "$final_changelog"
fi
if [ $(wc --words "${final_changelog}_lite" | awk '{print $1}') -eq 0 ]
then
echo "No significative changes from the changelog..." > "${final_changelog}_lite"
fi
}

View file

@ -1,58 +0,0 @@
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
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
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# CHECK IF ARGUMENTS ARE CORRECT
#=================================================
#=================================================
# CHECK IF AN ACTION HAS TO BE DONE
#=================================================
#=================================================
# SPECIFIC ACTION
#=================================================
# CLEAN ALL BACKUP FILES
#=================================================
ynh_script_progression --message="Cleaning all backup files..." --weight=9
# Get the backup directory from the config file
backup_dir="$(grep "^backup_dir=" "$final_path/Backup_list.conf" | cut -d= -f2)"
while read directory <&3
do
if [ -n "$directory" ]
then
ynh_print_info --message="Clean backup directory $directory"
ynh_secure_remove --file="$directory"
fi
done 3<<< $(find "$backup_dir" -maxdepth 1 -mindepth 1 -type d)
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Execution completed" --last

View file

@ -1,48 +0,0 @@
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
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
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# CHECK IF ARGUMENTS ARE CORRECT
#=================================================
#=================================================
# CHECK IF AN ACTION HAS TO BE DONE
#=================================================
#=================================================
# SPECIFIC ACTION
#=================================================
# FORCE A NEW BACKUP
#=================================================
ynh_script_progression --message="Forcing a new backup..." --weight=9
ynh_exec_warn nice -n10 $final_path/archivist.sh
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Execution completed" --last

View file

@ -1,107 +0,0 @@
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# Load common variables for all scripts.
source scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
# Clean installation remaining that are not handle by the remove script.
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
frequency="$(ynh_app_setting_get --app=$app --key=frequency)"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Resetting source files..." --time --weight=1
# Download, check integrity, uncompress and patch the source from app.src
(cd scripts; YNH_CWD=$PWD ynh_setup_source --dest_dir="$final_path")
#=================================================
# RECREATE DIRECTORY
#=================================================
backup_dir="/home/yunohost.app/${app}/backup"
mkdir -p "$backup_dir"
#=================================================
# UPDATE THE CRON FILE
#=================================================
ynh_script_progression --message="Updating the cron file..."
# Verify the checksum and backup the file if it's different
ynh_backup_if_checksum_is_different --file="/etc/cron.d/$app"
(cd scripts; cp ../conf/cron /etc/cron.d/$app)
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file=/etc/cron.d/$app
ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file=/etc/cron.d/$app
if [ "$frequency" = "Daily" ]; then
cron_freq="0 2 * * *"
run_freq="every day"
elif [ "$frequency" = "Each 3 days" ]; then
cron_freq="0 2 */3 * *"
run_freq="each 3 days"
elif [ "$frequency" = "Weekly" ]; then
cron_freq="0 2 * * 0"
run_freq="once a week on sunday"
elif [ "$frequency" = "Biweekly" ]; then
cron_freq="0 2 * * 0/2"
run_freq="one sunday out of two"
else # Monthly
cron_freq="0 2 1 * *"
run_freq="once a month on the first sunday"
fi
ynh_replace_string --match_string="__FREQUENCY__" --replace_string="$cron_freq" --target_file=/etc/cron.d/$app
# Recalculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="/etc/cron.d/$app"
#=================================================
# RECONFIGURE ARCHIVIST
#=================================================
ynh_script_progression --message="Reconfiguring archivist..." --time --weight=1
yunohost app action run $app reset_default_config
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Resetting logrotate configuration..." --time --weight=1
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
# Set permissions on app files
chown -R root: $final_path
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Execution completed" --time --last

View file

@ -1,97 +0,0 @@
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
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
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)
apps_backup=$(ynh_app_setting_get --app=$app --key=apps_backup)
#=================================================
# SORT OUT THE CONFIG FILE TO HANDLE
#=================================================
file="$1"
if [ "$file" = "Backup_list.conf" ]; then
config_file="$final_path/Backup_list.conf"
fi
#=================================================
# SPECIFIC ACTION
#=================================================
# RESET THE CONFIG FILE
#=================================================
ynh_script_progression --message="Reseting the config file $file"
# Verify the checksum and backup the file if it's different
ynh_backup_if_checksum_is_different --file="$config_file"
if [ "$file" = "Backup_list.conf" ]
then
# Get the default file and overwrite the current config
cp "$final_path/Backup_list.conf.default" "$config_file"
# Recreate the default config
backup_dir="/home/yunohost.app/${app}/backup"
enc_backup_dir="/home/yunohost.app/${app}/encrypted_backup"
ynh_replace_string --match_string="^backup_dir=.*" --replace_string="backup_dir=$backup_dir" --target_file="$config_file"
ynh_replace_string --match_string="^enc_backup_dir=.*" --replace_string="enc_backup_dir=$enc_backup_dir" --target_file="$config_file"
if [ $encrypt -eq 1 ]
then
encrypt=true
passkey="$final_path/passkey"
else
encrypt=false
passkey=na
fi
ynh_replace_string --match_string="^encrypt=.*" --replace_string="encrypt=$encrypt" --target_file="$config_file"
ynh_replace_string --match_string="^cryptpass=.*" --replace_string="cryptpass=$passkey" --target_file="$config_file"
if [ $core_backup -eq 1 ]
then
core_backup=true
else
core_backup=false
fi
ynh_replace_string --match_string="^ynh_core_backup=.*" --replace_string="ynh_core_backup=$core_backup" --target_file="$config_file"
if [ $apps_backup -eq 1 ]
then
# Add all current applications to the backup
while read backup_app
do
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: //')"
fi
fi
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$config_file"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Execution completed" --last

View file

@ -1,7 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
@ -10,22 +8,6 @@
source ../settings/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
#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
@ -35,21 +17,21 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP THE APP MAIN DIR
#=================================================
ynh_backup --src_path="$final_path"
ynh_backup --src_path="$install_dir"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
# BACKUP SYSTEM
#=================================================
ynh_backup --src_path="/etc/logrotate.d/$app"
ynh_backup --src_path="/etc/cron.d/$app"
#=================================================
# BACKUP VARIOUS FILES
#=================================================
ynh_backup --src_path="/etc/cron.d/$app"
ynh_backup --src_path="/var/log/$app/"
#=================================================
# END OF SCRIPT

View file

@ -1,7 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
@ -10,120 +8,67 @@ source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
# INITIALIZE AND STORE SETTINGS
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
encrypt=$YNH_APP_ARG_ENCRYPT
encryption_pwd=$YNH_APP_ARG_ENCRYPTION_PWD
core_backup=$YNH_APP_ARG_CORE_BACKUP
apps_backup=$YNH_APP_ARG_APPS_BACKUP
frequency="$YNH_APP_ARG_FREQUENCY"
app=$YNH_APP_INSTANCE_NAME
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
ynh_script_progression --message="Validating installation parameters..."
final_path=/opt/yunohost/$app
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
if [ $encrypt -eq 1 ]; then
test -n "$encryption_pwd" || ynh_die --message="encryption_pwd can't be empty if you choose to enable encryption."
if [ "$encrypt" -eq 1 ] && [ -z "$encryption_pwd" ]; then
ynh_die --message="encryption_pwd can't be empty if you choose to enable encryption."
fi
# Not saved as settings by default
ynh_app_setting_set --app="$app" --key="encryption_pwd" --value="$encryption_pwd"
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_script_progression --message="Storing installation settings..." --weight=3
_set_frequencies
ynh_app_setting_set --app=$app --key=frequency --value="$frequency"
ynh_app_setting_set --app=$app --key=encrypt --value="$encrypt"
ynh_app_setting_set --app=$app --key=core_backup --value="$core_backup"
ynh_app_setting_set --app=$app --key=apps_backup --value="$apps_backup"
ynh_app_setting_set --app=$app --key=overwrite_cron --value=1
ynh_app_setting_set --app=$app --key=admin_mail_html --value=1
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing dependencies..." --weight=15
# Valid the fucking debconf message
# 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 $pkg_dependencies
ynh_app_setting_set --app="$app" --key=overwrite_cron --value=1
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=3
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
ynh_setup_source --dest_dir="$install_dir"
#=================================================
# SPECIFIC SETUP
#=================================================
# CREATE THE BACKUP DIRECTORY
#=================================================
chown -R "root:root" "$install_dir"
backup_dir="/home/yunohost.app/${app}/backup"
enc_backup_dir="/home/yunohost.app/${app}/encrypted_backup"
mkdir -p "$backup_dir"
chown -R "root:root" "$data_dir"
#=================================================
# CONFIGURE ARCHIVIST
#=================================================
ynh_script_progression --message="Configuring Archivist..." --weight=2
config_file="$final_path/Backup_list.conf"
cp "$final_path/Backup_list.conf.default" "$config_file"
ynh_replace_string --match_string="^backup_dir=.*" --replace_string="backup_dir=$backup_dir" --target_file="$config_file"
ynh_replace_string --match_string="^enc_backup_dir=.*" --replace_string="enc_backup_dir=$enc_backup_dir" --target_file="$config_file"
if [ $encrypt -eq 1 ]
then
if [ "$encrypt" -eq 1 ]; then
encrypt=true
passkey="$final_path/passkey"
passkey="$install_dir/passkey"
echo "$encryption_pwd" > "$passkey"
chmod 400 "$passkey"
else
encrypt=false
passkey=na
fi
ynh_replace_string --match_string="^encrypt=.*" --replace_string="encrypt=$encrypt" --target_file="$config_file"
ynh_replace_string --match_string="^cryptpass=.*" --replace_string="cryptpass=$passkey" --target_file="$config_file"
if [ $core_backup -eq 1 ]
then
if [ "$core_backup" -eq 1 ]; then
core_backup=true
else
core_backup=false
fi
ynh_replace_string --match_string="^ynh_core_backup=.*" --replace_string="ynh_core_backup=$core_backup" --target_file="$config_file"
if [ $apps_backup -eq 1 ]
then
config_file="$install_dir/Backup_list.conf"
cp "$install_dir/Backup_list.conf.default" "$config_file"
ynh_replace_string --target_file="$config_file" --match_string="^backup_dir=.*" --replace_string="backup_dir=$data_dir/backup"
ynh_replace_string --target_file="$config_file" --match_string="^enc_backup_dir=.*" --replace_string="enc_backup_dir=$data_dir/encrypted_backup"
ynh_replace_string --target_file="$config_file" --match_string="^encrypt=.*" --replace_string="encrypt=$encrypt"
ynh_replace_string --target_file="$config_file" --match_string="^cryptpass=.*" --replace_string="cryptpass=$passkey"
ynh_replace_string --target_file="$config_file" --match_string="^ynh_core_backup=.*" --replace_string="ynh_core_backup=$core_backup"
if [ $apps_backup -eq 1 ]; then
# Add all current applications to the backup
while read backup_app
do
ynh_replace_string --match_string="^ynh_app_backup=$" --replace_string="ynh_app_backup=$backup_app\n&" --target_file="$config_file"
while read -r backup_app; do
ynh_replace_string --target_file="$config_file" --match_string="^ynh_app_backup=$" --replace_string="ynh_app_backup=$backup_app\n&"
done <<< "$(yunohost app list | grep 'id:' | sed 's/.*id: //')"
fi
@ -131,84 +76,15 @@ fi
ynh_store_file_checksum --file="$config_file"
#=================================================
# SET THE CRON FILE
# SYSTEM CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring the cron file..."
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
cp ../conf/cron /etc/cron.d/$app
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file=/etc/cron.d/$app
ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file=/etc/cron.d/$app
if [ "$frequency" = "Daily" ]; then
cron_freq="0 2 * * *"
run_freq="every day"
elif [ "$frequency" = "Each 3 days" ]; then
cron_freq="0 2 */3 * *"
run_freq="each 3 days"
elif [ "$frequency" = "Weekly" ]; then
cron_freq="0 2 * * 0"
run_freq="once a week on sunday"
elif [ "$frequency" = "Biweekly" ]; then
cron_freq="0 2 * * 0/2"
run_freq="one sunday out of two"
else # Monthly
cron_freq="0 2 1 * *"
run_freq="once a month on the first sunday"
fi
ynh_replace_string --match_string="__FREQUENCY__" --replace_string="$cron_freq" --target_file=/etc/cron.d/$app
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="/etc/cron.d/$app"
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
# Set permissions to app files
chown -R root: $final_path
#=================================================
# GENERIC FINALIZATION
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Configuring log rotation..."
mkdir -p /var/log/$app
# Use logrotate to manage application logfile(s)
ynh_use_logrotate
#=================================================
# PRINT INFORMATION
#=================================================
Informations="To add recipients or to modify the files or apps to backup,please have a look to the config file $config_file"
ynh_print_info --message="$Informations"
#=================================================
# SEND A README FOR THE ADMIN
#=================================================
if [ "$encrypt" = "true" ]
then
encrypt_message="Your password for encryption is '$encryption_pwd'"
else
encrypt_message=""
fi
# Get main domain and buid the url of the admin panel of the app.
admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
echo "${encrypt_message}Archivist is going to run $run_freq.
If you want to change the frequency, have a look to the file /etc/cron.d/$app.
$Informations
Please read the __URL_TAG1__documentation__URL_TAG2__https://github.com/maniackcrudelis/archivist/blob/master/Configuration.md__URL_TAG3__ about the configuration of archivist for more information.
You can configure this app easily by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__.
You can also find some specific actions for this app by using the experimental __URL_TAG1__action feature__URL_TAG2__$admin_panel/actions__URL_TAG3__.
If you're facing an issue or want to improve this app, please open a new issue in this __URL_TAG1__project__URL_TAG2__https://github.com/YunoHost-Apps/archivist_ynh__URL_TAG3__." > mail_to_send
ynh_send_readme_to_admin --app_message="mail_to_send" --recipients="root" --type=install
# Add Cron configuration file
ynh_add_config --template="archivist.cron" --destination="/etc/cron.d/$app"
#=================================================
# END OF SCRIPT

View file

@ -1,7 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
@ -10,54 +8,17 @@ source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
# REMOVE SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression --message="Loading installation settings..." --weight=2
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing logrotate configuration..."
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_script_progression --message="Removing app main directory..."
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=7
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE VARIOUS FILES
#=================================================
ynh_script_progression --message="Removing various files..."
# Remove a cron file
ynh_secure_remove --file="/etc/cron.d/$app"
ynh_script_progression --message="Removing backup directory..." --weight=5
# Remove the backup directory
ynh_secure_remove --file="/home/yunohost.app/$app/backup"
ynh_secure_remove --file="/var/log/$app"
#=================================================
# END OF SCRIPT

View file

@ -1,7 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
@ -10,87 +8,38 @@
source ../settings/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
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
#=================================================
ynh_script_progression --message="Validating restoration parameters..."
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring the app main directory..."
ynh_script_progression --message="Restoring the app main directory..." --weight=1
ynh_restore_file --origin_path="$final_path"
ynh_restore_file --origin_path="$install_dir"
chown -R "root:root" "$install_dir"
#=================================================
# SPECIFIC RESTORATION
# RESTORE THE DATA DIRECTORY
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=17
ynh_script_progression --message="Restoring the data directory..." --weight=1
# Valid the fucking debconf message
# 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 $pkg_dependencies
ynh_restore_file --origin_path="$data_dir" --not_mandatory
chown -R "root:root" "$data_dir"
#=================================================
# RESTORE SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
ynh_restore_file --origin_path="/etc/cron.d/$app"
#=================================================
# 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"
#=================================================
# SEND A README FOR THE ADMIN
#=================================================
# Get main domain and buid the url of the admin panel of the app.
admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
echo "If you want to change the frequency of Archivist, have a look to the file /etc/cron.d/$app.
The configuration file of Archivist has been restored at $final_path/Backup_list.conf
Please read the __URL_TAG1__documentation__URL_TAG2__https://github.com/maniackcrudelis/archivist/blob/master/Configuration.md__URL_TAG3__ about the configuration of archivist for more information.
You can configure this app easily by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__.
You can also find some specific actions for this app by using the experimental __URL_TAG1__action feature__URL_TAG2__$admin_panel/actions__URL_TAG3__.
If you're facing an issue or want to improve this app, please open a new issue in this __URL_TAG1__project__URL_TAG2__https://github.com/YunoHost-Apps/archivist_ynh__URL_TAG3__." > mail_to_send
ynh_send_readme_to_admin --app_message="mail_to_send" --recipients="root" --type=restore
ynh_restore_file --origin_path="/var/log/$app/"
#=================================================
# END OF SCRIPT

View file

@ -1,7 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
@ -9,184 +7,76 @@
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..." --weight=3
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
frequency="$(ynh_app_setting_get --app=$app --key=frequency)"
encrypt=$(ynh_app_setting_get --app=$app --key=encrypt)
core_backup=$(ynh_app_setting_get --app=$app --key=core_backup)
apps_backup=$(ynh_app_setting_get --app=$app --key=apps_backup)
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)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=2
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# 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
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
_fix_frequencies
_set_frequencies
# If encrypt doesn't exist, create it
if [ -z "$encrypt" ]; then
encrypt="$(grep "^encrypt=" "$final_path/Backup_list.conf" | cut -d= -f2)"
if [ -z "${encrypt:-}" ]; then
encrypt="$(grep "^encrypt=" "$install_dir/Backup_list.conf" | cut -d= -f2)"
if [ "$encrypt" = true ]; then
encrypt=1
else
encrypt=0
fi
ynh_app_setting_set --app=$app --key=encrypt --value=$encrypt
ynh_app_setting_set --app="$app" --key="encrypt" --value="$encrypt"
fi
# If core_backup doesn't exist, create it
if [ -z "$core_backup" ]; then
core_backup="$(grep "^ynh_core_backup=" "$final_path/Backup_list.conf" | cut -d= -f2)"
ynh_app_setting_set --app=$app --key=core_backup --value=$core_backup
if [ -z "${core_backup:-}" ]; then
core_backup="$(grep "^ynh_core_backup=" "$install_dir/Backup_list.conf" | cut -d= -f2)"
ynh_app_setting_set --app="$app" --key="core_backup" --value="$core_backup"
fi
# If apps_backup doesn't exist, create it
if [ -z "$apps_backup" ]; then
apps_backup="$(grep --count --max-count=1 "^ynh_app_backup=" "$final_path/Backup_list.conf")"
ynh_app_setting_set --app=$app --key=apps_backup --value=$apps_backup
if [ -z "${apps_backup:-}" ]; then
apps_backup="$(grep --count --max-count=1 "^ynh_app_backup=" "$install_dir/Backup_list.conf")"
ynh_app_setting_set --app="$app" --key="apps_backup" --value="$apps_backup"
fi
# If overwrite_cron doesn't exist, create it
if [ -z "$overwrite_cron" ]; then
if [ -z "${overwrite_cron:-}" ]; then
overwrite_cron=1
ynh_app_setting_set --app=$app --key=overwrite_cron --value=$overwrite_cron
ynh_app_setting_set --app="$app" --key="overwrite_cron" --value="$overwrite_cron"
fi
admin_mail_html=$(ynh_app_setting_get --app=$app --key=admin_mail_html)
# If admin_mail_html doesn't exist, create it
if [ -z "$admin_mail_html" ]; then
if [ -z "${admin_mail_html:-}" ]; then
admin_mail_html=1
ynh_app_setting_set --app=$app --key=admin_mail_html --value=$admin_mail_html
ynh_app_setting_set --app="$app" --key="admin_mail_html" --value="$admin_mail_html"
fi
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Upgrading source files..." --weight=2
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="$install_dir" --full_replace=1 --keep="passkey Backup_list.conf"
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
fi
chown -R "root:root" "$install_dir"
#=================================================
# UPGRADE DEPENDENCIES
# UPDATE A CONFIG FILE
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=8
ynh_install_app_dependencies $pkg_dependencies
ynh_script_progression --message="Updating $app's configuration files..." --weight=1
#=================================================
# SPECIFIC UPGRADE
# REAPPLY SYSTEM CONFIGURATIONS
#=================================================
# UPDATE THE CRON FILE
#=================================================
ynh_script_progression --message="Updating the cron file..."
# Overwrite the cron file only if it's allowed
if [ $overwrite_cron -eq 1 ]
then
# Verify the checksum and backup the file if it's different
ynh_backup_if_checksum_is_different --file="/etc/cron.d/$app"
cp ../conf/cron /etc/cron.d/$app
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file=/etc/cron.d/$app
ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file=/etc/cron.d/$app
if [ "$frequency" = "Daily" ]; then
cron_freq="0 2 * * *"
run_freq="every day"
elif [ "$frequency" = "Each 3 days" ]; then
cron_freq="0 2 */3 * *"
run_freq="each 3 days"
elif [ "$frequency" = "Weekly" ]; then
cron_freq="0 2 * * 0"
run_freq="once a week on sunday"
elif [ "$frequency" = "Biweekly" ]; then
cron_freq="0 2 * * 0/2"
run_freq="one sunday out of two"
else # Monthly
cron_freq="0 2 1 * *"
run_freq="once a month on the first sunday"
fi
ynh_replace_string --match_string="__FREQUENCY__" --replace_string="$cron_freq" --target_file=/etc/cron.d/$app
# Recalculate and store the config file checksum into the app settings
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
#=================================================
ynh_script_progression --message="Upgrading logrotate configuration..."
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append
#=================================================
# SEND A README FOR THE ADMIN
#=================================================
# Get main domain and buid the url of the admin panel of the app.
admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
# Build the changelog
ynh_app_changelog || true
echo "Archivist is going to run $run_freq.
If you want to change the frequency, have a look to the file /etc/cron.d/$app.
Please read the __URL_TAG1__documentation__URL_TAG2__https://github.com/maniackcrudelis/archivist/blob/master/Configuration.md__URL_TAG3__ about the configuration of archivist for more information.
You can configure this app easily by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__.
You can also find some specific actions for this app by using the experimental __URL_TAG1__action feature__URL_TAG2__$admin_panel/actions__URL_TAG3__.
If you're facing an issue or want to improve this app, please open a new issue in this __URL_TAG1__project__URL_TAG2__https://github.com/YunoHost-Apps/archivist_ynh__URL_TAG3__.
---
Changelog since your last upgrade:
$(cat changelog)" > mail_to_send
ynh_send_readme_to_admin --app_message="mail_to_send" --recipients="root" --type=upgrade
if (( overwrite_cron == 1 )); then
# Add Cron configuration file
ynh_add_config --template="archivist.cron" --destination="/etc/cron.d/$app"
fi
#=================================================
# END OF SCRIPT

12
tests.toml Normal file
View file

@ -0,0 +1,12 @@
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json
test_format = 1.0
[default]
args.encryption_pwd = "the_password"
args.frequency = "weekly"
test_upgrade_from.ce0ea695d4a4cff09b77bd2cb3438904012f7280.name = "Packaging v1"
test_upgrade_from.ce0ea695d4a4cff09b77bd2cb3438904012f7280.args.frequency = "Weekly"
test_upgrade_from.ce0ea695d4a4cff09b77bd2cb3438904012f7280.args.encryption_pwd = "the_password"