mirror of
https://github.com/YunoHost-Apps/restic_ynh.git
synced 2024-09-03 20:16:22 +02:00
commit
a515196d88
6 changed files with 38 additions and 39 deletions
22
README.md
22
README.md
|
@ -5,7 +5,7 @@ It shall NOT be edited by hand.
|
||||||
|
|
||||||
# Restic for YunoHost
|
# Restic for YunoHost
|
||||||
|
|
||||||
[](https://dash.yunohost.org/appci/app/restic)  
|
[](https://dash.yunohost.org/appci/app/restic)  
|
||||||
[](https://install-app.yunohost.org/?app=restic)
|
[](https://install-app.yunohost.org/?app=restic)
|
||||||
|
|
||||||
*[Lire ce readme en français.](./README_fr.md)*
|
*[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
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
A [Restic](https://restic.net/) package for YunoHost (heavily inspired by [the Borg package](https://github.com/YunoHost-Apps/borg_ynh/)).
|
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.
|
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
|
**Shipped version:** 0.12.0~ynh9
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Disclaimers / important information
|
## Disclaimers / important information
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
@ -176,21 +171,22 @@ You can setup the Restic app several times on the same server so you can backup
|
||||||
|
|
||||||
## Documentation and resources
|
## Documentation and resources
|
||||||
|
|
||||||
* Official app website: https://restic.net
|
* Official app website: <https://restic.net>
|
||||||
* Official admin documentation: https://restic.readthedocs.io/en/latest/
|
* Official admin documentation: <https://restic.readthedocs.io/en/latest/>
|
||||||
* Upstream app code repository: https://github.com/restic/restic
|
* Upstream app code repository: <https://github.com/restic/restic>
|
||||||
* YunoHost documentation for this app: https://yunohost.org/app_restic
|
* YunoHost documentation for this app: <https://yunohost.org/app_restic>
|
||||||
* Report a bug: https://github.com/YunoHost-Apps/restic_ynh/issues
|
* Report a bug: <https://github.com/YunoHost-Apps/restic_ynh/issues>
|
||||||
|
|
||||||
## Developer info
|
## Developer info
|
||||||
|
|
||||||
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/restic_ynh/tree/testing).
|
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.
|
To try the testing branch, please proceed like that.
|
||||||
```
|
|
||||||
|
``` bash
|
||||||
sudo yunohost app install https://github.com/YunoHost-Apps/restic_ynh/tree/testing --debug
|
sudo yunohost app install https://github.com/YunoHost-Apps/restic_ynh/tree/testing --debug
|
||||||
or
|
or
|
||||||
sudo yunohost app upgrade restic -u https://github.com/YunoHost-Apps/restic_ynh/tree/testing --debug
|
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>
|
||||||
|
|
34
README_fr.md
34
README_fr.md
|
@ -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
|
# Restic pour YunoHost
|
||||||
|
|
||||||
[](https://dash.yunohost.org/appci/app/restic)  
|
[](https://dash.yunohost.org/appci/app/restic)  
|
||||||
[](https://install-app.yunohost.org/?app=restic)
|
[](https://install-app.yunohost.org/?app=restic)
|
||||||
|
|
||||||
*[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 Restic rapidement et simplement sur un serveur YunoHost.
|
> *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.*
|
Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.*
|
||||||
|
|
||||||
## Vue d'ensemble
|
## Vue d’ensemble
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
A [Restic](https://restic.net/) package for YunoHost (heavily inspired by [the Borg package](https://github.com/YunoHost-Apps/borg_ynh/)).
|
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
|
**Version incluse :** 0.12.0~ynh9
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Avertissements / informations importantes
|
## Avertissements / informations importantes
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
@ -172,21 +171,22 @@ You can setup the Restic app several times on the same server so you can backup
|
||||||
|
|
||||||
## Documentations et ressources
|
## Documentations et ressources
|
||||||
|
|
||||||
* Site officiel de l'app : https://restic.net
|
* Site officiel de l’app : <https://restic.net>
|
||||||
* Documentation officielle de l'admin : https://restic.readthedocs.io/en/latest/
|
* 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
|
* Dépôt de code officiel de l’app : <https://github.com/restic/restic>
|
||||||
* Documentation YunoHost pour cette app : https://yunohost.org/app_restic
|
* Documentation YunoHost pour cette app : <https://yunohost.org/app_restic>
|
||||||
* Signaler un bug : https://github.com/YunoHost-Apps/restic_ynh/issues
|
* Signaler un bug : <https://github.com/YunoHost-Apps/restic_ynh/issues>
|
||||||
|
|
||||||
## Informations pour les développeurs
|
## Informations pour les développeurs
|
||||||
|
|
||||||
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/restic_ynh/tree/testing).
|
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.
|
Pour essayer la branche testing, procédez comme suit.
|
||||||
```
|
|
||||||
|
``` bash
|
||||||
sudo yunohost app install https://github.com/YunoHost-Apps/restic_ynh/tree/testing --debug
|
sudo yunohost app install https://github.com/YunoHost-Apps/restic_ynh/tree/testing --debug
|
||||||
ou
|
ou
|
||||||
sudo yunohost app upgrade restic -u https://github.com/YunoHost-Apps/restic_ynh/tree/testing --debug
|
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 d’infos sur le packaging d’applications :** <https://yunohost.org/packaging_apps>
|
|
@ -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/)).
|
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.
|
Restic is a backup tool that can make local and remote backups.
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
"id": "restic",
|
"id": "restic",
|
||||||
"packaging_format": 1,
|
"packaging_format": 1,
|
||||||
"description": {
|
"description": {
|
||||||
"en": "Backup your server with restic.",
|
"en": "Backup your server with Restic",
|
||||||
"fr": "Sauvegardez votre serveur avec restic."
|
"fr": "Sauvegardez votre serveur avec Restic"
|
||||||
},
|
},
|
||||||
"version": "0.12.0~ynh9",
|
"version": "0.12.0~ynh9",
|
||||||
"url": "https://restic.net/",
|
"url": "https://restic.net/",
|
||||||
|
|
|
@ -76,6 +76,7 @@ ynh_configure check_method "${final_path}/check_method_${app}"
|
||||||
# SETUP LOG SCRIPTS
|
# SETUP LOG SCRIPTS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up backup log script"
|
ynh_script_progression --message="Setting up backup log script"
|
||||||
|
|
||||||
ynh_configure restic_log "${final_path}/restic_log_${app}"
|
ynh_configure restic_log "${final_path}/restic_log_${app}"
|
||||||
chmod +x "${final_path}/restic_log_${app}"
|
chmod +x "${final_path}/restic_log_${app}"
|
||||||
chown ${app}: "${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
|
# GENERATE SSH KEY
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Generating private key"
|
ynh_script_progression --message="Generating private key"
|
||||||
|
|
||||||
ssh_dir="/root/.ssh"
|
ssh_dir="/root/.ssh"
|
||||||
if [ ! -d "${ssh_dir}" ];then
|
if [ ! -d "${ssh_dir}" ];then
|
||||||
mkdir -p "${ssh_dir}"
|
mkdir -p "${ssh_dir}"
|
||||||
|
@ -164,12 +166,11 @@ ynh_script_progression --message="You should now allow the following public key
|
||||||
|
|
||||||
$(cat ${private_key}.pub)"
|
$(cat ${private_key}.pub)"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SEND A README FOR THE ADMIN
|
# SEND A README FOR THE ADMIN
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Sending post-installation instructions to admin" --last
|
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}:
|
message="You should now allow the following public key for user ${ssh_user} on server ${server}:
|
||||||
$(cat ${private_key}.pub)
|
$(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"
|
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_send_readme_to_admin "$message" "root"
|
||||||
ynh_print_ON
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -30,11 +30,9 @@ export data=$(ynh_app_setting_get $app data)
|
||||||
export apps=$(ynh_app_setting_get $app apps)
|
export apps=$(ynh_app_setting_get $app apps)
|
||||||
export allow_extra_space_use=$(ynh_app_setting_get $app allow_extra_space_use)
|
export allow_extra_space_use=$(ynh_app_setting_get $app allow_extra_space_use)
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Checking version..."
|
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
upgrade_type=$(ynh_check_app_version_changed)
|
||||||
|
|
||||||
|
@ -64,12 +62,14 @@ fi
|
||||||
# INSTALL RESTIC
|
# INSTALL RESTIC
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing restic binary" --weight=7
|
ynh_script_progression --message="Installing restic binary" --weight=7
|
||||||
|
|
||||||
install_restic
|
install_restic
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE APP USER
|
# CREATE APP USER
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Creating user ${app}"
|
ynh_script_progression --message="Creating user ${app}"
|
||||||
|
|
||||||
id ${app} 2>/dev/null || useradd -m ${app}
|
id ${app} 2>/dev/null || useradd -m ${app}
|
||||||
ynh_script_progression --message="Configure ${app} user sudoer rights"
|
ynh_script_progression --message="Configure ${app} user sudoer rights"
|
||||||
cat > /tmp/${app}_sudoer << EOSUDOER
|
cat > /tmp/${app}_sudoer << EOSUDOER
|
||||||
|
@ -106,6 +106,7 @@ chown -R ${app}: /home/${app}
|
||||||
# ACTIVATE BACKUP METHODS
|
# ACTIVATE BACKUP METHODS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Activating backup methods"
|
ynh_script_progression --message="Activating backup methods"
|
||||||
|
|
||||||
mkdir -p /etc/yunohost/hooks.d/backup_method
|
mkdir -p /etc/yunohost/hooks.d/backup_method
|
||||||
mkdir -p /usr/share/yunohost/backup_method
|
mkdir -p /usr/share/yunohost/backup_method
|
||||||
|
|
||||||
|
@ -113,6 +114,7 @@ mkdir -p /usr/share/yunohost/backup_method
|
||||||
# SETUP THE BACKUP METHOD
|
# SETUP THE BACKUP METHOD
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up backup methods"
|
ynh_script_progression --message="Setting up backup methods"
|
||||||
|
|
||||||
ynh_configure backup_method "/etc/yunohost/hooks.d/backup_method/05-${app}_app"
|
ynh_configure backup_method "/etc/yunohost/hooks.d/backup_method/05-${app}_app"
|
||||||
ynh_configure check_method "${final_path}/check_method_${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
|
# SETUP LOG SCRIPTS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up backup log script"
|
ynh_script_progression --message="Setting up backup log script"
|
||||||
|
|
||||||
ynh_configure restic_log "${final_path}/restic_log_${app}"
|
ynh_configure restic_log "${final_path}/restic_log_${app}"
|
||||||
chmod +x "${final_path}/restic_log_${app}"
|
chmod +x "${final_path}/restic_log_${app}"
|
||||||
chown ${app}: "${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
|
# CONFIGURE CRON
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring cron" --weight=5
|
ynh_script_progression --message="Configuring cron" --weight=5
|
||||||
|
|
||||||
ynh_configure backup-with-restic "/usr/local/bin/backup-with-${app}"
|
ynh_configure backup-with-restic "/usr/local/bin/backup-with-${app}"
|
||||||
ynh_configure check-restic "${final_path}/check-${app}"
|
ynh_configure check-restic "${final_path}/check-${app}"
|
||||||
chmod +x "/usr/local/bin/backup-with-${app}"
|
chmod +x "/usr/local/bin/backup-with-${app}"
|
||||||
|
@ -189,6 +193,7 @@ fi
|
||||||
# SETUP LOGROTATE
|
# SETUP LOGROTATE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring 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}.log
|
||||||
ynh_use_logrotate --logfile=/var/log/restic_backup_${app}.err
|
ynh_use_logrotate --logfile=/var/log/restic_backup_${app}.err
|
||||||
ynh_use_logrotate --logfile=/var/log/restic_check_${app}.log
|
ynh_use_logrotate --logfile=/var/log/restic_check_${app}.log
|
||||||
|
|
Loading…
Add table
Reference in a new issue