diff --git a/README.md b/README.md index 08f26cf..1033984 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -Photo-management-system to manage and share photos. +Photo-management-system to manage and share photos **Shipped version:** 4.3.4~ynh1 @@ -28,7 +28,6 @@ Photo-management-system to manage and share photos. ## Documentation and resources * Official app website: https://lycheeorg.github.io/ -* Official user documentation: https://yunohost.org/en/app_lychee * Official admin documentation: https://lycheeorg.github.io/docs/ * Upstream app code repository: https://github.com/LycheeOrg/Lychee * YunoHost documentation for this app: https://yunohost.org/app_lychee diff --git a/README_fr.md b/README_fr.md index d21012d..9d7c997 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble -Système de gestion de photos pour gérer et partager des photos. +Système de gestion de photos pour gérer et partager des photos **Version incluse :** 4.3.4~ynh1 @@ -24,7 +24,6 @@ Système de gestion de photos pour gérer et partager des photos. ## Documentations et ressources * Site officiel de l'app : https://lycheeorg.github.io/ -* Documentation officielle utilisateur : https://yunohost.org/en/app_lychee * Documentation officielle de l'admin : https://lycheeorg.github.io/docs/ * Dépôt de code officiel de l'app : https://github.com/LycheeOrg/Lychee * Documentation YunoHost pour cette app : https://yunohost.org/app_lychee diff --git a/conf/.env.example b/conf/.env.example index 8d1f843..8c39b67 100644 --- a/conf/.env.example +++ b/conf/.env.example @@ -33,7 +33,7 @@ TIMEZONE=UTC # folders in which the files will be stored LYCHEE_DIST="__FINALPATH__/public/dist/" -LYCHEE_UPLOADS="__PUBLIC_PATH__/uploads/" +LYCHEE_UPLOADS="__DATADIR__/uploads/" # url to access those files # LYCHEE_DIST_URL="dist/" diff --git a/conf/nginx.conf b/conf/nginx.conf index b1dd405..508f7a4 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -31,7 +31,7 @@ location ^~ __PATH__/ { } location __PATH__/uploads/ { - alias __PUBLIC_PATH__/uploads/ ; + alias __DATADIR__/uploads/ ; } # Include SSOWAT user panel. diff --git a/manifest.json b/manifest.json index 9d06b3e..4e6f4f7 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "lychee", "packaging_format": 1, "description": { - "en": "Photo-management-system to manage and share photos.", - "fr": "Système de gestion de photos pour gérer et partager des photos." + "en": "Photo-management-system to manage and share photos", + "fr": "Système de gestion de photos pour gérer et partager des photos" }, "version": "4.3.4~ynh1", "url": "https://lycheeorg.github.io/", @@ -13,7 +13,6 @@ "website": "https://lycheeorg.github.io/", "demo": "https://lycheeorg.github.io/demo/", "admindoc": "https://lycheeorg.github.io/docs/", - "userdoc": "https://yunohost.org/en/app_lychee", "code": "https://github.com/LycheeOrg/Lychee" }, "license": "MIT", @@ -22,7 +21,7 @@ "email": "" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ @@ -34,8 +33,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "path", diff --git a/scripts/_common.sh b/scripts/_common.sh index 2d29ec5..a6f73f7 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,9 +9,7 @@ YNH_PHP_VERSION="7.4" # Composer version YNH_COMPOSER_VERSION="2.1.3" -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 php${YNH_PHP_VERSION}-intl" - -pkg_dependencies="ffmpeg" +pkg_dependencies="ffmpeg 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 php${YNH_PHP_VERSION}-intl" # # needed for raw upload and video playback # # ufraw-batch is not supported in bullseye diff --git a/scripts/backup b/scripts/backup index f57412d..56014a2 100755 --- a/scripts/backup +++ b/scripts/backup @@ -24,7 +24,7 @@ ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) -public_path=$(ynh_app_setting_get --app=$app --key=public_path) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) 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) @@ -44,7 +44,7 @@ ynh_backup --src_path="$final_path" # BACKUP MEDIA FOLDER #================================================= -ynh_backup --src_path="$public_path" --is_big +ynh_backup --src_path="$datadir" --is_big #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/change_url b/scripts/change_url index f76a1eb..4f82112 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -31,7 +31,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) -public_path=$(ynh_app_setting_get --app=$app --key=public_path) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP diff --git a/scripts/install b/scripts/install index 6e55c2f..ae4af78 100755 --- a/scripts/install +++ b/scripts/install @@ -88,15 +88,15 @@ chown -R $app:www-data "$final_path" #================================================= ynh_script_progression --message="Creating a data directory..." --weight=1 -public_path=/home/yunohost.app/$app -ynh_app_setting_set --app=$app --key=public_path --value=$public_path +datadir=/home/yunohost.app/$app +ynh_app_setting_set --app=$app --key=datadir --value=$datadir -mkdir -p $public_path/uploads -mkdir -p $public_path/uploads/{big,import,medium,raw,small,thumb} +mkdir -p $datadir/uploads +mkdir -p $datadir/uploads/{big,import,medium,raw,small,thumb} -chmod 750 "$public_path" -chmod -R o-rwx "$public_path" -chown -R $app:www-data "$public_path" +chmod 750 "$datadir" +chmod -R o-rwx "$datadir" +chown -R $app:www-data "$datadir" #================================================= # NGINX CONFIGURATION @@ -112,7 +112,7 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=low --footprint=low phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/remove b/scripts/remove index c6c1d45..08d2f7a 100755 --- a/scripts/remove +++ b/scripts/remove @@ -18,7 +18,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -public_path=$(ynh_app_setting_get --app=$app --key=public_path) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name @@ -32,6 +32,17 @@ ynh_script_progression --message="Removing app main directory..." --weight=3 # Remove the app directory securely ynh_secure_remove --file="$final_path" +#================================================= +# REMOVE DATA DIR +#================================================= + +# Remove the app data directory with the command `yunohost app remove --purge` +if [ "$YNH_APP_PURGE" == true ] +then + ynh_script_progression --message="Removing $app data directory..." --weight=2 + ynh_secure_remove --file="$datadir" +fi + #================================================= # REMOVE THE MYSQL DATABASE #================================================= diff --git a/scripts/restore b/scripts/restore index 24fbb9d..b025430 100755 --- a/scripts/restore +++ b/scripts/restore @@ -25,7 +25,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -public_path=$(ynh_app_setting_get --app=$app --key=public_path) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) @@ -72,11 +72,13 @@ chown -R $app:www-data "$final_path" ynh_script_progression --message="Restoring the data directory..." # 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="$public_path" --not_mandatory +ynh_restore_file --origin_path="$datadir" --not_mandatory -chmod 755 "$public_path" -chmod -R o-rwx "$public_path" -chown -R $app:www-data "$public_path" +mkdir -p $datadir + +chmod 755 "$datadir" +chmod -R o-rwx "$datadir" +chown -R $app:www-data "$datadir" #================================================= # REINSTALL DEPENDENCIES @@ -95,7 +97,7 @@ ynh_script_progression --message="Restoring PHP-FPM configuration..." ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" # Recreate a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=low --footprint=low #================================================= # RESTORE THE MYSQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index abe95fa..432d9f1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,7 +19,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -public_path=$(ynh_app_setting_get --app=$app --key=public_path) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) phpversion=$YNH_PHP_VERSION @@ -61,14 +61,14 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi -# If new public_path doesn't exist, create it +# If new datadir doesn't exist, create it if [ -z "/home/yunohost.app/$app" ]; then - public_path=/home/yunohost.app/$app - mkdir -p $public_path - chmod 755 $public_path - chown -R $app:www-data $public_path - ynh_app_setting_set --app=$app --key=public_path --value=$public_path - cp -a "$final_path/public/uploads" "$public_path/uploads" + datadir=/home/yunohost.app/$app + mkdir -p $datadir + chmod 755 $datadir + chown -R $app:www-data $datadir + ynh_app_setting_set --app=$app --key=datadir --value=$datadir + cp -a "$final_path/public/uploads" "$datadir/uploads" fi # Cleaning legacy permissions @@ -132,7 +132,7 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=low --footprint=low #================================================= # PHP-FPM CONFIGURATION