1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lychee_ynh.git synced 2024-09-03 19:36:36 +02:00
* cleaning

* Update upgrade

* break lines

* SC2154 fixes

* Auto-update README

* fix paths

* typo

---------

Co-authored-by: OniriCorpe <oniricorpe@disroot.org>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
This commit is contained in:
eric_G 2024-02-13 09:04:46 +01:00 committed by GitHub
parent 1aded142eb
commit ac44f3e38a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 64 additions and 127 deletions

View file

@ -16,7 +16,10 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
## Overview ## Overview
Lychee is a free photo-management tool, which runs on your server or web-space. Upload, manage and share photos like from a native application. Lychee comes with everything you need and all your photos are stored securely. Lychee is a free photo-management tool, which runs on your server or web-space.
Upload, manage and share photos like from a native application.
Lychee comes with everything you need and all your photos are stored securely.
**Shipped version:** 5.1.2~ynh2 **Shipped version:** 5.1.2~ynh2

View file

@ -16,7 +16,9 @@ Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po
## Vue densemble ## Vue densemble
Lychee est un outil de gestion de photos, qui s'exécute sur votre serveur ou espace Web. Téléchargez, gérez et partagez des photos comme à partir d'une application native. Lychee est livré avec tout ce dont vous avez besoin et toutes vos photos sont stockées en toute sécurité. Lychee est un outil de gestion de photos, qui s'exécute sur votre serveur ou espace Web.
Téléchargez, gérez et partagez des photos comme à partir d'une application native.
Lychee est livré avec tout ce dont vous avez besoin et toutes vos photos sont stockées en toute sécurité.
**Version incluse :** 5.1.2~ynh2 **Version incluse :** 5.1.2~ynh2

View file

@ -1,13 +0,0 @@
diff --git a/vendor/lychee-org/php-exif/lib/PHPExif/Adapter/FFprobe.php b/vendor/lychee-org/php-exif/lib/PHPExif/Adapter/FFprobe.php
index 9ececfe..106eadd 100644
--- a/vendor/lychee-org/php-exif/lib/PHPExif/Adapter/FFprobe.php
+++ b/vendor/lychee-org/php-exif/lib/PHPExif/Adapter/FFprobe.php
@@ -40,7 +40,7 @@ class FFprobe extends AdapterAbstract
*
* @var string
*/
- protected string $toolPath = '';
+ protected string $toolPath = '/usr/bin/ffprobe';
/**
* @var string-e

View file

@ -1,23 +0,0 @@
/* Disable the 'zoom' animation while browsing pictures */
#imageview #image {
transition: none !important;
animation-name: none !important;
animation-duration: 0 !important;
}
/* Hide smart albums */
/*
[data-id="0"] { display:none; }
[data-id="s"] { display:none; }
[data-id="f"] { display:none; }
[data-id="r"] { display:none; }
*/
/* Make the diadnostic font bigger */
.settings_view p, .settings_view a, .settings_view input,
.sharing_view p, .sharing_view a, .sharing_view input, .sharing_view option,
.users_view p, .users_view a, .users_view input, .users_view option,
.logs_diagnostics_view pre {
font-size: 12pt;
line-height: 14pt;
}

View file

@ -1 +1,3 @@
Lychee is a free photo-management tool, which runs on your server or web-space. Upload, manage and share photos like from a native application. Lychee comes with everything you need and all your photos are stored securely. Lychee is a free photo-management tool, which runs on your server or web-space.
Upload, manage and share photos like from a native application.
Lychee comes with everything you need and all your photos are stored securely.

View file

@ -1 +1,3 @@
Lychee est un outil de gestion de photos, qui s'exécute sur votre serveur ou espace Web. Téléchargez, gérez et partagez des photos comme à partir d'une application native. Lychee est livré avec tout ce dont vous avez besoin et toutes vos photos sont stockées en toute sécurité. Lychee est un outil de gestion de photos, qui s'exécute sur votre serveur ou espace Web.
Téléchargez, gérez et partagez des photos comme à partir d'une application native.
Lychee est livré avec tout ce dont vous avez besoin et toutes vos photos sont stockées en toute sécurité.

View file

@ -15,8 +15,8 @@ ynh_abort_if_errors
# RETRIEVE ARGUMENTS # RETRIEVE ARGUMENTS
#================================================= #=================================================
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
current_fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) current_fpm_footprint=$(ynh_app_setting_get --app="$app" --key=fpm_footprint)
#================================================= #=================================================
# SPECIFIC GETTERS FOR TOML SHORT KEY # SPECIFIC GETTERS FOR TOML SHORT KEY
@ -52,14 +52,14 @@ get__free_footprint() {
set__fpm_footprint() { set__fpm_footprint() {
if [ "$fpm_footprint" != "specific" ] if [ "$fpm_footprint" != "specific" ]
then then
ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_footprint" ynh_app_setting_set --app="$app" --key=fpm_footprint --value="$fpm_footprint"
fi fi
} }
set__fpm_free_footprint() { set__fpm_free_footprint() {
if [ "$fpm_footprint" = "specific" ] if [ "$fpm_footprint" = "specific" ]
then then
ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_free_footprint" ynh_app_setting_set --app="$app" --key=fpm_footprint --value="$fpm_free_footprint"
fi fi
} }
@ -89,7 +89,7 @@ ynh_app_config_validate() {
ynh_app_config_apply() { ynh_app_config_apply() {
_ynh_app_config_apply _ynh_app_config_apply
ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint ynh_add_fpm_config --phpversion="$phpversion" --usage="$fpm_usage" --footprint="$fpm_footprint"
} }
ynh_app_config_run $1 ynh_app_config_run "$1"

View file

@ -13,10 +13,6 @@ source /usr/share/yunohost/helpers
# RETRIEVE ARGUMENTS FROM THE MANIFEST # RETRIEVE ARGUMENTS FROM THE MANIFEST
#================================================= #=================================================
fpm_footprint="low"
fpm_free_footprint=0
fpm_usage="low"
timezone="$(cat /etc/timezone)" timezone="$(cat /etc/timezone)"
#================================================= #=================================================
@ -25,15 +21,7 @@ timezone="$(cat /etc/timezone)"
ynh_script_progression --message="Installing dependencies..." --weight=7 ynh_script_progression --message="Installing dependencies..." --weight=7
# Install Nodejs # Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version"
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -45,9 +33,9 @@ ynh_setup_source --dest_dir="$install_dir"
chmod 750 "$install_dir/bootstrap/cache" chmod 750 "$install_dir/bootstrap/cache"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R "$app:www-data" "$install_dir"
chown -R $app: "$install_dir/public/sym/" chown -R "$app:" "$install_dir/public/sym/"
chmod -R 755 $data_dir chmod -R 755 "$data_dir"
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
@ -55,7 +43,7 @@ chmod -R 755 $data_dir
ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint ynh_add_fpm_config
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
@ -67,8 +55,8 @@ ynh_add_nginx_config
#================================================= #=================================================
ynh_script_progression --message="Creating a data directory..." --weight=1 ynh_script_progression --message="Creating a data directory..." --weight=1
chgrp $app -R $install_dir/storage $install_dir/public/dist $install_dir/public/sym $data_dir/uploads chgrp "$app" -R "$install_dir/storage" "$install_dir/public/dist" "$install_dir/public/sym" "$data_dir/uploads"
chmod -R 2775 $install_dir/storage/* $install_dir/app/* $install_dir/public/dist $install_dir/public/sym $data_dir/uploads $install_dir/bootstrap/ chmod -R 2775 "$install_dir/storage" "$install_dir/app" "$install_dir/public/dist" "$install_dir/public/sym" "$data_dir/uploads" "$install_dir/bootstrap/"
#================================================= #=================================================
# INSTALL APP WITH COMPOSER # INSTALL APP WITH COMPOSER
@ -82,10 +70,10 @@ ynh_install_composer
#================================================= #=================================================
ynh_script_progression --message="Installing $app..." --weight=10 ynh_script_progression --message="Installing $app..." --weight=10
pushd $install_dir pushd "$install_dir"
ynh_use_nodejs ynh_use_nodejs
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install ynh_exec_warn_less sudo -u "$app" env "$ynh_node_load_PATH" "$ynh_npm" install
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH NODE_ENV=production $ynh_npm run build ynh_exec_warn_less sudo -u "$app" env "$ynh_node_load_PATH" NODE_ENV=production "$ynh_npm" run build
popd popd
#================================================= #=================================================
@ -96,24 +84,24 @@ ynh_script_progression --message="Adding a configuration file..."
ynh_add_config --template=".env.example" --destination="$install_dir/.env" ynh_add_config --template=".env.example" --destination="$install_dir/.env"
chmod 400 "$install_dir/.env" chmod 400 "$install_dir/.env"
chown $app:$app "$install_dir/.env" chown "$app:$app" "$install_dir/.env"
#================================================= #=================================================
# BUILDING # BUILDING
#================================================= #=================================================
ynh_script_progression --message="Building..." --weight=10 ynh_script_progression --message="Building..." --weight=10
pushd $install_dir pushd "$install_dir"
php$phpversion artisan key:generate -n --force --env "php$phpversion" artisan key:generate -n --force --env
php$phpversion artisan migrate -n --force "php$phpversion" artisan migrate -n --force
php$phpversion artisan config:clear -n "php$phpversion" artisan config:clear -n
php$phpversion artisan config:cache -n "php$phpversion" artisan config:cache -n
popd popd
# Setup custom user.css file chmod 750 "$install_dir"
ynh_add_config --template="user.css.example" --destination="$install_dir/public/dist/user.css" chmod 750 "$install_dir/bootstrap/cache"
chmod 750 "$install_dir/public/dist/user.css" chmod -R o-rwx "$install_dir"
chown $app:$app "$install_dir/public/dist/user.css" chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -19,7 +19,7 @@ ynh_restore_file --origin_path="$install_dir"
chmod 750 "$install_dir/bootstrap/cache" chmod 750 "$install_dir/bootstrap/cache"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# RESTORE THE DATA DIRECTORY # RESTORE THE DATA DIRECTORY
@ -28,7 +28,7 @@ ynh_script_progression --message="Restoring the data directory..."
ynh_restore_file --origin_path="$data_dir" --not_mandatory ynh_restore_file --origin_path="$data_dir" --not_mandatory
chown -R $app:www-data "$data_dir" chown -R "$app:www-data" "$data_dir"
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
@ -36,7 +36,7 @@ chown -R $app:www-data "$data_dir"
ynh_script_progression --message="Reinstalling dependencies..." --weight=7 ynh_script_progression --message="Reinstalling dependencies..." --weight=7
# Install Nodejs # Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version"
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION # RESTORE THE PHP-FPM CONFIGURATION
@ -46,11 +46,11 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..."
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
# Recreate a dedicated PHP-FPM config # Recreate a dedicated PHP-FPM config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion ynh_add_fpm_config
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
@ -59,7 +59,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..."
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name="php$phpversion-fpm" --action=reload
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================

View file

@ -9,37 +9,14 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
timezone="$(cat /etc/timezone)"
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# If fpm_footprint doesn't exist, create it
if [ -z "${fpm_footprint:-}" ]; then
fpm_footprint=low
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
fi
# If fpm_free_footprint doesn't exist, create it
if [ -z "${fpm_free_footprint:-}" ]; then
fpm_free_footprint=0
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
fi
# If fpm_usage doesn't exist, create it
if [ -z "${fpm_usage:-}" ]; then
fpm_usage=low
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
fi
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -49,13 +26,12 @@ then
ynh_script_progression --message="Upgrading source files..." --weight=4 ynh_script_progression --message="Upgrading source files..." --weight=4
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --keep=".env public/dist/user.css" --full_replace=1 ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep=".env"
fi fi
chmod 750 "$install_dir/bootstrap/cache" chmod 750 "$install_dir/bootstrap/cache"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R "$app:www-data" "$install_dir"
chmod -R 755 $data_dir
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPGRADE DEPENDENCIES
@ -63,7 +39,7 @@ chmod -R 755 $data_dir
ynh_script_progression --message="Upgrading dependencies..." --weight=5 ynh_script_progression --message="Upgrading dependencies..." --weight=5
# Install Nodejs # Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version"
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
@ -71,7 +47,7 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint ynh_add_fpm_config
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
@ -81,12 +57,12 @@ ynh_add_nginx_config
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE
#================================================= #=================================================
#ynh_script_progression --message="Updating a configuration file..." ynh_script_progression --message="Updating a configuration file..."
#ynh_add_config --template=".env.example" --destination="$install_dir/.env" ynh_add_config --template=".env.example" --destination="$install_dir/.env"
#chmod 400 "$install_dir/.env" chmod 400 "$install_dir/.env"
#chown $app:$app "$install_dir/.env" chown "$app:$app" "$install_dir/.env"
#================================================= #=================================================
# INSTALL APP WITH COMPOSER # INSTALL APP WITH COMPOSER
@ -100,10 +76,10 @@ ynh_install_composer
#================================================= #=================================================
ynh_script_progression --message="Installing $app..." --weight=10 ynh_script_progression --message="Installing $app..." --weight=10
pushd $install_dir pushd "$install_dir"
ynh_use_nodejs ynh_use_nodejs
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install ynh_exec_warn_less sudo -u "$app" env "$ynh_node_load_PATH" "$ynh_npm" install
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH NODE_ENV=production $ynh_npm run build ynh_exec_warn_less sudo -u "$app" env "$ynh_node_load_PATH" NODE_ENV=production "$ynh_npm" run build
popd popd
#================================================= #=================================================
@ -113,17 +89,17 @@ ynh_script_progression --message="Building..." --weight=4
ynh_exec_warn_less ynh_composer_exec --commands="dump-autoload" ynh_exec_warn_less ynh_composer_exec --commands="dump-autoload"
pushd $install_dir pushd "$install_dir"
php$phpversion artisan migrate -n --force "php$phpversion" artisan migrate -n --force
php$phpversion artisan config:clear -n "php$phpversion" artisan config:clear -n
php$phpversion artisan config:cache -n "php$phpversion" artisan config:cache -n
php$phpversion artisan view:clear "php$phpversion" artisan view:clear
popd popd
chmod 750 "$install_dir" chmod 750 "$install_dir"
chmod 750 "$install_dir/bootstrap/cache" chmod 750 "$install_dir/bootstrap/cache"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT