diff --git a/scripts/install b/scripts/install index acbe31d..717ca3d 100644 --- a/scripts/install +++ b/scripts/install @@ -121,7 +121,7 @@ ynh_setup_source --dest_dir="$final_path/$app" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # NGINX CONFIGURATION @@ -176,6 +176,9 @@ popd ynh_store_file_checksum --file="$config" +chmod 400 "$config" +chown $app:$app "$config" + #================================================= # SETUP SYSTEMD #================================================= diff --git a/scripts/restore b/scripts/restore index 9e43b6e..476f305 100644 --- a/scripts/restore +++ b/scripts/restore @@ -76,7 +76,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 295a561..27e6dcc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -69,9 +69,9 @@ ynh_script_progression --message="Backing up the app before upgrading (may take # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { + ynh_clean_check_starting # Restore it if the upgrade fails ynh_restore_upgradebackup - ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -161,7 +161,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 @@ -218,14 +218,6 @@ if ynh_version_gt "1.0.3~ynh1" "${previous_version}" ; then popd fi -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." - -# Create a dedicated systemd config -ynh_add_systemd_config - #================================================= # UPDATE A CONFIG FILE #================================================= @@ -239,6 +231,14 @@ ynh_store_file_checksum --file="$config" chmod 400 "$config" chown $app:$app "$config" +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Upgrading systemd configuration..." + +# Create a dedicated systemd config +ynh_add_systemd_config + #================================================= # GENERIC FINALIZATION #=================================================