From e8b714100cbcdf0fc47c69e8b5c734f082cd9bb3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 5 Feb 2022 15:45:50 +0100 Subject: [PATCH] Fix --- scripts/install | 27 ++++++++------------------- scripts/upgrade | 12 +++++++++--- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/scripts/install b/scripts/install index eb6f667..c3b0557 100644 --- a/scripts/install +++ b/scripts/install @@ -122,17 +122,6 @@ pushd "$final_path" ynh_exec_warn_less yarn build popd -chown -R $app: $final_path - -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - -ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" - -ynh_add_systemd_config - #================================================= # ADD A CONFIGURATION #================================================= @@ -140,15 +129,15 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="../conf/.env" --destination="$final_path/.env" -#================================================= -# GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= -ynh_script_progression --message="Securing files and directories..." +chown -R $app:www-data "$final_path" -# Set permissions to app files -chown -R $app: $final_path +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Configuring a systemd service..." --weight=1 + +env_path="$PATH" +ynh_add_systemd_config #================================================= # SETUP LOGROTATE diff --git a/scripts/upgrade b/scripts/upgrade index ee255c2..a186602 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -127,15 +127,21 @@ then popd fi -chown -R $app: $final_path +#================================================= +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 + +ynh_add_config --template="../conf/.env" --destination="$final_path/.env" + +chown -R $app:www-data "$final_path" #================================================= # SETUP SYSTEMD #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=2 -ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" - +env_path="$PATH" # Create a dedicated systemd config ynh_add_systemd_config