From c754784509f0835b0df21e19113835b47bfd9dd6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 10 Apr 2022 13:42:21 +0200 Subject: [PATCH] cleaning up --- scripts/install | 24 +++++++++++++++--------- scripts/remove | 9 +++++++-- scripts/upgrade | 7 ------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/scripts/install b/scripts/install index 2e54628..451e477 100644 --- a/scripts/install +++ b/scripts/install @@ -92,6 +92,14 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 + +# Create a dedicated NGINX config +ynh_add_nginx_config + #================================================= # CREATE DATA DIRECTORY #================================================= @@ -113,8 +121,9 @@ chmod -R o-rwx "$datadir" chown -R $app:www-data "$datadir" #================================================= -# MODIFY A CONFIG FILE +# ADD A CONFIGURATION #================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 if [ "$path_url" = "/" ] then @@ -130,17 +139,14 @@ chown $app:$app "$final_path/custom/conf/app.ini" ynh_add_config --template="../conf/ldap.conf" --destination="$final_path/custom/conf/auth.d/ldap.conf" +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Configuring a systemd service..." --weight=1 + # Configure init script ynh_add_systemd_config -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=2 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/remove b/scripts/remove index 2a6e9d4..ab926e8 100644 --- a/scripts/remove +++ b/scripts/remove @@ -71,8 +71,6 @@ then ynh_secure_remove --file="$datadir" fi -ynh_secure_remove --file="/var/log/$app" - #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= @@ -89,6 +87,13 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- # Remove the dedicated NGINX config ynh_remove_nginx_config +#================================================= +# REMOVE VARIOUS FILES +#================================================= +ynh_script_progression --message="Removing various files..." --weight=1 + +ynh_secure_remove --file="/var/log/$app" + #================================================= # REMOVE DEDICATED USER #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2d827fd..e75392b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -69,13 +69,6 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" -#================================================= -# STANDARD UPGRADE STEPS -#================================================= - -# Clean template to fix issue : https://github.com/gogits/gogs/issues/4585 -ynh_secure_remove --file="$final_path/templates" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #=================================================