1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lychee_ynh.git synced 2024-09-03 19:36:36 +02:00
This commit is contained in:
eric_G 2024-06-19 00:38:49 +02:00 committed by GitHub
parent eed59ddb3a
commit b9056f7432
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 241 additions and 218 deletions

View file

@ -21,7 +21,7 @@ Upload, manage and share photos like from a native application.
Lychee comes with everything you need and all your photos are stored securely. Lychee comes with everything you need and all your photos are stored securely.
**Shipped version:** 5.3.1~ynh1 **Shipped version:** 5.4.0~ynh1
**Demo:** <https://lycheeorg.github.io/demo/> **Demo:** <https://lycheeorg.github.io/demo/>

View file

@ -21,7 +21,7 @@ Upload, manage and share photos like from a native application.
Lychee comes with everything you need and all your photos are stored securely. Lychee comes with everything you need and all your photos are stored securely.
**Versión actual:** 5.3.1~ynh1 **Versión actual:** 5.4.0~ynh1
**Demo:** <https://lycheeorg.github.io/demo/> **Demo:** <https://lycheeorg.github.io/demo/>

View file

@ -21,7 +21,7 @@ Upload, manage and share photos like from a native application.
Lychee comes with everything you need and all your photos are stored securely. Lychee comes with everything you need and all your photos are stored securely.
**Paketatutako bertsioa:** 5.3.1~ynh1 **Paketatutako bertsioa:** 5.4.0~ynh1
**Demoa:** <https://lycheeorg.github.io/demo/> **Demoa:** <https://lycheeorg.github.io/demo/>

View file

@ -21,7 +21,7 @@ Téléchargez, gérez et partagez des photos comme à partir d'une application n
Lychee est livré avec tout ce dont vous avez besoin et toutes vos photos sont stockées en toute sécurité. Lychee est livré avec tout ce dont vous avez besoin et toutes vos photos sont stockées en toute sécurité.
**Version incluse:** 5.3.1~ynh1 **Version incluse:** 5.4.0~ynh1
**Démo:** <https://lycheeorg.github.io/demo/> **Démo:** <https://lycheeorg.github.io/demo/>

View file

@ -21,7 +21,7 @@ Upload, manage and share photos like from a native application.
Lychee comes with everything you need and all your photos are stored securely. Lychee comes with everything you need and all your photos are stored securely.
**Versión proporcionada:** 5.3.1~ynh1 **Versión proporcionada:** 5.4.0~ynh1
**Demo:** <https://lycheeorg.github.io/demo/> **Demo:** <https://lycheeorg.github.io/demo/>

View file

@ -21,7 +21,7 @@ Upload, manage and share photos like from a native application.
Lychee comes with everything you need and all your photos are stored securely. Lychee comes with everything you need and all your photos are stored securely.
**分发版本:** 5.3.1~ynh1 **分发版本:** 5.4.0~ynh1
**演示:** <https://lycheeorg.github.io/demo/> **演示:** <https://lycheeorg.github.io/demo/>

183
conf/.env Normal file
View file

@ -0,0 +1,183 @@
APP_NAME=Lychee
APP_ENV=production
APP_KEY=
APP_DEBUG=false
# This MUST contain the host name up to the Top Level Domain (tld) e.g. .com, .org etc.
APP_URL=https://__DOMAIN__
APP_FORCE_HTTPS=false
# If using Lychee in a sub folder, specify the path after the tld here.
# For example for https://lychee.test/path/to/lychee
# Set APP_URL=https://lychee.test
# and APP_DIR=/path/to/lychee
# We (LycheeOrg) do not recommend the use of APP_DIR.
APP_DIR=__PATH__/
# enable or disable debug bar. By default it is disabled.
# Do note that this disable CSP!!
DEBUGBAR_ENABLED=true
# enable or disable the v5 layout.
LIVEWIRE_ENABLED=true
# enable or disable log viewer. By default it is enabled.
LOG_VIEWER_ENABLED=true
# enable s3 bucket (required in addition to needing AWS_ACCESS_KEY_ID)
# S3_ENABLED=true
# If you spread old links of to your albums in your Lychee instance starting with
# https://lychee.text/#albumID/PhotoId
# Set this value to true to enable redirection.
LEGACY_V4_REDIRECT=false
##############################################################################
# IMPORTANT: To migrate from Lychee v3 you *MUST* use the same MySQL/MariaDB #
# server as v3. #
##############################################################################
# Table prefix (e.g. lychee_) of a Lychee v3 instance for migration
DB_OLD_LYCHEE_PREFIX=
# DB_CONNECTION can be sqlite, mysql or pgsql. For sqlite the other entries are
# not required, but an existing sqlite3 database may be specified if desired. In
# this case, please use an absolute path. DB_DATABASE may be omitted but should
# *not* be left blank.
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=__DB_NAME__
DB_USERNAME=__DB_USER__
DB_PASSWORD=__DB_PWD__
DB_LOG_SQL=false
# List foreign keys in diagnostic page
DB_LIST_FOREIGN_KEYS=false
# Application timezone. If not specified, the server's default timezone is used.
# Requires a named timezone identifier.
# See https://www.php.net/manual/en/timezones.php for the list of supported timezones.
# Don't use a timezone offset (like +01:00) or a timezone abbreviation (like CEST)
TIMEZONE=__TIMEZONE__
# Visibility of directories and (media) files in LYCHEE_UPLOADS
# Possible values are:
#
# - private: world group has neither read nor write access
# - public: world group has read access but no write access (the default)
# - world: world group has read and write access
#
# The default should suffice for most installations.
# For improved security, change this setting to "private".
# Some rare setups may require directories and files to be world writeable.
# In this case, use "world" here.
# USE WITH PRECAUTIONS: world writeable files and folders may be a SECURITY RISK.
# LYCHEE_IMAGE_VISIBILITY=public
# folders in which the files will be stored
LYCHEE_UPLOADS="__DATA_DIR__/uploads/"
LYCHEE_DIST="__INSTALL_DIR__/public/dist/"
LYCHEE_SYM="__INSTALL_DIR__/public/sym/"
# url to access those files
# LYCHEE_UPLOADS_URL="uploads/"
# LYCHEE_DIST_URL="dist/"
# LYCHEE_SYM_URL="sym/"
# Support for token based authentication used by API requests. Enabled by default.
# ENABLE_TOKEN_AUTH=true
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
# `sync` if jobs needs to be executed live (default) or `database` if they can be defered.
QUEUE_CONNECTION=sync
SECURITY_HEADER_HSTS_ENABLE=false
SECURITY_HEADER_CSP_CONNECT_SRC=
SECURITY_HEADER_SCRIPT_SRC_ALLOW=
SESSION_SECURE_COOKIE=false
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=localhost
MAIL_PORT=25
MAIL_USERNAME=__APP__
MAIL_PASSWORD=__MAIL_PWD__
MAIL_ENCRYPTION=false
MAIL_FROM_NAME=lychee
MAIL_FROM_ADDRESS=lychee@__DOMAIN__
# The trusted proxies if Lychee is behind a reverse proxy
# Accepted values:
# - `null`: no proxy
# - `*`: any proxy
# - <ip address>[,<ip address>]: a comma-seperated list of IP addresses
TRUSTED_PROXIES=null
# Comma-separated list of class names of diagnostics checks that should be skipped.
#SKIP_DIAGNOSTICS_CHECKS=
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
# Oauth token data
# XXX_REDIRECT_URI should be left as default unless you know exactly what you do.
# AMAZON_SIGNIN_CLIENT_ID=
# AMAZON_SIGNIN_SECRET=
# AMAZON_SIGNIN_REDIRECT_URI=/auth/amazon/redirect
# https://developer.okta.com/blog/2019/06/04/what-the-heck-is-sign-in-with-apple
# Note: the client secret used for "Sign In with Apple" is a JWT token that can have a maximum lifetime of 6 months.
# The article above explains how to generate the client secret on demand and you'll need to update this every 6 months.
# To generate the client secret for each request, see Generating A Client Secret For Sign In With Apple On Each Request.
# https://bannister.me/blog/generating-a-client-secret-for-sign-in-with-apple-on-each-request
# APPLE_CLIENT_ID=
# APPLE_CLIENT_SECRET=
# APPLE_REDIRECT_URI=/auth/apple/redirect
# FACEBOOK_CLIENT_ID=
# FACEBOOK_CLIENT_SECRET=
# FACEBOOK_REDIRECT_URI=/auth/facebook/redirect
# GITHUB_CLIENT_ID=
# GITHUB_CLIENT_SECRET=
# GITHUB_REDIRECT_URI=/auth/github/redirect
# GOOGLE_CLIENT_ID=
# GOOGLE_CLIENT_SECRET=
# GOOGLE_REDIRECT_URI=/auth/google/redirect
# MASTODON_DOMAIN=https://mastodon.social
# MASTODON_ID=
# MASTODON_SECRET=
# MASTODON_REDIRECT_URI=/auth/mastodon/redirect
# MICROSOFT_CLIENT_ID=
# MICROSOFT_CLIENT_SECRET=
# MICROSOFT_REDIRECT_URI=/auth/microsoft/redirect
# NEXTCLOUD_CLIENT_ID=
# NEXTCLOUD_CLIENT_SECRET=
# NEXTCLOUD_REDIRECT_URI=/auth/nextcloud/redirect
# NEXTCLOUD_BASE_URI=
# KEYCLOAK_CLIENT_ID=
# KEYCLOAK_CLIENT_SECRET=
# KEYCLOAK_REDIRECT_URI=/auth/keycloak/redirect
# KEYCLOAK_BASE_URL=
# KEYCLOAK_REALM=
# AWS support data
# AWS_ACCESS_KEY_ID=
# AWS_SECRET_ACCESS_KEY=
# AWS_DEFAULT_REGION=
# AWS_BUCKET=
# AWS_URL=
# AWS_ENDPOINT=
# AWS_IMAGE_VISIBILITY=
# AWS_USE_PATH_STYLE_ENDPOINT=

View file

@ -1,94 +0,0 @@
APP_NAME=Lychee
APP_ENV=production
APP_KEY=
APP_DEBUG=false
APP_URL=https://__DOMAIN____PATH__
APP_FORCE_HTTPS=true
# enable or disable debug bar. By default it is disabled.
DEBUGBAR_ENABLED=false
##############################################################################
# IMPORTANT: To migrate from Lychee v3 you *MUST* use the same MySQL/MariaDB #
# server as v3. #
##############################################################################
# Table prefix (e.g. lychee_) of a Lychee v3 instance for migration
DB_OLD_LYCHEE_PREFIX=
# DB_CONNECTION can be sqlite, mysql or pgsql. For sqlite the other entries are
# not required, but an existing sqlite3 database may be specified if desired. In
# this case, please use an absolute path. DB_DATABASE may be omitted but should
# *not* be left blank.
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=__DB_NAME__
DB_USERNAME=__DB_USER__
DB_PASSWORD=__DB_PWD__
DB_LOG_SQL=false
# List foreign keys in diagnostic page
#DB_LIST_FOREIGN_KEYS=true
# Application timezone. If not specified, the server's default timezone is used.
# Requires a named timezone identifier.
# See https://www.php.net/manual/en/timezones.php for the list of supported timezones.
# Don't use a timezone offset (like +01:00) or a timezone abbreviation (like CEST)
TIMEZONE=__TIMEZONE__
# Visibility of directories and (media) files in LYCHEE_UPLOADS
# Possible values are:
#
# - private: world group has neither read nor write access
# - public: world group has read access but no write access (the default)
# - world: world group has read and write access
#
# The default should suffice for most installations.
# For improved security, change this setting to "private".
# Some rare setups may require directories and files to be world writeable.
# In this case, use "world" here.
# USE WITH PRECAUTIONS: world writeable files and folders may be a SECURITY RISK.
LYCHEE_IMAGE_VISIBILITY=public
# folders in which the files will be stored
LYCHEE_UPLOADS="__DATA_DIR__/uploads/"
LYCHEE_DIST="__INSTALL_DIR__/public/dist/"
# LYCHEE_SYM="/var/www/html/Lychee-Laravel/public/sym/"
# url to access those files
# LYCHEE_UPLOADS_URL="uploads/"
# LYCHEE_DIST_URL="dist/"
# LYCHEE_SYM_URL="sym/"
# Support for token based authentication used by API requests. Enabled by default.
ENABLE_TOKEN_AUTH=false
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
SECURITY_HEADER_HSTS_ENABLE=false
SESSION_SECURE_COOKIE=false
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=localhost
MAIL_PORT=25
MAIL_USERNAME=__APP__
MAIL_PASSWORD=__MAIL_PWD__
MAIL_ENCRYPTION=false
MAIL_FROM_NAME=lychee
MAIL_FROM_ADDRESS=lychee@__DOMAIN__
# The trusted proxies if Lychee is behind a reverse proxy
# Accepted values:
# - `null`: no proxy
# - `*`: any proxy
# - <ip address>[,<ip address>]: a comma-seperated list of IP addresses
TRUSTED_PROXIES=null
# Comma-separated list of class names of diagnostics checks that should be skipped.
#SKIP_DIAGNOSTICS_CHECKS=

View file

@ -2,3 +2,7 @@
php_admin_value[upload_max_filesize] = 1G php_admin_value[upload_max_filesize] = 1G
php_admin_value[post_max_size] = 1G php_admin_value[post_max_size] = 1G
php_admin_value[max_execution_time] = 200
php_admin_value[upload_max_size] = 100M
php_admin_value[memory_limit]= 256M

View file

@ -5,7 +5,7 @@ name = "Lychee"
description.en = "Photo-management-system to manage and share photos" description.en = "Photo-management-system to manage and share photos"
description.fr = "Système de gestion de photos pour gérer et partager des photos" description.fr = "Système de gestion de photos pour gérer et partager des photos"
version = "5.3.1~ynh1" version = "5.4.0~ynh1"
maintainers = [] maintainers = []
@ -46,8 +46,8 @@ ram.runtime = "50M"
[resources.sources] [resources.sources]
[resources.sources.main] [resources.sources.main]
url = "https://github.com/LycheeOrg/Lychee/archive/refs/tags/v5.3.1.tar.gz" url = "https://github.com/LycheeOrg/Lychee/releases/download/v5.4.0/Lychee.zip"
sha256 = "4b45b2f486f2c3088aecea4682b9a5159c2b1c7657785f3580e2443c4256184e" sha256 = "bdee8831cd5564ab1e691eaf51dba9b176a977be39eb39d5dcceab1064b82c61"
autoupdate.strategy = "latest_github_tag" autoupdate.strategy = "latest_github_tag"
[resources.system_user] [resources.system_user]
@ -63,7 +63,7 @@ ram.runtime = "50M"
main.auth_header = false main.auth_header = false
[resources.apt] [resources.apt]
packages = "mariadb-server, ffmpeg, php8.2-xml, php8.2-imagick, php8.2-bcmath, php8.2-exif, php8.2-mbstring, php8.2-gd, php8.2-mysqli, php8.2-zip, php8.2-intl" packages = "mariadb-server, ffmpeg, php8.3-xml, php8.3-imagick, php8.3-bcmath, php8.3-exif, php8.3-mbstring, php8.3-gd, php8.3-mysqli, php8.3-zip, php8.3-intl"
[resources.database] [resources.database]
type = "mysql" type = "mysql"

View file

@ -5,9 +5,7 @@
#================================================= #=================================================
# Composer version # Composer version
YNH_COMPOSER_VERSION="2.5.4" YNH_COMPOSER_VERSION="2.7.7"
nodejs_version=16
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS

View file

@ -33,10 +33,6 @@ ynh_backup --src_path="$data_dir" --is_big
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP THE PHP-FPM CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#================================================= #=================================================

View file

@ -10,19 +10,11 @@ source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST # INITIALIZE AND STORE SETTINGS
#================================================= #=================================================
timezone="$(cat /etc/timezone)" timezone="$(cat /etc/timezone)"
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing dependencies..." --weight=7
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -31,16 +23,23 @@ ynh_script_progression --message="Setting up source files..." --weight=3
# 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" ynh_setup_source --dest_dir="$install_dir"
chmod 750 "$install_dir/bootstrap/cache" chmod 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/"
chmod -R 755 "$data_dir"
#================================================= #=================================================
# PHP-FPM CONFIGURATION # APP INITIAL CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 ynh_script_progression --message="Adding $app's configuration files..." --weight=1
ynh_add_config --template=".env" --destination="$install_dir/.env"
chmod 400 "$install_dir/.env"
chown "$app:$app" "$install_dir/.env"
#=================================================
# SYSTEM CONFIGURATION
#=================================================
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config ynh_add_fpm_config
@ -48,16 +47,6 @@ ynh_add_fpm_config
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# SPECIFIC SETUP
#=================================================
# CREATE DATA DIRECTORY
#=================================================
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"
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
#================================================= #=================================================
@ -65,31 +54,10 @@ ynh_script_progression --message="Installing app with Composer..." --weight=15
ynh_install_composer ynh_install_composer
#=================================================
# INSTALL LYCHEE
#=================================================
ynh_script_progression --message="Installing $app..." --weight=10
pushd "$install_dir"
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" NODE_ENV=production "$ynh_npm" run build
popd
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..."
ynh_add_config --template=".env.example" --destination="$install_dir/.env"
chmod 400 "$install_dir/.env"
chown "$app:$app" "$install_dir/.env"
#================================================= #=================================================
# BUILDING # BUILDING
#================================================= #=================================================
ynh_script_progression --message="Building..." --weight=10 ynh_script_progression --message="configuring $app..." --weight=10
pushd "$install_dir" pushd "$install_dir"
"php$phpversion" artisan key:generate -n --force --env "php$phpversion" artisan key:generate -n --force --env
@ -98,10 +66,10 @@ pushd "$install_dir"
"php$phpversion" artisan config:cache -n "php$phpversion" artisan config:cache -n
popd popd
chmod 750 "$install_dir"
chmod 750 "$install_dir/bootstrap/cache"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir" chown -R "$app:www-data" "$install_dir"
chmod -R 775 /home/yunohost.app/$app/
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/"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -10,9 +10,9 @@ source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
# Remove the dedicated NGINX config # Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_remove_nginx_config
@ -20,9 +20,6 @@ ynh_remove_nginx_config
# Remove the dedicated PHP-FPM config # Remove the dedicated PHP-FPM config
ynh_remove_fpm_config ynh_remove_fpm_config
# Remove NodeJS
ynh_remove_nodejs
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -17,37 +17,30 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$install_dir" ynh_restore_file --origin_path="$install_dir"
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"
chgrp "$app" -R "$install_dir/storage" "$install_dir/public/dist" "$install_dir/public/sym"
chmod -R 2775 "$install_dir/storage" "$install_dir/app" "$install_dir/public/dist" "$install_dir/public/sym" "$install_dir/bootstrap/"
#================================================= #=================================================
# RESTORE THE DATA DIRECTORY # RESTORE THE DATA DIRECTORY
#================================================= #=================================================
ynh_script_progression --message="Restoring the data directory..." ynh_script_progression --message="Restoring the data directory..." --weight=1
ynh_restore_file --origin_path="$data_dir" --not_mandatory ynh_restore_file --origin_path="$data_dir" --not_mandatory
chmod -R 775 "$data_dir"
chown -R "$app:www-data" "$data_dir" chown -R "$app:www-data" "$data_dir"
chgrp "$app" -R "$data_dir/uploads"
chmod -R 2775 "$data_dir/uploads"
#================================================= #=================================================
# REINSTALL DEPENDENCIES # RESTORE SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=7 ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version"
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
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
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
@ -57,7 +50,7 @@ ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name
#================================================= #=================================================
# RELOAD NGINX AND PHP-FPM # RELOAD NGINX AND PHP-FPM
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1
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

@ -17,24 +17,25 @@ timezone="$(cat /etc/timezone)"
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" #--full_replace=1 ynh_setup_source --dest_dir="$install_dir" --keep=".env public/uploads/" --full_replace=1
chmod 750 "$install_dir/bootstrap/cache" chmod o-rwx "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir" chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPDATE A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=5 ynh_script_progression --message="Updating a configuration file..." --weight=1
# Install Nodejs ynh_add_config --template=".env" --destination="$install_dir/.env"
ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version"
chmod 400 "$install_dir/.env"
chown "$app:$app" "$install_dir/.env"
#================================================= #=================================================
# PHP-FPM CONFIGURATION # REAPPLY SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config ynh_add_fpm_config
@ -42,18 +43,6 @@ ynh_add_fpm_config
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# SPECIFIC UPGRADE
#=================================================
# UPDATE A CONFIG FILE
#=================================================
ynh_script_progression --message="Updating a configuration file..."
ynh_add_config --template=".env.example" --destination="$install_dir/.env"
chmod 400 "$install_dir/.env"
chown "$app:$app" "$install_dir/.env"
#================================================= #=================================================
# INSTALL APP WITH COMPOSER # INSTALL APP WITH COMPOSER
#================================================= #=================================================
@ -61,21 +50,10 @@ ynh_script_progression --message="Installing app with Composer..." --weight=1
ynh_install_composer ynh_install_composer
#=================================================
# INSTALL LYCHEE
#=================================================
ynh_script_progression --message="Installing $app..." --weight=10
pushd "$install_dir"
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" NODE_ENV=production "$ynh_npm" run build
popd
#================================================= #=================================================
# BUILDING # BUILDING
#================================================= #=================================================
ynh_script_progression --message="Building..." --weight=4 ynh_script_progression --message="Configuring $app..." --weight=4
ynh_exec_warn_less ynh_composer_exec --commands="dump-autoload" ynh_exec_warn_less ynh_composer_exec --commands="dump-autoload"
@ -87,10 +65,10 @@ pushd "$install_dir"
"php$phpversion" artisan view:clear "php$phpversion" artisan view:clear
popd popd
chmod 750 "$install_dir"
chmod 750 "$install_dir/bootstrap/cache"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir" chown -R "$app:www-data" "$install_dir"
chmod -R 775 /home/yunohost.app/$app/
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/"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT