From 56bafd98b0bcadb10e51f58323a6202cf9f4f64e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 21 Jul 2021 09:11:11 +0200 Subject: [PATCH] Fix --- manifest.json | 2 +- scripts/install | 15 ++++----------- scripts/restore | 15 +++++---------- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/manifest.json b/manifest.json index c45022f..5e7a665 100644 --- a/manifest.json +++ b/manifest.json @@ -20,7 +20,7 @@ "email": "tituspijean@outlook.com" }, "requirements": { - "yunohost": ">= 4.1.7" + "yunohost": ">= 4.2.0" }, "multi_instance": true, "services": [ diff --git a/scripts/install b/scripts/install index 4adb32d..4996b51 100755 --- a/scripts/install +++ b/scripts/install @@ -101,6 +101,10 @@ pushd $final_path ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install node-red-dashboard popd +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -125,17 +129,6 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=3 # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions to app files -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app: "$final_path" - #================================================= # SETUP LOGROTATE #================================================= diff --git a/scripts/restore b/scripts/restore index 0aab515..1627f1e 100755 --- a/scripts/restore +++ b/scripts/restore @@ -45,13 +45,6 @@ test ! -d $final_path \ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RESTORE THE APP MAIN DIR -#================================================= -ynh_script_progression --message="Restoring Node-RED main directory..." --weight=10 - -ynh_restore_file --origin_path="$final_path" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -61,13 +54,15 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei ynh_system_user_create --username=$app --home_dir=$final_path #================================================= -# RESTORE USER RIGHTS +# RESTORE THE APP MAIN DIR #================================================= +ynh_script_progression --message="Restoring Node-RED main directory..." --weight=10 + +ynh_restore_file --origin_path="$final_path" -# Restore permissions on app files chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R $app: "$final_path" +chown -R $app:www-data "$final_path" # Create log directory and apply permissions mkdir -p /var/log/$app