diff --git a/scripts/install b/scripts/install index 61f6bea..dc0c65a 100644 --- a/scripts/install +++ b/scripts/install @@ -97,7 +97,7 @@ popd chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # NGINX CONFIGURATION @@ -122,14 +122,6 @@ pushd "$final_path" $ynh_npm run build popd -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." - -# Create a dedicated systemd config -ynh_add_systemd_config --others_var="ynh_npm" - #================================================= # ADD A CONFIGURATION #================================================= @@ -140,6 +132,14 @@ ynh_add_config --template="../conf/default.yaml" --destination="$final_path/conf chmod 400 "$final_path/config/production.yaml" chown $app:$app "$final_path/config/production.yaml" +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Configuring a systemd service..." + +# Create a dedicated systemd config +ynh_add_systemd_config --others_var="ynh_npm" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index ae6641b..b049c37 100644 --- a/scripts/restore +++ b/scripts/restore @@ -67,7 +67,7 @@ ynh_restore_file --origin_path="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # SPECIFIC RESTORATION diff --git a/scripts/upgrade b/scripts/upgrade index 03b8358..90d48a9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -89,7 +89,7 @@ fi chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # NGINX CONFIGURATION @@ -125,14 +125,6 @@ pushd "$final_path" $ynh_npm run build popd -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." - -# Create a dedicated systemd config -ynh_add_systemd_config --others_var="ynh_npm" - #================================================= # UPDATE A CONFIG FILE #================================================= @@ -143,6 +135,14 @@ ynh_add_config --template="../conf/default.yaml" --destination="$final_path/conf chmod 400 "$final_path/config/production.yaml" chown $app:$app "$final_path/config/production.yaml" +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Upgrading systemd configuration..." + +# Create a dedicated systemd config +ynh_add_systemd_config --others_var="ynh_npm" + #================================================= # GENERIC FINALIZATION #=================================================