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