1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00
This commit is contained in:
ericgaspar 2022-01-15 08:54:33 +01:00
parent 9ec3cba116
commit a09bef241f
3 changed files with 33 additions and 5 deletions

View file

@ -30,6 +30,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
cache_dir=$(ynh_app_setting_get --app=$app --key=cache_dir)
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
@ -42,6 +43,12 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$final_path"
#=================================================
# BACKUP THE DATA DIR
#=================================================
ynh_backup --src_path="$cache_dir" --is_big
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================

View file

@ -146,16 +146,25 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=12
ynh_add_systemd_config
#=================================================
# CREATE DATA DIRECTORY
#=================================================
ynh_script_progression --message="Creating a data directory..." --weight=1
cache_dir=/home/yunohost.app/$app
ynh_app_setting_set --app=$app --key=cache_dir --value=$cache_dir
mkdir -p $cache_dir
chmod 750 "$cache_dir"
chmod -R o-rwx "$cache_dir"
chown -R $app:www-data "$cache_dir"
#=================================================
# SET-UP DATABASE AND CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring Movim..." --weight=1
# Create cachedir folder
cache_dir="/home/yunohost.app/$app"
mkdir -p $cache_dir
chown -R $app:www-data "$final_path"
pushd $final_path
php$phpversion composer.phar $app:migrate --quiet
#php$phpversion daemon.php setAdmin $admin@${maindomain}

View file

@ -21,6 +21,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
cache_dir=$(ynh_app_setting_get --app=$app --key=cache_dir)
#=================================================
# STANDARD REMOVE
@ -83,6 +84,17 @@ ynh_script_progression --message="Removing Movim cache directory..." --weight=6
# Remove the app directory securely
ynh_secure_remove --file="/home/yunohost.app/$app"
#=================================================
# REMOVE DATA DIR
#=================================================
# Remove the data directory if --purge option is used
if [ "${YNH_APP_PURGE:-0}" -eq 1 ]
then
ynh_script_progression --message="Removing app data directory..." --weight=1
ynh_secure_remove --file="$cache_dir"
fi
#=================================================
# REMOVE PHP-FPM CONFIGURATION
#=================================================