diff --git a/scripts/_common.sh b/scripts/_common.sh index 1596010..c763bbb 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,11 +8,14 @@ YNH_PHP_VERSION=7.4 extra_php_dependencies="php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-exif php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-mysqli php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-zip" +# needed for raw upload and video playback +pkg_dependencies="ufraw-batch ffmpeg" + #================================================= # EXPERIMENTAL HELPERS #================================================= -readonly YNH_DEFAULT_COMPOSER_VERSION=1.10.17 +readonly YNH_DEFAULT_COMPOSER_VERSION=2.0.8 #1.10.17 # Declare the actual composer version to use. # A packager willing to use another version of composer can override the variable into its _common.sh. YNH_COMPOSER_VERSION=${YNH_COMPOSER_VERSION:-$YNH_DEFAULT_COMPOSER_VERSION} diff --git a/scripts/backup b/scripts/backup index e7ee942..65067e1 100755 --- a/scripts/backup +++ b/scripts/backup @@ -38,7 +38,7 @@ ynh_backup --src_path="$final_path" # BACKUP MEDIA FOLDER #================================================= -#ynh_backup --src_path="/home/yunohost.$app" --is_big +ynh_backup --src_path="/home/yunohost.$app" --is_big #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/remove b/scripts/remove index 17714d2..3d5a1ba 100755 --- a/scripts/remove +++ b/scripts/remove @@ -39,6 +39,14 @@ ynh_script_progression --message="Removing the MySQL database..." --weight=2 # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=2 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # REMOVE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index c0296af..12ecb3c 100755 --- a/scripts/restore +++ b/scripts/restore @@ -54,6 +54,13 @@ ynh_script_progression --message="Restoring Lychee main directory..." --weight=2 ynh_restore_file --origin_path="$final_path" +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=3 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -65,10 +72,10 @@ ynh_system_user_create --username=$app #================================================= # RESTORE DATA #================================================= -#ynh_script_progression --message="Restoring Lychee data..." +ynh_script_progression --message="Restoring Lychee data..." # Use --not_mandatory for the data directory, because if the backup has been made with BACKUP_CORE_ONLY, there's no data into the backup. -#ynh_restore_file --origin_path="/home/yunohost.$app" --not_mandatory +ynh_restore_file --origin_path="/home/yunohost.$app" --not_mandatory #================================================= # RESTORE USER RIGHTS @@ -76,7 +83,7 @@ ynh_system_user_create --username=$app # Restore permissions on app files chown -R $app: $final_path -#chmod -R 750 /home/yunohost.$app/{uploads,data} +chmod -R 750 /home/yunohost.$app #================================================= # RESTORE THE PHP-FPM CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 1f5c1f6..144f4b0 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -95,6 +95,13 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=3 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # CREATE DEDICATED USER #================================================= @@ -121,8 +128,7 @@ ynh_script_progression --message="Installing Composer..." --weight=10 # Install Composer ynh_install_composer -ynh_exec_warn_less ynh_composer_exec --phpversion="$phpversion" --workdir="$final_path" --commands=\"dump-autoload\" -ynh_exec_warn_less ynh_composer_exec --phpversion="$phpversion" --workdir="$final_path" --commands="update --lock" +ynh_exec_warn_less ynh_composer_exec --commands=\"dump-autoload\" pushd "$final_path" php$phpversion artisan migrate -n --force @@ -140,7 +146,7 @@ ynh_store_file_checksum --file="$final_path/.env" # Set permissions on app files chown -R $app: $final_path -#chmod -R 750 /home/yunohost.$app/{uploads,data} +chmod -R 750 /home/yunohost.$app #================================================= # RELOAD NGINX