1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tinyfilemanager_ynh.git synced 2024-09-03 20:36:01 +02:00

Update restore

This commit is contained in:
jarod5001 2022-05-16 21:28:53 +01:00 committed by GitHub
parent 415cf5eb87
commit 4b4ce4163e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,11 +34,8 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
# db_name=$(ynh_app_setting_get --app=$app --key=db_name)
# db_user=$db_name
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
# datadir=$(ynh_app_setting_get --app=$app --key=datadir)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
password=$(ynh_app_setting_get --app=$app --key=password)
admin=$(ynh_app_setting_get --app=$app --key=admin)
language=$(ynh_app_setting_get --app=$app --key=language)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
@ -85,11 +82,11 @@ chown -R $app:www-data "$final_path"
#=================================================
# RESTORE THE DATA DIRECTORY
#=================================================
# ynh_script_progression --message="Restoring the data directory..." --time --weight=1
ynh_script_progression --message="Restoring the data directory..." --time --weight=1
# ynh_restore_file --origin_path="$datadir" --not_mandatory
ynh_restore_file --origin_path="$datadir" --not_mandatory
# mkdir -p $datadir
mkdir -p $datadir
# FIXME: this should be managed by the core in the future
# Here, as a packager, you may have to tweak the ownerhsip/permissions
@ -97,9 +94,9 @@ chown -R $app:www-data "$final_path"
# files in some cases.
# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder -
# this will be treated as a security issue.
# chmod 750 "$datadir"
# chmod -R o-rwx "$datadir"
# chown -R $app:www-data "$datadir"
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"
#=================================================
@ -157,9 +154,9 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..." --time --weight=1
# ynh_script_progression --message="Restoring the logrotate configuration..." --time --weight=1
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
# ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# INTEGRATE SERVICE IN YUNOHOST