diff --git a/scripts/install b/scripts/install index a88d152..9a2ae63 100755 --- a/scripts/install +++ b/scripts/install @@ -55,13 +55,13 @@ db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name -# #================================================= -# # CREATE DEDICATED USER -# #================================================= -# ynh_script_progression --message="Configuring system user..." --weight=1 +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=1 -# # Create a system user -# ynh_system_user_create --username=$app --home_dir=$final_path +# Create a system user +ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -104,6 +104,8 @@ ynh_add_config --template="../conf/.env.example" --destination="$final_path/.env ynh_script_progression --message="Setuping a cron..." ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" +chown root: "/etc/cron.d/$app" +chmod 644 "/etc/cron.d/$app" #================================================= # GENERIC FINALIZATION @@ -115,9 +117,10 @@ ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" # chown -R $app:$app $final_path # chmod 600 $final_path/.env -chown -R root:root $final_path -chown -R www-data:www-data $final_path/writable -chown -R www-data:www-data $final_path/public/media +chown -R $app: $final_path +chown -R $app:www-data $final_path/writable +chown -R $app:www-data $final_path/public/media +chmod 640 $final_path/.env #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index 563c0c2..63dec2e 100755 --- a/scripts/restore +++ b/scripts/restore @@ -71,9 +71,13 @@ ynh_restore_file --origin_path="$final_path" # RESTORE USER RIGHTS #================================================= -# Set permissions to app files -chown -R $app:$app $final_path -chmod 600 $final_path/.env +# # Set permissions to app files +# chown -R $app:$app $final_path +# chmod 600 $final_path/.env + +chown -R root:root $final_path +chown -R www-data:www-data $final_path/writable +chown -R www-data:www-data $final_path/public/media #================================================= # RESTORE THE PHP-FPM CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index d1073cd..add9025 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -107,9 +107,13 @@ ynh_add_fpm_config --package="$extra_php_dependencies" # SECURE FILES AND DIRECTORIES #================================================= -# Set permissions to app files +# # Set permissions to app files +# chown -R $app:$app $final_path +# chmod 600 $final_path/.env + chown -R $app:$app $final_path -chmod 600 $final_path/.env +chown -R www-data:www-data $final_path/writable +chown -R www-data:www-data $final_path/public/media #================================================= # RELOAD NGINX