1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/restic_ynh.git synced 2024-09-03 20:16:22 +02:00

Merge pull request #15 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2023-01-20 10:41:34 +01:00 committed by GitHub
commit a515196d88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 38 additions and 39 deletions

View file

@ -5,7 +5,7 @@ It shall NOT be edited by hand.
# Restic for YunoHost
[![Integration level](https://dash.yunohost.org/integration/restic.svg)](https://dash.yunohost.org/appci/app/restic) ![](https://ci-apps.yunohost.org/ci/badges/restic.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/restic.maintain.svg)
[![Integration level](https://dash.yunohost.org/integration/restic.svg)](https://dash.yunohost.org/appci/app/restic) ![Working status](https://ci-apps.yunohost.org/ci/badges/restic.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/restic.maintain.svg)
[![Install Restic with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=restic)
*[Lire ce readme en français.](./README_fr.md)*
@ -15,8 +15,6 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
## Overview
## Overview
A [Restic](https://restic.net/) package for YunoHost (heavily inspired by [the Borg package](https://github.com/YunoHost-Apps/borg_ynh/)).
Restic is a backup tool that can make local and remote backups.
@ -25,9 +23,6 @@ The package does not handle local backups yet but you can work around that by us
**Shipped version:** 0.12.0~ynh9
## Disclaimers / important information
## Usage
@ -176,21 +171,22 @@ You can setup the Restic app several times on the same server so you can backup
## Documentation and resources
* Official app website: https://restic.net
* Official admin documentation: https://restic.readthedocs.io/en/latest/
* Upstream app code repository: https://github.com/restic/restic
* YunoHost documentation for this app: https://yunohost.org/app_restic
* Report a bug: https://github.com/YunoHost-Apps/restic_ynh/issues
* Official app website: <https://restic.net>
* Official admin documentation: <https://restic.readthedocs.io/en/latest/>
* Upstream app code repository: <https://github.com/restic/restic>
* YunoHost documentation for this app: <https://yunohost.org/app_restic>
* Report a bug: <https://github.com/YunoHost-Apps/restic_ynh/issues>
## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/restic_ynh/tree/testing).
To try the testing branch, please proceed like that.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/restic_ynh/tree/testing --debug
or
sudo yunohost app upgrade restic -u https://github.com/YunoHost-Apps/restic_ynh/tree/testing --debug
```
**More info regarding app packaging:** https://yunohost.org/packaging_apps
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>

View file

@ -1,17 +1,19 @@
<!--
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.
-->
# Restic pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/restic.svg)](https://dash.yunohost.org/appci/app/restic) ![](https://ci-apps.yunohost.org/ci/badges/restic.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/restic.maintain.svg)
[![Niveau dintégration](https://dash.yunohost.org/integration/restic.svg)](https://dash.yunohost.org/appci/app/restic) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/restic.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/restic.maintain.svg)
[![Installer Restic avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=restic)
*[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer Restic rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
> *Ce package vous permet dinstaller Restic 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.*
## Vue d'ensemble
## Overview
## Vue densemble
A [Restic](https://restic.net/) package for YunoHost (heavily inspired by [the Borg package](https://github.com/YunoHost-Apps/borg_ynh/)).
@ -21,9 +23,6 @@ The package does not handle local backups yet but you can work around that by us
**Version incluse :** 0.12.0~ynh9
## Avertissements / informations importantes
## Usage
@ -172,21 +171,22 @@ You can setup the Restic app several times on the same server so you can backup
## Documentations et ressources
* Site officiel de l'app : https://restic.net
* Documentation officielle de l'admin : https://restic.readthedocs.io/en/latest/
* Dépôt de code officiel de l'app : https://github.com/restic/restic
* Documentation YunoHost pour cette app : https://yunohost.org/app_restic
* Signaler un bug : https://github.com/YunoHost-Apps/restic_ynh/issues
* Site officiel de lapp : <https://restic.net>
* Documentation officielle de ladmin : <https://restic.readthedocs.io/en/latest/>
* Dépôt de code officiel de lapp : <https://github.com/restic/restic>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_restic>
* Signaler un bug : <https://github.com/YunoHost-Apps/restic_ynh/issues>
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/restic_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/restic_ynh/tree/testing --debug
ou
sudo yunohost app upgrade restic -u https://github.com/YunoHost-Apps/restic_ynh/tree/testing --debug
```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
**Plus dinfos sur le packaging dapplications :** <https://yunohost.org/packaging_apps>

View file

@ -1,5 +1,3 @@
## Overview
A [Restic](https://restic.net/) package for YunoHost (heavily inspired by [the Borg package](https://github.com/YunoHost-Apps/borg_ynh/)).
Restic is a backup tool that can make local and remote backups.

View file

@ -3,8 +3,8 @@
"id": "restic",
"packaging_format": 1,
"description": {
"en": "Backup your server with restic.",
"fr": "Sauvegardez votre serveur avec restic."
"en": "Backup your server with Restic",
"fr": "Sauvegardez votre serveur avec Restic"
},
"version": "0.12.0~ynh9",
"url": "https://restic.net/",

View file

@ -76,6 +76,7 @@ ynh_configure check_method "${final_path}/check_method_${app}"
# SETUP LOG SCRIPTS
#=================================================
ynh_script_progression --message="Setting up backup log script"
ynh_configure restic_log "${final_path}/restic_log_${app}"
chmod +x "${final_path}/restic_log_${app}"
chown ${app}: "${final_path}/restic_log_${app}"
@ -133,6 +134,7 @@ ynh_use_logrotate --logfile=/var/log/restic_check_${app}.err
# GENERATE SSH KEY
#=================================================
ynh_script_progression --message="Generating private key"
ssh_dir="/root/.ssh"
if [ ! -d "${ssh_dir}" ];then
mkdir -p "${ssh_dir}"
@ -164,12 +166,11 @@ ynh_script_progression --message="You should now allow the following public key
$(cat ${private_key}.pub)"
#=================================================
# SEND A README FOR THE ADMIN
#=================================================
ynh_script_progression --message="Sending post-installation instructions to admin" --last
ynh_print_OFF
message="You should now allow the following public key for user ${ssh_user} on server ${server}:
$(cat ${private_key}.pub)
@ -187,7 +188,6 @@ $(if [ "$backup_path" != "./" ];then echo "Also make sure ${backup_path} exists
If you're facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/restic_ynh"
ynh_send_readme_to_admin "$message" "root"
ynh_print_ON
#=================================================
# END OF SCRIPT

View file

@ -30,11 +30,9 @@ export data=$(ynh_app_setting_get $app data)
export apps=$(ynh_app_setting_get $app apps)
export allow_extra_space_use=$(ynh_app_setting_get $app allow_extra_space_use)
#=================================================
# CHECK VERSION
#=================================================
ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed)
@ -64,12 +62,14 @@ fi
# INSTALL RESTIC
#=================================================
ynh_script_progression --message="Installing restic binary" --weight=7
install_restic
#=================================================
# CREATE APP USER
#=================================================
ynh_script_progression --message="Creating user ${app}"
id ${app} 2>/dev/null || useradd -m ${app}
ynh_script_progression --message="Configure ${app} user sudoer rights"
cat > /tmp/${app}_sudoer << EOSUDOER
@ -106,6 +106,7 @@ chown -R ${app}: /home/${app}
# ACTIVATE BACKUP METHODS
#=================================================
ynh_script_progression --message="Activating backup methods"
mkdir -p /etc/yunohost/hooks.d/backup_method
mkdir -p /usr/share/yunohost/backup_method
@ -113,6 +114,7 @@ mkdir -p /usr/share/yunohost/backup_method
# SETUP THE BACKUP METHOD
#=================================================
ynh_script_progression --message="Setting up backup methods"
ynh_configure backup_method "/etc/yunohost/hooks.d/backup_method/05-${app}_app"
ynh_configure check_method "${final_path}/check_method_${app}"
@ -120,6 +122,7 @@ ynh_configure check_method "${final_path}/check_method_${app}"
# SETUP LOG SCRIPTS
#=================================================
ynh_script_progression --message="Setting up backup log script"
ynh_configure restic_log "${final_path}/restic_log_${app}"
chmod +x "${final_path}/restic_log_${app}"
chown ${app}: "${final_path}/restic_log_${app}"
@ -133,6 +136,7 @@ chown ${app}: "${final_path}/restic_check_log_${app}"
# CONFIGURE CRON
#=================================================
ynh_script_progression --message="Configuring cron" --weight=5
ynh_configure backup-with-restic "/usr/local/bin/backup-with-${app}"
ynh_configure check-restic "${final_path}/check-${app}"
chmod +x "/usr/local/bin/backup-with-${app}"
@ -189,6 +193,7 @@ fi
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Configuring logrotate"
ynh_use_logrotate --logfile=/var/log/restic_backup_${app}.log
ynh_use_logrotate --logfile=/var/log/restic_backup_${app}.err
ynh_use_logrotate --logfile=/var/log/restic_check_${app}.log