1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/shaarli_ynh.git synced 2024-09-03 20:26:10 +02:00
shaarli_ynh/scripts/backup
lapineige 33d286fcf9
Testing : update to 0.12.0, nginx fix, other fixes (#58)
* Set file permissions after creating the log (#53)

Should fix #49

* Updated to V0.12.0 and Nginx fix (#57)

* Set file permissions after creating the log (#53) (#54)

Should fix #49

Authored-by: tituspijean <tituspijean@outlook.com>

* Updated to version v0.12.0

* Fix images

* Fixed path in nginx

Co-authored-by: lapineige <lapineige@users.noreply.github.com>
Co-authored-by: anmol <anmol@jswan2.com>
Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

* Update README.md

* rm -r -> ynh_secure_remove (#59)

* Update issue_template.md

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

* Update openssl dependency

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

* Update _common.sh

- Remove unused script that generates an error
- Remove openssl that is part of PHP as default

* Cleaning up

* Fix linter warnings

* Small typos (#60)

* Patch2 (#61)

- Fix NGINX 302 redirect
- Fix missing upgrade_type in upgrade script
- Add ynh_smart_mktemp helper

* Fix NGINX

* Re-implement automatic post-installation

* Ensure file and directories permissions in upgrade

* Replace all ynh_print_info with ynh_script_progression

* Update check_process

* Use permissions system

Co-authored-by: tituspijean <tituspijean@outlook.com>
Co-authored-by: anmol26s <5068843+anmol26s@users.noreply.github.com>
Co-authored-by: anmol <anmol@jswan2.com>
Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: ericgaspar <junk.eg@free.fr>
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
2020-11-30 09:43:42 +01:00

77 lines
2.5 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
### Remove this function if there's nothing to clean before calling the remove script.
true
}
# 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)
domain=$(ynh_app_setting_get --app=$app --key=domain)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_backup --src_path="$final_path"
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP THE PHP-FPM CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================
ynh_backup --src_path="/etc/logrotate.d/$app"
#=================================================
# BACKUP FAIL2BAN CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."