From c0be2e5239ccad4cff25d5bd1584eabd11617220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 14 Dec 2020 20:54:09 +0100 Subject: [PATCH] Testing (#21) * Upgrade to 5.0.4 --- README.md | 18 +++++++------- check_process | 2 +- conf/.env | 6 ++--- conf/app.src | 4 ++-- issue_template.md | 6 ++--- manifest.json | 22 ++++++++++------- scripts/_common.sh | 4 ++-- scripts/backup | 1 - scripts/install | 60 ++++++++++++++++++++++++---------------------- scripts/remove | 20 +++++++--------- scripts/restore | 13 +++++----- scripts/upgrade | 41 ++++++++++++++----------------- 12 files changed, 97 insertions(+), 100 deletions(-) diff --git a/README.md b/README.md index c2643e9..1c8d02f 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,19 @@ -# Snipe-IT app for YunoHost +# Snipe-IT for YunoHost [![Integration level](https://dash.yunohost.org/integration/snipeit.svg)](https://dash.yunohost.org/appci/app/snipeit) ![](https://ci-apps.yunohost.org/ci/badges/snipeit.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/snipeit.maintain.svg) [![Install Snipe-IT with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=snipeit) - > *This package allows you to install Snipe-IT quickly and simply on a YunoHost server. If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview -This is a FOSS project for asset management in IT Operations. Knowing who has which laptop, when it was purchased in order to depreciate it correctly, handling software licenses, etc. +Snipe-IT is a FOSS project for asset management in IT Operations. Knowing who has which laptop, when it was purchased in order to depreciate it correctly, handling software licenses, etc. It is built on Laravel 5.4. -It is built on Laravel 5.4. +**Shipped version:** 5.0.4 -**Shipped version:** 4.9.2 +## Screenshots + +![](https://snipeitapp.com/img/screenshots/screenshot-license-list.png) ## Demo @@ -26,8 +27,8 @@ It is built on Laravel 5.4. #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/snipeit%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/snipeit/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/snipeit%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/snipeit/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/snipeit%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/snipeit/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/snipeit%20%28Community%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/snipeit/) ## Links @@ -38,8 +39,7 @@ It is built on Laravel 5.4. --- -Developer info ----------------- +## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/snipeit_ynh/tree/testing). diff --git a/check_process b/check_process index 32c586b..5f43ac5 100644 --- a/check_process +++ b/check_process @@ -20,7 +20,7 @@ upgrade=1 upgrade=1 from_commit=f0ce10dd27b78009dd754c4210111aa0eff12ad9 backup_restore=1 - multi_instance=1 + multi_instance=0 incorrect_path=1 port_already_use=0 change_url=0 diff --git a/conf/.env b/conf/.env index d5add3f..129bc5d 100644 --- a/conf/.env +++ b/conf/.env @@ -4,7 +4,7 @@ APP_ENV=production APP_DEBUG=false APP_KEY=ChangeMe -APP_URL= +APP_URL=http://__DOMAIN__ APP_TIMEZONE='UTC' APP_LOCALE=__LANGUAGE__ @@ -39,9 +39,9 @@ MAIL_PORT=25 MAIL_USERNAME= MAIL_PASSWORD= MAIL_ENCRYPTION=null -MAIL_FROM_ADDR=snipeit@yunodomain +MAIL_FROM_ADDR=snipeit@__DOMAIN__ MAIL_FROM_NAME='Snip-IT' -MAIL_REPLYTO_ADDR=snipeit@yunodomain +MAIL_REPLYTO_ADDR=snipeit@__DOMAIN__ MAIL_REPLYTO_NAME='Snipe-IT' # -------------------------------------------- diff --git a/conf/app.src b/conf/app.src index c863ec4..ed58018 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/snipe/snipe-it/archive/v4.9.2.tar.gz -SOURCE_SUM=57b15469492f063f6c893da20ccaf34921810ea40f83f56186cee8aff91fe161 +SOURCE_URL=https://github.com/snipe/snipe-it/archive/v5.0.4.tar.gz +SOURCE_SUM=b06eef8d8f7a3063d93ebfcfe10c1d238c8879d555d0b48e01cc854e9d3d1d44 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/issue_template.md b/issue_template.md index b1cc06e..a975880 100644 --- a/issue_template.md +++ b/issue_template.md @@ -7,7 +7,7 @@ about: When creating a bug report, please use the following template to provide **How to post a meaningful bug report** 1. *Read this whole template first.* 2. *Make sure you are on the right place:* - - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change url...), you are on the right place!* + - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* - *In doubt, ask here and we will figure it out together.* 3. *Delete these italic comments as you write over them below, and remove this guide.* @@ -36,8 +36,8 @@ about: When creating a bug report, please use the following template to provide - *If you used the webadmin, please perform the equivalent command from the CLI first.* - *If the error occurs in your browser, explain what you did:* 1. *Go to '...'* - 2. *Click on '....'* - 3. *Scroll down to '....'* + 2. *Click on '...'* + 3. *Scroll down to '...'* 4. *See error* ### Expected behavior diff --git a/manifest.json b/manifest.json index 2e6f354..f742d29 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Manage assets for IT operations", "fr": "Gestionnaire de ressources informatiques" }, - "version": "4.9.2~ynh1", + "version": "5.0.4~ynh1", "url": "https://snipeitapp.com/", "license": "MIT", "maintainer": { @@ -14,12 +14,12 @@ "email": "anmol@datamol.org" }, "requirements": { - "yunohost": ">= 3.8" + "yunohost": ">= 4.0.0" }, - "multi_instance": true, + "multi_instance": false, "services": [ "nginx", - "php-fpm", + "php7.0-fpm", "mysql" ], "arguments": { @@ -28,7 +28,8 @@ "name": "domain", "type": "domain", "ask": { - "en": "Choose a domain name for SnipeIT" + "en": "Choose a domain name for Snipe-IT", + "fr": "Choisissez un nom de domaine pour Snipe-IT" }, "example": "example.com" }, @@ -36,7 +37,8 @@ "name": "admin", "type": "user", "ask": { - "en": "Choose an admin user" + "en": "Choose an admin user", + "fr": "Choisissez l'administrateur" }, "example": "johndoe" }, @@ -44,7 +46,8 @@ "name": "is_public", "type": "boolean", "ask": { - "en": "Is it a public application?" + "en": "Is it a public application?", + "fr": "Est-ce une application publique ?" }, "default": true }, @@ -52,9 +55,10 @@ "name": "language", "type": "string", "ask": { - "en": "Choose the application language" + "en": "Choose the application language", + "fr": "Choisissez la langue de l'application" }, - "choices": ["en", "en-GB", "af", "ar", "bg", "zh-CN", "zh-TW", "hr", "cs", "da", "nl", "et", "fi", "fr", "de", "el", "he", "hu", "id", "en-ID", "ga-IE", "it", "ja", "ko", "lv", "lt", "ms", "mi", "mn", "no", "fa", "pl", "pt-PT", "pt-BR", "ro", "ru", "es-ES", "es-CO", "sv-SE", "ta", "tr", "vi", "zu"], + "choices": ["en", "fr"], "default": "en" } ] diff --git a/scripts/_common.sh b/scripts/_common.sh index d64b947..2f36635 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -10,6 +10,7 @@ pkg_dependencies="openssl" YNH_PHP_VERSION=7.3 + extra_php_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-common php${YNH_PHP_VERSION}-gd" #================================================= @@ -29,8 +30,7 @@ exec_as() { if [[ $USER = $(whoami) ]]; then eval $@ else - # use sudo twice to be root and be allowed to use another user - sudo sudo -u "$USER" $@ + sudo -u "$USER" $@ fi } diff --git a/scripts/backup b/scripts/backup index 8d370d7..796c5b4 100755 --- a/scripts/backup +++ b/scripts/backup @@ -6,7 +6,6 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers diff --git a/scripts/install b/scripts/install index 414d35f..5789a32 100755 --- a/scripts/install +++ b/scripts/install @@ -34,7 +34,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." +ynh_script_progression --message="Validating installation parameters..." --weight=1 final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -45,7 +45,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." +ynh_script_progression --message="Storing installation settings..." --weight=2 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url @@ -58,14 +58,14 @@ ynh_app_setting_set --app=$app --key=language --value=$language #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." +ynh_script_progression --message="Installing dependencies..." --weight=3 ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_script_progression --message="Creating a MySQL database..." +ynh_script_progression --message="Creating a MySQL database..." --weight=7 db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name @@ -75,7 +75,7 @@ ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." +ynh_script_progression --message="Setting up source files..." --weight=2 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src @@ -84,15 +84,15 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." +ynh_script_progression --message="Configuring NGINX web server..." --weight=5 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." +ynh_script_progression --message="Configuring system user..." --weight=3 # Create a system user ynh_system_user_create --username=$app @@ -100,9 +100,9 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring php-fpm..." +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=low --footprint=low --package="$extra_php_dependencies" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) @@ -111,7 +111,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # INSTALL AND INITIALIZE COMPOSER #================================================= -ynh_script_progression --message="Installing composer..." +ynh_script_progression --message="Installing Composer..." --weight=21 # Install composer ynh_install_composer @@ -127,23 +127,24 @@ email=$(ynh_user_get_info $admin 'mail') # setup application config cp ../conf/.env $final_path/.env - -ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/.env" -ynh_replace_string "__DB_PASS__" "$db_pwd" "$final_path/.env" -ynh_replace_string "__DB_USER__" "$db_name" "$final_path/.env" -ynh_replace_string "yunodomain" "$domain" "$final_path/.env" -ynh_replace_string "__LANGUAGE__" "$language" "$final_path/.env" +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/.env" +ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="$final_path/.env" +ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_name" --target_file="$final_path/.env" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/.env" +ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/.env" # setup application config -( cd $final_path && php$YNH_PHP_VERSION artisan key:generate -n --force --env) -( cd $final_path && php$YNH_PHP_VERSION artisan migrate -n --force) -( cd $final_path && php$YNH_PHP_VERSION artisan config:clear -n) -( cd $final_path && php$YNH_PHP_VERSION artisan config:cache -n) +pushd "$final_path" + php$phpversion artisan key:generate -n --force --env + php$phpversion artisan migrate -n --force + php$phpversion artisan config:clear -n + php$phpversion artisan config:cache -n +popd #================================================= # STORE THE CONFIG FILE CHECKSUM #================================================= -ynh_script_progression --message="Storing the config file checksum..." +ynh_script_progression --message="Storing the config file checksum..." --weight=1 # Calculate and store the config file checksum into the app settings ynh_store_file_checksum "$final_path/.env" @@ -153,7 +154,7 @@ ynh_store_file_checksum "$final_path/.env" #================================================= # SECURE FILES AND DIRECTORIES #================================================= -ynh_script_progression --message="Securing files and directories..." +ynh_script_progression --message="Securing files and directories..." --weight=1 # Set permissions to app files chown -R $app: $final_path @@ -163,19 +164,20 @@ chmod -R 755 $final_path/public/uploads #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." +ynh_script_progression --message="Configuring SSOwat..." --weight=3 -# Make app public if necessary +# Make app public if necessary or protect it if [ $is_public -eq 1 ] then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission "main" --add "visitors" fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -183,4 +185,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" +ynh_script_progression --message="Installation of $app completed" --last diff --git a/scripts/remove b/scripts/remove index b335056..dff964c 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -23,12 +23,10 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # STANDARD REMOVE -#================================================= - #================================================= # REMOVE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Removing the MySQL database..." +ynh_script_progression --message="Removing the MySQL database" --weight=1 # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name @@ -36,7 +34,7 @@ ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." +ynh_script_progression --message="Removing dependencies" --weight=2 # Remove metapackage and its dependencies ynh_remove_app_dependencies @@ -44,7 +42,7 @@ ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." +ynh_script_progression --message="Removing Snipe-IT main directory" --weight=5 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -52,17 +50,17 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." +ynh_script_progression --message="Removing NGINX web server configuration" --weight=1 -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Removing php-fpm configuration..." +ynh_script_progression --message="Removing PHP-FPM configuration" --weight=2 -# Remove the dedicated php-fpm config +# Remove the dedicated PHP-FPM config ynh_remove_fpm_config #================================================= @@ -70,7 +68,7 @@ ynh_remove_fpm_config #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." +ynh_script_progression --message="Removing the dedicated system user" --weight=1 # Delete a system user ynh_system_user_delete --username=$app diff --git a/scripts/restore b/scripts/restore index e9e17ab..2508374 100755 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,6 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -23,7 +22,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading settings..." +ynh_script_progression --message="Loading settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -37,7 +36,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." +ynh_script_progression --message="Validating restoration parameters..." --weight=2 ynh_webpath_available --domain=$domain --path_url=$path_url \ || ynh_die --message="Path not available: ${domain}${path_url}" @@ -56,14 +55,14 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring Snipe-IT main directory..." --weight=7 ynh_restore_file --origin_path="$final_path" #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." +ynh_script_progression --message="Recreating the dedicated system user..." --weight=2 # Create the dedicated user (if not existing) ynh_system_user_create --username=$app @@ -92,7 +91,7 @@ ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencie #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." +ynh_script_progression --message="Reinstalling dependencies..." --weight=8 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies @@ -111,7 +110,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ #================================================= # 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=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index adc82e7..6129e57 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -35,7 +35,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # Fix is_public as a boolean value if [ "$is_public" = "Yes" ]; then @@ -61,7 +61,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." +ynh_script_progression --message="Backing up Snipe-IT before upgrading (may take a while)..." --weight=4 # Backup the current version of the app ynh_backup_before_upgrade @@ -72,13 +72,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -path_url=$(ynh_normalize_url_path --path_url=$path_url) - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -87,7 +80,7 @@ path_url=$(ynh_normalize_url_path --path_url=$path_url) if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Upgrading source files..." + ynh_script_progression --message="Upgrading source files..." --weight=7 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" @@ -96,22 +89,22 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=3 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." +ynh_script_progression --message="Upgrading dependencies..." --weight=3 ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) ynh_system_user_create --username=$app @@ -119,9 +112,9 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading php-fpm configuration..." +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=low --footprint=low --package="$extra_php_dependencies" #================================================= @@ -129,16 +122,18 @@ ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencie #================================================= # INSTALL AND INITIALIZE COMPOSER #================================================= -ynh_script_progression --message="Installing composer..." +ynh_script_progression --message="Installing Composer..." --weight=15 # Install composer ynh_install_composer ynh_exec_warn_less ynh_composer_exec --commands=\"dump-autoload\" -( cd $final_path && php$YNH_PHP_VERSION artisan migrate -n --force) -( cd $final_path && php$YNH_PHP_VERSION artisan config:clear -n ) -( cd $final_path && php$YNH_PHP_VERSION artisan config:cache -n ) +pushd "$final_path" + php$phpversion artisan migrate -n --force + php$phpversion artisan config:clear -n + php$phpversion artisan config:cache -n +popd ynh_backup_if_checksum_is_different --file="$final_path/.env" # Recalculate and store the checksum of the file for the next upgrade. @@ -149,7 +144,7 @@ ynh_store_file_checksum --file="$final_path/.env" #================================================= # SECURE FILES AND DIRECTORIES #================================================= -ynh_script_progression --message="Securing files and directories..." +ynh_script_progression --message="Securing files and directories..." --weight=1 # Set permissions on app files chown -R $app: $final_path @@ -171,7 +166,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload