1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/chuwiki_ynh.git synced 2024-09-03 18:16:18 +02:00

Cleanup, cosmetics

This commit is contained in:
Félix Piédallu 2023-10-03 13:52:00 +02:00 committed by Salamandar
parent b80b699d04
commit c8fc90d771
5 changed files with 18 additions and 44 deletions

View file

@ -9,10 +9,12 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
#================================================= #=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 ynh_script_progression --message="Updating NGINX web server configuration..." --weight=3
ynh_change_url_nginx_config ynh_change_url_nginx_config

View file

@ -32,24 +32,18 @@ ynh_script_progression --message="Setting up source files..." --weight=1
ynh_setup_source --dest_dir="$install_dir" ynh_setup_source --dest_dir="$install_dir"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir" chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# PHP-FPM CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
ynh_add_fpm_config --usage="$fpm_usage" --footprint="$fpm_footprint"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
ynh_add_nginx_config ynh_add_nginx_config
ynh_add_fpm_config --usage="$fpm_usage" --footprint="$fpm_footprint"
#================================================= #=================================================
# CREATE DATA DIRECTORY # CREATE DATA DIRECTORY
#================================================= #=================================================

View file

@ -10,17 +10,12 @@ source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
ynh_remove_nginx_config ynh_remove_nginx_config
#=================================================
# REMOVE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1
ynh_remove_fpm_config ynh_remove_fpm_config
#================================================= #=================================================

View file

@ -10,14 +10,6 @@
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
@ -25,7 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$install_dir" ynh_restore_file --origin_path="$install_dir"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir" chown -R "$app:www-data" "$install_dir"
@ -36,20 +27,17 @@ ynh_script_progression --message="Restoring the data directory..." --weight=1
ynh_restore_file --origin_path="$data_dir" --not_mandatory ynh_restore_file --origin_path="$data_dir" --not_mandatory
# this will be treated as a security issue.
chmod 750 "$data_dir"
chmod -R o-rwx "$data_dir" chmod -R o-rwx "$data_dir"
chown -R "$app:www-data" "$data_dir" chown -R "$app:www-data" "$data_dir"
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION # RESTORE SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
# Recreate a dedicated php-fpm config ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_add_fpm_config --usage="$fpm_usage" --footprint="$fpm_footprint" --phpversion="$phpversion"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
@ -59,7 +47,7 @@ ynh_add_fpm_config --usage="$fpm_usage" --footprint="$fpm_footprint" --phpversio
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1
ynh_systemd_action --service_name="php$phpversion-fpm" --action=reload ynh_systemd_action --service_name="php$phpversion-fpm" --action=reload
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name="nginx" --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -67,22 +67,17 @@ fi
chmod 750 "$install_dir" chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# PHP-FPM CONFIGURATION # REAPPLY SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
ynh_add_nginx_config ynh_add_nginx_config
ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================