diff --git a/scripts/install b/scripts/install index ff59092..91f223c 100755 --- a/scripts/install +++ b/scripts/install @@ -17,11 +17,6 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --source_id=$YNH_ARCH -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" -chmod +x "$install_dir/shiori" - #================================================= # NGINX CONFIGURATION #================================================= @@ -68,6 +63,15 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +#================================================= +# SECURE FILES AND DIRECTORIES +#================================================= + +# Set permissions to app files +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod +x "$install_dir/shiori" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 1bda66d..8e4ecdd 100755 --- a/scripts/restore +++ b/scripts/restore @@ -26,11 +26,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" -chmod +x "$install_dir/shiori" - #================================================= # RESTORE THE DATA DIRECTORY #================================================= @@ -73,6 +68,15 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +#================================================= +# SECURE FILES AND DIRECTORIES +#================================================= + +# Set permissions to app files +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod +x "$install_dir/shiori" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8487e7d..62044d5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -36,11 +36,6 @@ then ynh_setup_source --dest_dir="$install_dir" --source_id=$YNH_ARCH fi -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" -chmod +x "$install_dir/shiori" - #================================================= # NGINX CONFIGURATION #================================================= @@ -81,6 +76,15 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +#================================================= +# SECURE FILES AND DIRECTORIES +#================================================= + +# Set permissions to app files +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod +x "$install_dir/shiori" + #================================================= # END OF SCRIPT #=================================================