diff --git a/scripts/backup b/scripts/backup index b1eb5ac..fe9b9f8 100644 --- a/scripts/backup +++ b/scripts/backup @@ -25,7 +25,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) admin=$(ynh_app_setting_get --app=$app --key=admin) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -38,19 +37,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="$datadir" --is_big - #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= diff --git a/scripts/install b/scripts/install index e92b003..5f184be 100644 --- a/scripts/install +++ b/scripts/install @@ -70,6 +70,7 @@ ynh_setup_source --dest_dir="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +chmod -R ga+w "$final_path/data" #================================================= # NGINX CONFIGURATION @@ -88,21 +89,6 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 ynh_add_fpm_config --package="$extra_php_dependencies" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -#================================================= -# CREATE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Creating a data directory..." --weight=1 - -datadir=/home/yunohost.app/$app -ynh_app_setting_set --app=$app --key=datadir --value=$datadir - -mkdir -p $datadir -cp -r ../empty_library $datadir - -chmod 750 "$datadir" -#chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" -chmod -R ga+w "$datadir" # Disable BicBucStriim login if checked if [[ $login -eq 1 ]]; then diff --git a/scripts/remove b/scripts/remove index 81c1653..d1e820b 100644 --- a/scripts/remove +++ b/scripts/remove @@ -18,7 +18,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) admin=$(ynh_app_setting_get --app=$app --key=admin) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= @@ -29,14 +28,6 @@ ynh_script_progression --message="Removing app main directory..." --weight=4 # Remove the app directory securely ynh_secure_remove --file="$final_path" -#================================================= -# REMOVE CALIBRE LIBRARY -#================================================= -ynh_script_progression --message="Removing app main directory..." --weight=4 - -# Remove the app directory securely -ynh_secure_remove --file="$datadir" - #================================================= # REMOVE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index 538d9e0..54a018c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -27,7 +27,6 @@ domain=$(ynh_app_setting_get "$app" domain) path_url=$(ynh_app_setting_get --app=$app --key=path) admin=$(ynh_app_setting_get "$app" admin) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= @@ -66,14 +65,7 @@ ynh_restore_file --origin_path="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" - -#================================================= -# RESTORE USER RIGHTS -#================================================= - -# you may need to make some file and/or directory writeable by www-data (nginx user) -chown -R root: "$final_path" -chown -R $admin "$datadir" +chmod -R ga+w "$final_path/data" #================================================= # RESTORE THE PHP-FPM CONFIGURATION @@ -84,23 +76,6 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_add_fpm_config --package="$extra_php_dependencies" - -#================================================= -# RESTORE THE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Restoring the data directory..." --time --weight=1 - -ynh_restore_file --origin_path="$datadir" --not_mandatory - -mkdir -p $datadir - -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" - -books_path=/home/$admin/calibre_library -cp -a ./data "$books_path" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index e018598..c2f5b21 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,7 +21,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) path_url=$(ynh_app_setting_get --app=$app --key=path) admin=$(ynh_app_setting_get "$app" admin) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # CHECK VERSION @@ -86,6 +85,7 @@ fi chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +chmod -R ga+w "$final_path/data" #================================================= # NGINX CONFIGURATION