Merge pull request #19 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2021-08-10 22:51:55 +02:00 committed by GitHub
commit 099d17e928
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 179 additions and 527 deletions

55
.github/ISSUE_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,55 @@
---
name: Bug report
about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently.
---
**How to post a meaningful bug report**
1. *Read this whole template first.*
2. *Determine if you are on the right place:*
- *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!*
- *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.*
- *When in doubt, post here and we will figure it out together.*
3. *Delete the italic comments as you write over them below, and remove this guide.*
---
### Describe the bug
*A clear and concise description of what the bug is.*
### Context
- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...*
- YunoHost version: x.x.x
- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...*
- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes*
- If yes, please explain:
- Using, or trying to install package version/branch:
- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`*
### Steps to reproduce
- *If you performed a command from the CLI, the command itself is enough. For example:*
```sh
sudo yunohost app install the_app
```
- *If you used the webadmin, please perform the equivalent command from the CLI first.*
- *If the error occurs in your browser, explain what you did:*
1. *Go to '...'*
2. *Click on '...'*
3. *Scroll down to '...'*
4. *See error*
### Expected behavior
*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.*
### Logs
*When an operation fails, YunoHost provides a simple way to share the logs.*
- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.*
- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.*
*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)*
*If applicable and useful, add screenshots to help explain your problem.*

16
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,16 @@
## Problem
- *Description of why you made this PR*
## Solution
- *And how do you fix that problem*
## PR Status
- [ ] Code finished and ready to be reviewed/tested
- [ ] The fix/enhancement were manually tested (if applicable)
## Automatic tests
Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

View file

@ -1,24 +1,27 @@
<!--
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.
-->
# Unattended-upgrades for YunoHost # Unattended-upgrades for YunoHost
[![Integration level](https://dash.yunohost.org/integration/unattended_upgrades.svg)](https://dash.yunohost.org/appci/app/unattended_upgrades) ![](https://ci-apps.yunohost.org/ci/badges/unattended_upgrades.status.svg) [![](https://ci-apps.yunohost.org/ci/badges/unattended_upgrades.maintain.svg)](https://github.com/YunoHost/Apps/#what-to-do-if-i-cant-maintain-my-app-anymore-) [![Integration level](https://dash.yunohost.org/integration/unattended_upgrades.svg)](https://dash.yunohost.org/appci/app/unattended_upgrades) ![](https://ci-apps.yunohost.org/ci/badges/unattended_upgrades.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/unattended_upgrades.maintain.svg)
[![Install Unattended-upgrades with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=unattended_upgrades) [![Install Unattended-upgrades with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=unattended_upgrades)
*[Lire ce readme en français.](./README_fr.md)* *[Lire ce readme en français.](./README_fr.md)*
> *This package allow you to install Unattended-upgrades and Apticron quickly and simply on a YunoHost server. > *This package allows you to install Unattended-upgrades 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.* If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## Overview ## Overview
Unattended-upgrades can download and install security upgrades automatically and unattended, taking care to only install packages from the configured APT source, and checking for dpkg prompts about configuration file changes. Daily automatic upgrades
Apticron is a simple script which sends emails about pending package updates such as security updates, properly handling packages on hold both by dselect and aptitude. **Shipped version:** 1.0~ynh5
## Screenshots
## Demo
No demo available. ## Disclaimers / important information
## Configuration ## Configuration
@ -31,41 +34,23 @@ And this one for Apticron
With its cron file With its cron file
* /etc/cron.d/apticron * /etc/cron.d/apticron
## Documentation ## Documentation and resources
* Official Unattended-upgrades documentation: https://wiki.debian.org/UnattendedUpgrades * Official app website: https://wiki.debian.org/UnattendedUpgrades
* Official Apticron documentation: https://manpages.debian.org/stretch/apticron/apticron.1.en.html * Official user documentation: https://manpages.debian.org/stretch/apticron/apticron.1.en.html
* YunoHost documentation: There no other documentations, feel free to contribute. * Official admin documentation: https://wiki.debian.org/UnattendedUpgrades
* YunoHost documentation for this app: https://yunohost.org/app_unattended_upgrades
* Report a bug: https://github.com/YunoHost-Apps/unattended_upgrades_ynh/issues
## YunoHost specific features ## Developer info
#### Multi-users support Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/unattended_upgrades_ynh/tree/testing).
#### Supported architectures
* x86-64b - [![](https://ci-apps.yunohost.org/ci/logs/unattended_upgrades%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/unattended_upgrades/)
* ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/unattended_upgrades%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/unattended_upgrades/)
* Buster x86-64b - [![](https://ci-buster.nohost.me/ci/logs/unattended_upgrades%20%28Apps%29.svg)](https://ci-buster.nohost.me/ci/apps/unattended_upgrades/)
## Limitations
## Additionnal informations
## Links
* Report a bug: https://github.com/YunoHost-Apps/unattended_upgrades_ynh/issues
* YunoHost website: https://yunohost.org/
---
Developers infos
----------------
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/unattended_upgrades_ynh/tree/testing).
To try the testing branch, please proceed like that. To try the testing branch, please proceed like that.
``` ```
sudo yunohost app install https://github.com/YunoHost-Apps/unattended_upgrades_ynh/tree/testing --force --debug sudo yunohost app install https://github.com/YunoHost-Apps/unattended_upgrades_ynh/tree/testing --debug
or or
sudo yunohost app upgrade unattended_upgrades -u https://github.com/YunoHost-Apps/unattended_upgrades_ynh/tree/testing --debug sudo yunohost app upgrade unattended_upgrades -u https://github.com/YunoHost-Apps/unattended_upgrades_ynh/tree/testing --debug
``` ```
**More info regarding app packaging:** https://yunohost.org/packaging_apps

View file

@ -1,24 +1,23 @@
# Unattended-upgrades pour YunoHost # Unattended-upgrades pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/unattended_upgrades.svg)](https://dash.yunohost.org/appci/app/unattended_upgrades) ![](https://ci-apps.yunohost.org/ci/badges/unattended_upgrades.status.svg) [![](https://ci-apps.yunohost.org/ci/badges/unattended_upgrades.maintain.svg)](https://github.com/YunoHost/Apps/#what-to-do-if-i-cant-maintain-my-app-anymore-) [![Niveau d'intégration](https://dash.yunohost.org/integration/unattended_upgrades.svg)](https://dash.yunohost.org/appci/app/unattended_upgrades) ![](https://ci-apps.yunohost.org/ci/badges/unattended_upgrades.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/unattended_upgrades.maintain.svg)
[![Installer Unattended-upgrades avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=unattended_upgrades) [![Installer Unattended-upgrades avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=unattended_upgrades)
*[Read this readme in english.](./README.md)* *[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer Unattended-upgrades et Apticron rapidement et simplement sur un serveur YunoHost. > *Ce package vous permet d'installer Unattended-upgrades 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.* Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
## Résumé ## Vue d'ensemble
Unattended-upgrades peut télécharger et installer des mises à niveau de sécurité automatiquement et sans surveillance, en prenant soin de n'installer que des paquets depuis la source APT configurée, et en vérifiant les invites dpkg sur les changements de fichier de configuration. Mise à jour automatique quotidienne
Apticron est un script simple qui envoie des mails sur les mises à jour de paquets en attente telles que les mises à jour de sécurité, la gestion correcte des paquets en attente par dselect et aptitude. **Version incluse :** 1.0~ynh5
## Captures d'écran
## Démo
Aucune démo pour cette application. ## Avertissements / informations importantes
## Configuration ## Configuration
@ -31,41 +30,23 @@ Et celui-ci pour Apticron
Avec son cron Avec son cron
* /etc/cron.d/apticron * /etc/cron.d/apticron
## Documentation ## Documentations et ressources
* Documentation officielle de Unattended-upgrades: https://wiki.debian.org/UnattendedUpgrades * Site officiel de l'app : https://wiki.debian.org/UnattendedUpgrades
* Documentation officielle de Apticron: https://manpages.debian.org/stretch/apticron/apticron.1.en.html * Documentation officielle utilisateur : https://manpages.debian.org/stretch/apticron/apticron.1.en.html
* Documentation YunoHost: Il n'y a pas d'autre documentation, n'hésitez pas à contribuer. * Documentation officielle de l'admin : https://wiki.debian.org/UnattendedUpgrades
* Documentation YunoHost pour cette app : https://yunohost.org/app_unattended_upgrades
* Signaler un bug : https://github.com/YunoHost-Apps/unattended_upgrades_ynh/issues
## Fonctionnalités spécifiques à YunoHost ## Informations pour les développeurs
#### Support multi-utilisateurs
#### Architectures supportées.
* x86-64b - [![](https://ci-apps.yunohost.org/ci/logs/unattended_upgrades%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/unattended_upgrades/)
* ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/unattended_upgrades%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/unattended_upgrades/)
* Buster x86-64b - [![](https://ci-buster.nohost.me/ci/logs/unattended_upgrades%20%28Apps%29.svg)](https://ci-buster.nohost.me/ci/apps/unattended_upgrades/)
## Limitations
## Informations additionnelles
## Liens
* Reporter un bug: https://github.com/YunoHost-Apps/unattended_upgrades_ynh/issues
* Site de YunoHost: https://yunohost.org/
---
Informations à l'intention des développeurs
----------------
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/unattended_upgrades_ynh/tree/testing). Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/unattended_upgrades_ynh/tree/testing).
Pour tester la branche testing, merci de procéder ainsi. Pour essayer la branche testing, procédez comme suit.
``` ```
sudo yunohost app install https://github.com/YunoHost-Apps/unattended_upgrades_ynh/tree/testing --force --debug sudo yunohost app install https://github.com/YunoHost-Apps/unattended_upgrades_ynh/tree/testing --debug
ou ou
sudo yunohost app upgrade unattended_upgrades -u https://github.com/YunoHost-Apps/unattended_upgrades_ynh/tree/testing --debug sudo yunohost app upgrade unattended_upgrades -u https://github.com/YunoHost-Apps/unattended_upgrades_ynh/tree/testing --debug
``` ```
**Plus d'infos sur le packaging d'applications :** 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)
`Not applicable`
#### [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)
`Not applicable`
[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)
`Not applicable`
[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)
`Not applicable`
[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

@ -26,13 +26,13 @@
setup_private=0 setup_private=0
setup_public=0 setup_public=0
upgrade=1 upgrade=1
upgrade=1 from_commit=5a359c6833a5415932ab427a80dbbdc6ca3c8e23 upgrade=1 from_commit=4e342d41ea448c4a9de2bbbc6b6cffe92320ef71
backup_restore=1 backup_restore=1
multi_instance=0 multi_instance=0
port_already_use=0 port_already_use=0
change_url=0 change_url=0
actions=1 actions=0
config_panel=1 config_panel=0
;; Test complet 2/3 ;; Test complet 2/3
; Manifest ; Manifest
upgrade_level="Security and updates" upgrade_level="Security and updates"
@ -61,11 +61,9 @@
setup_nourl=1 setup_nourl=1
upgrade=1 upgrade=1
backup_restore=1 backup_restore=1
;;; Levels
Level 5=auto
;;; Options ;;; Options
Email= Email=
Notification=change Notification=change
;;; Upgrade options ;;; Upgrade options
; commit=b86b9d09ed97bf04b7e1afad72376d8d695b418b ; commit=4e342d41ea448c4a9de2bbbc6b6cffe92320ef71
name=Mar 14, 2018 Update helpers name=Merge pull request #16 from YunoHost-Apps/testing

View file

@ -23,4 +23,4 @@ APT::Periodic::AutocleanInterval "30";
// 1: progress report (actually any string) // 1: progress report (actually any string)
// 2: + command outputs (remove -qq, remove 2>/dev/null, add -d) // 2: + command outputs (remove -qq, remove 2>/dev/null, add -d)
// 3: + trace on // 3: + trace on
APT::Periodic::Verbose "__VERBOSITY__"; APT::Periodic::Verbose "__UNATTENDED_VERBOSITY__";

View file

@ -14,12 +14,12 @@ name = "Unattended-upgrades configuration"
default = "Security only" default = "Security only"
[main.unattended_configuration.ynh_update] [main.unattended_configuration.ynh_update]
ask = "Would you like to update YunoHost packages automatically ?" ask = "Would you like to update YunoHost packages automatically?"
type = "boolean" type = "boolean"
default = true default = true
[main.unattended_configuration.unattended_mail] [main.unattended_configuration.unattended_mail]
ask = "Would you like to receive an email from Unattended-Upgrades ?" ask = "Would you like to receive an email from Unattended-Upgrades?"
choices = ["If an upgrade has been done", "Only if there was an error", "Never"] choices = ["If an upgrade has been done", "Only if there was an error", "Never"]
default = "If an upgrade has been done" default = "If an upgrade has been done"
@ -28,7 +28,7 @@ name = "Unattended-upgrades configuration"
name = "apticron cron file" name = "apticron cron file"
[main.apticron_configuration.previous_apticron] [main.apticron_configuration.previous_apticron]
ask = "Would you like to receive an email to inform which upgrades need to be done ?" ask = "Would you like to receive an email to inform which upgrades need to be done?"
type = "boolean" type = "boolean"
default = true default = true
@ -39,12 +39,12 @@ name = "Unattended-upgrades configuration"
help = "Choose an hour between 12 and 23." help = "Choose an hour between 12 and 23."
[main.apticron_configuration.after_apticron] [main.apticron_configuration.after_apticron]
ask = "Would you like to receive an email to verify if there any upgrades left after each auto upgrade ?" ask = "Would you like to receive an email to verify if there any upgrades left after each auto upgrade?"
type = "boolean" type = "boolean"
default = true default = true
[main.apticron_configuration.after_apticron_hour] [main.apticron_configuration.after_apticron_hour]
ask = "When do you want to receive this email ?" ask = "When do you want to receive this email?"
type = "number" type = "number"
default = "2" default = "2"
help = "Choose an hour between 0 and 10." help = "Choose an hour between 0 and 10."
@ -64,7 +64,7 @@ name = "Unattended-upgrades configuration"
name = "Overwriting config files" name = "Overwriting config files"
[main.overwrite_files.overwrite_periodic] [main.overwrite_files.overwrite_periodic]
ask = "Overwrite the config file 02periodic ?" ask = "Overwrite the config file 02periodic?"
type = "boolean" type = "boolean"
default = true default = true
help = "If the file is overwritten, a backup will be created." help = "If the file is overwritten, a backup will be created."
@ -74,7 +74,7 @@ name = "Unattended-upgrades configuration"
name = "Global configuration" name = "Global configuration"
[main.global_config.email_type] [main.global_config.email_type]
ask = "Send HTML email to admin ?" ask = "Send HTML email to admin?"
type = "boolean" type = "boolean"
default = true default = true
help = "Allow app scripts to send HTML mails instead of plain text." help = "Allow app scripts to send HTML mails instead of plain text."

10
doc/DISCLAIMER.md Normal file
View file

@ -0,0 +1,10 @@
## Configuration
Have a look to the following config files for Unattended-upgrades
* /etc/apt/apt.conf.d/50unattended-upgrades
* /etc/apt/apt.conf.d/02periodic
And this one for Apticron
* /etc/apticron/apticron.conf
With its cron file
* /etc/cron.d/apticron

10
doc/DISCLAIMER_fr.md Normal file
View file

@ -0,0 +1,10 @@
## Configuration
Regardez les fichiers de configuration suivant pour Unattended-upgrades
* /etc/apt/apt.conf.d/50unattended-upgrades
* /etc/apt/apt.conf.d/02periodic
Et celui-ci pour Apticron
* /etc/apticron/apticron.conf
Avec son cron
* /etc/cron.d/apticron

View file

@ -4,10 +4,16 @@
"packaging_format": 1, "packaging_format": 1,
"description": { "description": {
"en": "Daily automatic upgrades", "en": "Daily automatic upgrades",
"fr": "Mise à jour automatique quotidienne." "fr": "Mise à jour automatique quotidienne"
}, },
"version": "1.0~ynh5", "version": "1.0~ynh5",
"url": "https://wiki.debian.org/UnattendedUpgrades", "url": "https://wiki.debian.org/UnattendedUpgrades",
"upstream": {
"license": "GPL-2.0-or-later",
"website": "https://wiki.debian.org/UnattendedUpgrades",
"admindoc": "https://wiki.debian.org/UnattendedUpgrades",
"userdoc": "https://manpages.debian.org/stretch/apticron/apticron.1.en.html"
},
"license": "GPL-2.0-or-later", "license": "GPL-2.0-or-later",
"maintainer": { "maintainer": {
"name": "", "name": "",
@ -18,7 +24,7 @@
"email": "maniackc_dev@crudelis.fr" "email": "maniackc_dev@crudelis.fr"
}], }],
"requirements": { "requirements": {
"yunohost": ">= 3.6.0" "yunohost": ">= 4.2.0"
}, },
"multi_instance": false, "multi_instance": false,
"services": [], "services": [],
@ -38,7 +44,7 @@
"name": "ynh_update", "name": "ynh_update",
"type": "boolean", "type": "boolean",
"ask": { "ask": {
"en": "Would you like to update YunoHost packages automatically ?", "en": "Would you like to update YunoHost packages automatically?",
"fr": "Souhaitez-vous mettre à jour les paquets YunoHost automatiquement ?" "fr": "Souhaitez-vous mettre à jour les paquets YunoHost automatiquement ?"
}, },
"default": true "default": true
@ -47,7 +53,7 @@
"name": "previous_apticron", "name": "previous_apticron",
"type": "boolean", "type": "boolean",
"ask": { "ask": {
"en": "Would you like to receive an email to inform which upgrades need to be done ?", "en": "Would you like to receive an email to inform which upgrades need to be done?",
"fr": "Souhaitez-vous recevoir un email pour vous informer des mises à jour nécessaires ?" "fr": "Souhaitez-vous recevoir un email pour vous informer des mises à jour nécessaires ?"
}, },
"default": true "default": true
@ -56,7 +62,7 @@
"name": "after_apticron", "name": "after_apticron",
"type": "boolean", "type": "boolean",
"ask": { "ask": {
"en": "Would you like to receive an email to verify if there any upgrades left after each auto upgrade ?", "en": "Would you like to receive an email to verify if there any upgrades left after each auto upgrade?",
"fr": "Souhaitez-vous recevoir un email pour vérifier s'il reste des mises à jour après chaque mise à niveau automatique ?" "fr": "Souhaitez-vous recevoir un email pour vérifier s'il reste des mises à jour après chaque mise à niveau automatique ?"
}, },
"default": true "default": true
@ -65,7 +71,7 @@
"name": "unattended_mail", "name": "unattended_mail",
"type": "string", "type": "string",
"ask": { "ask": {
"en": "Would you like to receive an email from Unattended-Upgrades ?", "en": "Would you like to receive an email from Unattended-Upgrades?",
"fr": "Souhaitez-vous recevoir un email de Unattended-Upgrades ?" "fr": "Souhaitez-vous recevoir un email de Unattended-Upgrades ?"
}, },
"choices": ["If an upgrade has been done", "Only if there was an error", "Never"], "choices": ["If an upgrade has been done", "Only if there was an error", "Never"],

View file

@ -1,5 +1,12 @@
#!/bin/bash #!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
# dependencies used by the app
pkg_dependencies="apticron unattended-upgrades apt-listchanges"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS
#================================================= #=================================================
@ -43,83 +50,6 @@ IS_PACKAGE_CHECK () {
# FUTUR OFFICIAL HELPERS # FUTUR OFFICIAL HELPERS
#================================================= #=================================================
# Install or update the main directory yunohost.multimedia
#
# usage: ynh_multimedia_build_main_dir
ynh_multimedia_build_main_dir () {
local ynh_media_release="v1.2"
local checksum="806a827ba1902d6911095602a9221181"
# Download yunohost.multimedia scripts
wget -nv https://github.com/YunoHost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz
# Check the control sum
echo "${checksum} ${ynh_media_release}.tar.gz" | md5sum -c --status \
|| ynh_die "Corrupt source"
# Check if the package acl is installed. Or install it.
ynh_package_is_installed 'acl' \
|| ynh_package_install acl
# Extract
mkdir yunohost.multimedia-master
tar -xf ${ynh_media_release}.tar.gz -C yunohost.multimedia-master --strip-components 1
./yunohost.multimedia-master/script/ynh_media_build.sh
}
# Add a directory in yunohost.multimedia
# This "directory" will be a symbolic link to a existing directory.
#
# usage: ynh_multimedia_addfolder "Source directory" "Destination directory"
#
# | arg: -s, --source_dir= - Source directory - The real directory which contains your medias.
# | arg: -d, --dest_dir= - Destination directory - The name and the place of the symbolic link, relative to "/home/yunohost.multimedia"
ynh_multimedia_addfolder () {
# Declare an array to define the options of this helper.
declare -Ar args_array=( [s]=source_dir= [d]=dest_dir= )
local source_dir
local dest_dir
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="$source_dir" --dest="$dest_dir"
}
# Move a directory in yunohost.multimedia, and replace by a symbolic link
#
# usage: ynh_multimedia_movefolder "Source directory" "Destination directory"
#
# | arg: -s, --source_dir= - Source directory - The real directory which contains your medias.
# It will be moved to "Destination directory"
# A symbolic link will replace it.
# | arg: -d, --dest_dir= - Destination directory - The new name and place of the directory, relative to "/home/yunohost.multimedia"
ynh_multimedia_movefolder () {
# Declare an array to define the options of this helper.
declare -Ar args_array=( [s]=source_dir= [d]=dest_dir= )
local source_dir
local dest_dir
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
./yunohost.multimedia-master/script/ynh_media_addfolder.sh --inv --source="$source_dir" --dest="$dest_dir"
}
# Allow an user to have an write authorisation in multimedia directories
#
# usage: ynh_multimedia_addaccess user_name
#
# | arg: -u, --user_name= - The name of the user which gain this access.
ynh_multimedia_addaccess () {
# Declare an array to define the options of this helper.
declare -Ar args_array=( [u]=user_name=)
local user_name
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
groupadd -f multimedia
usermod -a -G multimedia $user_name
}
#================================================= #=================================================
# EXPERIMENTAL HELPERS # EXPERIMENTAL HELPERS
#================================================= #=================================================
@ -265,30 +195,6 @@ __PRE_TAG1__$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/service
#================================================= #=================================================
ynh_debian_release () {
lsb_release --codename --short
}
is_stretch () {
if [ "$(ynh_debian_release)" == "stretch" ]
then
return 0
else
return 1
fi
}
is_jessie () {
if [ "$(ynh_debian_release)" == "jessie" ]
then
return 0
else
return 1
fi
}
#=================================================
ynh_maintenance_mode_ON () { ynh_maintenance_mode_ON () {
# Load value of $path_url and $domain from the config if their not set # Load value of $path_url and $domain from the config if their not set
if [ -z $path_url ]; then if [ -z $path_url ]; then
@ -578,173 +484,3 @@ ynh_check_ram () {
echo $ram echo $ram
fi fi
} }
#=================================================
# Define the values to configure php-fpm
#
# usage: ynh_get_scalable_phpfpm --usage=usage --footprint=footprint [--print]
# | arg: -f, --footprint - Memory footprint of the service (low/medium/high).
# low - Less than 20Mb of ram by pool.
# medium - Between 20Mb and 40Mb of ram by pool.
# high - More than 40Mb of ram by pool.
# Or specify exactly the footprint, the load of the service as Mb by pool instead of having a standard value.
# To have this value, use the following command and stress the service.
# watch -n0.5 ps -o user,cmd,%cpu,rss -u APP
#
# | arg: -u, --usage - Expected usage of the service (low/medium/high).
# low - Personal usage, behind the sso.
# medium - Low usage, few people or/and publicly accessible.
# high - High usage, frequently visited website.
#
# | arg: -p, --print - Print the result
#
#
#
# The footprint of the service will be used to defined the maximum footprint we can allow, which is half the maximum RAM.
# So it will be used to defined 'pm.max_children'
# A lower value for the footprint will allow more children for 'pm.max_children'. And so for
# 'pm.start_servers', 'pm.min_spare_servers' and 'pm.max_spare_servers' which are defined from the
# value of 'pm.max_children'
# NOTE: 'pm.max_children' can't exceed 4 times the number of processor's cores.
#
# The usage value will defined the way php will handle the children for the pool.
# A value set as 'low' will set the process manager to 'ondemand'. Children will start only if the
# service is used, otherwise no child will stay alive. This config gives the lower footprint when the
# service is idle. But will use more proc since it has to start a child as soon it's used.
# Set as 'medium', the process manager will be at dynamic. If the service is idle, a number of children
# equal to pm.min_spare_servers will stay alive. So the service can be quick to answer to any request.
# The number of children can grow if needed. The footprint can stay low if the service is idle, but
# not null. The impact on the proc is a little bit less than 'ondemand' as there's always a few
# children already available.
# Set as 'high', the process manager will be set at 'static'. There will be always as many children as
# 'pm.max_children', the footprint is important (but will be set as maximum a quarter of the maximum
# RAM) but the impact on the proc is lower. The service will be quick to answer as there's always many
# children ready to answer.
ynh_get_scalable_phpfpm () {
local legacy_args=ufp
# Declare an array to define the options of this helper.
declare -Ar args_array=( [u]=usage= [f]=footprint= [p]=print )
local usage
local footprint
local print
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
# Set all characters as lowercase
footprint=${footprint,,}
usage=${usage,,}
print=${print:-0}
if [ "$footprint" = "low" ]
then
footprint=20
elif [ "$footprint" = "medium" ]
then
footprint=35
elif [ "$footprint" = "high" ]
then
footprint=50
fi
# Define the way the process manager handle child processes.
if [ "$usage" = "low" ]
then
php_pm=ondemand
elif [ "$usage" = "medium" ]
then
php_pm=dynamic
elif [ "$usage" = "high" ]
then
php_pm=static
else
ynh_die --message="Does not recognize '$usage' as an usage value."
fi
# Get the total of RAM available, except swap.
local max_ram=$(ynh_check_ram --no_swap)
less0() {
# Do not allow value below 1
if [ $1 -le 0 ]
then
echo 1
else
echo $1
fi
}
# Define pm.max_children
# The value of pm.max_children is the total amount of ram divide by 2 and divide again by the footprint of a pool for this app.
# So if php-fpm start the maximum of children, it won't exceed half of the ram.
php_max_children=$(( $max_ram / 2 / $footprint ))
# If process manager is set as static, use half less children.
# Used as static, there's always as many children as the value of pm.max_children
if [ "$php_pm" = "static" ]
then
php_max_children=$(( $php_max_children / 2 ))
fi
php_max_children=$(less0 $php_max_children)
# To not overload the proc, limit the number of children to 4 times the number of cores.
local core_number=$(nproc)
local max_proc=$(( $core_number * 4 ))
if [ $php_max_children -gt $max_proc ]
then
php_max_children=$max_proc
fi
if [ "$php_pm" = "dynamic" ]
then
# Define pm.start_servers, pm.min_spare_servers and pm.max_spare_servers for a dynamic process manager
php_min_spare_servers=$(( $php_max_children / 8 ))
php_min_spare_servers=$(less0 $php_min_spare_servers)
php_max_spare_servers=$(( $php_max_children / 2 ))
php_max_spare_servers=$(less0 $php_max_spare_servers)
php_start_servers=$(( $php_min_spare_servers + ( $php_max_spare_servers - $php_min_spare_servers ) /2 ))
php_start_servers=$(less0 $php_start_servers)
else
php_min_spare_servers=0
php_max_spare_servers=0
php_start_servers=0
fi
if [ $print -eq 1 ]
then
ynh_debug --message="Footprint=${footprint}Mb by pool."
ynh_debug --message="Process manager=$php_pm"
ynh_debug --message="Max RAM=${max_ram}Mb"
if [ "$php_pm" != "static" ]; then
ynh_debug --message="\nMax estimated footprint=$(( $php_max_children * $footprint ))"
ynh_debug --message="Min estimated footprint=$(( $php_min_spare_servers * $footprint ))"
fi
if [ "$php_pm" = "dynamic" ]; then
ynh_debug --message="Estimated average footprint=$(( $php_max_spare_servers * $footprint ))"
elif [ "$php_pm" = "static" ]; then
ynh_debug --message="Estimated footprint=$(( $php_max_children * $footprint ))"
fi
ynh_debug --message="\nRaw php-fpm values:"
ynh_debug --message="pm.max_children = $php_max_children"
if [ "$php_pm" = "dynamic" ]; then
ynh_debug --message="pm.start_servers = $php_start_servers"
ynh_debug --message="pm.min_spare_servers = $php_min_spare_servers"
ynh_debug --message="pm.max_spare_servers = $php_max_spare_servers"
fi
fi
}
#=================================================
# Execute a command as another user
# usage: exec_as USER COMMAND [ARG ...]
exec_as() {
local USER=$1
shift 1
if [[ $USER = $(whoami) ]]; then
eval "$@"
else
sudo -u "$USER" "$@"
fi
}

View file

@ -1,4 +0,0 @@
#!/bin/bash
# Dependencies
app_depencencies="apticron unattended-upgrades apt-listchanges"

View file

@ -7,8 +7,6 @@
#================================================= #=================================================
# Load common variables for all scripts. # Load common variables for all scripts.
source scripts/_variables
source scripts/_common.sh source scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers

View file

@ -103,10 +103,7 @@ fi
if [ "$file" = "02periodic" ] if [ "$file" = "02periodic" ]
then then
# Get the default file and overwrite the current config # Get the default file and overwrite the current config
cp /etc/yunohost/apps/$app/conf/02periodic "$config_file" ynh_add_config --template="../conf/02periodic" --destination="/etc/apt/apt.conf.d/02periodic"
# Recreate the default config
ynh_replace_string --match_string="__VERBOSITY__" --replace_string="$unattended_verbosity" --target_file="/etc/apt/apt.conf.d/02periodic"
fi fi
# Calculate and store the config file checksum into the app settings # Calculate and store the config file checksum into the app settings

View file

@ -19,16 +19,18 @@ ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
#================================================= #=================================================
# SPECIFIC BACKUP # DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#================================================= #=================================================
# BACKUP UNATTENDED-UPGRADES CONFIG # BACKUP UNATTENDED-UPGRADES CONFIG
#================================================= #=================================================
ynh_script_progression --message="Backing up unattended-upgrades config..."
ynh_backup --src_path="/etc/apt/apt.conf.d/50unattended-upgrades" ynh_backup --src_path="/etc/apt/apt.conf.d/50unattended-upgrades"
# Backup also the backup of the config file # Backup also the backup of the config file
@ -37,21 +39,18 @@ ynh_backup --src_path="/etc/apt/50unattended-upgrades.backup"
#================================================= #=================================================
# BACKUP APT PERIODIC # BACKUP APT PERIODIC
#================================================= #=================================================
ynh_script_progression --message="Backing up APT periodic..."
ynh_backup --src_path="/etc/apt/apt.conf.d/02periodic" ynh_backup --src_path="/etc/apt/apt.conf.d/02periodic"
#================================================= #=================================================
# BACKUP APTICRON CONFIG # BACKUP APTICRON CONFIG
#================================================= #=================================================
ynh_script_progression --message="Backing up Apticron config..."
ynh_backup --src_path="/etc/apticron/apticron.conf" ynh_backup --src_path="/etc/apticron/apticron.conf"
#================================================= #=================================================
# BACKUP THE CRON FILE # BACKUP THE CRON FILE
#================================================= #=================================================
ynh_script_progression --message="Backing up cron file..."
ynh_backup --src_path="/etc/cron.d/apticron" ynh_backup --src_path="/etc/cron.d/apticron"
@ -59,4 +58,4 @@ ynh_backup --src_path="/etc/cron.d/apticron"
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -6,9 +6,6 @@
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
# Load common variables for all scripts.
source _variables
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -54,7 +51,7 @@ ynh_app_setting_set --app=$app --key=admin_mail_html --value=1
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." --weight=10 ynh_script_progression --message="Installing dependencies..." --weight=10
ynh_install_app_dependencies $app_depencencies ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
@ -132,11 +129,7 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Configure APT Periodic for Unattended" --weight=2 ynh_script_progression --message="Configure APT Periodic for Unattended" --weight=2
cp "../conf/02periodic" "/etc/apt/apt.conf.d/02periodic" ynh_add_config --template="../conf/02periodic" --destination="/etc/apt/apt.conf.d/02periodic"
ynh_replace_string --match_string="__VERBOSITY__" --replace_string="$unattended_verbosity" --target_file="/etc/apt/apt.conf.d/02periodic"
# This config file is used by /etc/cron.daily/apt
ynh_store_file_checksum "/etc/apt/apt.conf.d/02periodic"
#================================================= #=================================================
# MODIFY ORIGINAL APTICRON CRON FILE # MODIFY ORIGINAL APTICRON CRON FILE

View file

@ -6,9 +6,6 @@
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
# Load common variables for all scripts.
source ../settings/scripts/_variables
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -33,7 +30,7 @@ app=$YNH_APP_INSTANCE_NAME
#================================================= #=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=10 ynh_script_progression --message="Reinstalling dependencies..." --weight=10
ynh_install_app_dependencies $app_depencencies ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# RESTORE UNATTENDED-UPGRADES CONFIG # RESTORE UNATTENDED-UPGRADES CONFIG

View file

@ -6,9 +6,6 @@
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
# Load common variables for all scripts.
source _variables
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -82,7 +79,7 @@ ynh_abort_if_errors
#================================================= #=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=5 ynh_script_progression --message="Upgrading dependencies..." --weight=5
ynh_install_app_dependencies $app_depencencies ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
@ -106,13 +103,8 @@ ynh_install_app_dependencies $app_depencencies
if [ $overwrite_periodic -eq 1 ] if [ $overwrite_periodic -eq 1 ]
then then
ynh_script_progression --message="Upgrading APT Periodic for Unattended..." --weight=3 ynh_script_progression --message="Upgrading APT Periodic for Unattended..." --weight=3
ynh_backup_if_checksum_is_different --file="/etc/apt/apt.conf.d/02periodic"
ynh_add_config --template="../conf/02periodic" --destination="/etc/apt/apt.conf.d/02periodic"
cp "../conf/02periodic" "/etc/apt/apt.conf.d/02periodic"
ynh_replace_string --match_string="__VERBOSITY__" --replace_string="$unattended_verbosity" --target_file="/etc/apt/apt.conf.d/02periodic"
# This config file is used by /etc/cron.daily/apt
ynh_store_file_checksum --file="/etc/apt/apt.conf.d/02periodic"
fi fi
#================================================= #=================================================