diff --git a/scripts/install b/scripts/install index 2402e13..04041ac 100644 --- a/scripts/install +++ b/scripts/install @@ -78,7 +78,7 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st ynh_script_progression --message="Configuring system user..." --weight=2 # Create a system user -ynh_system_user_create --username=$app --home_dir=$final_path +ynh_system_user_create --username=$app #================================================= # CREATE A POSTGRESQL DATABASE @@ -115,10 +115,12 @@ ynh_add_nginx_config #============================================== ynh_script_progression --message="Building CodiMD... (this will take some time and resources!)" --weight=24 +chown -R $app: $final_path + pushd "$final_path" || ynh_die ynh_use_nodejs - ynh_exec_warn_less bin/setup - ynh_exec_warn_less yarn run build + ynh_exec_warn_less ynh_exec_as $app bin/setup + ynh_exec_warn_less ynh_exec_as $app yarn run build popd || ynh_die #================================================= @@ -149,7 +151,7 @@ ynh_add_config --template="../conf/.sequelizerc.example" --destination="$final_p ynh_script_progression --message="Securing files and directories..." # Set permissions to app files -chown -R $app:$app $final_path +chown -R $app: $final_path chmod 600 $final_path/config.json chmod 600 $final_path/.sequelizerc diff --git a/scripts/upgrade b/scripts/upgrade index fa5a658..5204867 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -133,10 +133,12 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Building CodiMD... (this will take some time and resources!)" --weight=16 + chown -R $app: $final_path + pushd "$final_path" || ynh_die ynh_use_nodejs - ynh_exec_warn_less $app bin/setup - ynh_exec_warn_less yarn run build + ynh_exec_warn_less ynh_exec_as $app bin/setup + ynh_exec_warn_less ynh_exec_as $app yarn run build popd || ynh_die fi @@ -167,7 +169,7 @@ ynh_add_systemd_config ynh_script_progression --message="Securing files and directories..." --weight=1 # Set permissions on app files -chown -R $app:$app $final_path +chown -R $app: $final_path #================================================= # INTEGRATE SERVICE IN YUNOHOST