1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cac-proxy_ynh.git synced 2024-09-03 18:16:07 +02:00

Fix for backup error

This commit is contained in:
Gérard Collin 2023-09-28 10:56:24 +02:00
parent 03fbfe5045
commit e056804820
3 changed files with 20 additions and 10 deletions

View file

@ -6,7 +6,7 @@
"en": "An advanced https proxy allowing you to call other websites from your own web application.", "en": "An advanced https proxy allowing you to call other websites from your own web application.",
"fr": "Un proxy https avancé vous permettant d'appeler d'autres sites depuis votre propre application web." "fr": "Un proxy https avancé vous permettant d'appeler d'autres sites depuis votre propre application web."
}, },
"version": "1.2.0~ynh1", "version": "1.2.0~ynh2",
"url": "https://github.com/gcollin/cookie-aware-cors-proxy", "url": "https://github.com/gcollin/cookie-aware-cors-proxy",
"upstream": { "upstream": {
"license": "MIT", "license": "MIT",

View file

@ -30,6 +30,7 @@ app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
public_key=$(ynh_app_setting_get --app=$app --key=public_key)
#================================================= #=================================================
# DECLARE DATA AND CONF FILES TO BACKUP # DECLARE DATA AND CONF FILES TO BACKUP
@ -56,8 +57,10 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# SPECIFIC BACKUP # SPECIFIC BACKUP
#================================================= #=================================================
if [ -n "$public_key" ]
then
ynh_backup --src_path="/etc/sudoers.d/$app-sudoers" ynh_backup --src_path="/etc/sudoers.d/$app-sudoers"
fi
# BACKUP LOGROTATE # BACKUP LOGROTATE
#================================================= #=================================================

View file

@ -38,6 +38,10 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
# There is an issue in previous backup file in case of non public_key, so backup only in case of public_key
if [ -n "$public_key" ]
then
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1
# Backup the current version of the app # Backup the current version of the app
@ -46,9 +50,12 @@ ynh_clean_setup () {
# Restore it if the upgrade fails # Restore it if the upgrade fails
ynh_restore_upgradebackup ynh_restore_upgradebackup
} }
fi
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
#================================================= #=================================================