1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/grav_ynh.git synced 2024-09-03 19:16:01 +02:00

Actually disable in-app backup, do not backup backups nor cache

This commit is contained in:
tituspijean 2024-04-17 22:17:59 +02:00
parent 470a1e8c5b
commit 88cd1ba5b7
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720
5 changed files with 26 additions and 2 deletions

4
conf/scheduler.yaml Normal file
View file

@ -0,0 +1,4 @@
status:
cache-purge: disabled
cache-clear: disabled
default-site-backup: disabled

View file

@ -0,0 +1,5 @@
Before v1.7.45~ynh3 of this package, an upstream quirk made the app generate a backup daily, despite the default configuration suggesting it to be disabled.
Starting this version, if you had not already altered the Scheduler configuration, this is fixed.
The backups directory is also not backed up by YunoHost anymore, as it was superfluous.

View file

@ -19,7 +19,10 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_backup --src_path="$install_dir" # Backup install_dir except backup and cache directory
for f in $(ls "$install_dir" -I backup -I cache); do
ynh_backup --src_path="${install_dir}/$f"
done
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # BACKUP THE NGINX CONFIGURATION

View file

@ -58,7 +58,12 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_exec_as $app mkdir -p "$install_dir/user/config/plugins/login-ldap" ynh_exec_as $app mkdir -p "$install_dir/user/config/plugins/login-ldap"
ynh_exec_as $app touch "$install_dir/user/accounts/admin.yaml" ynh_exec_as $app touch "$install_dir/user/accounts/admin.yaml"
# Setting up config # Setting up scheduler config
ynh_add_config --template="../conf/scheduler.yaml" --destination="$install_dir/user/config/scheduler.yaml"
chown $app:$app "$install_dir/user/config/scheduler.yaml"
chmod 640 "$install_dir/user/config/scheduler.yaml"
# Setting up LDAP config
ynh_add_config --template="../conf/login-ldap.yaml" --destination="$install_dir/user/config/plugins/login-ldap.yaml" ynh_add_config --template="../conf/login-ldap.yaml" --destination="$install_dir/user/config/plugins/login-ldap.yaml"
chown $app:$app "$install_dir/user/config/plugins/login-ldap.yaml" chown $app:$app "$install_dir/user/config/plugins/login-ldap.yaml"
chmod 640 "$install_dir/user/config/plugins/login-ldap.yaml" chmod 640 "$install_dir/user/config/plugins/login-ldap.yaml"

View file

@ -29,6 +29,13 @@ if [ -z "${with_sftp:-}" ] || [ -z "${password:-}" ]; then
ynh_app_setting_set --app=$app --key=password --value=$(ynh_string_random) ynh_app_setting_set --app=$app --key=password --value=$(ynh_string_random)
fi fi
# Setup the scheduler config if it is missing from user directory
if [ ! -f "$install_dir/user/config/scheduler.yaml" ]; then
ynh_add_config --template="../conf/scheduler.yaml" --destination="$install_dir/user/config/scheduler.yaml"
chown $app:$app "$install_dir/user/config/scheduler.yaml"
chmod 640 "$install_dir/user/config/scheduler.yaml"]
fi
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================